Token导航 LogoToken导航TokenDH.com
Llama 4 Maverick MCP Server logo
运维云端stdio官方级别未说明来源级核验

Llama 4 Maverick MCP Server

MCP Server

一个Python实现的模型上下文协议(MCP)服务器,用于在本地Llama模型和Claude Desktop之间建立高性能桥接,支持隐私保护、自定义模型部署和实时处理。

工具数

9

提示词数

0

GitHub Stars

0

资源数

0
本地AIPythonClaude隐私保护Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

YobieBen

提供方

YobieBen

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python setup.py

详细介绍

🦙 呼叫4 Maverick MCP服务器(Python)

作者:约比·本杰明\ 版本: 0.9\ 日期:2025年8月1日

模型上下文协议(MCP)服务器的Python实现,通过Ollama将Llama模型与Claude Desktop连接起来。这个纯Python解决方案提供了干净的架构、高性能和易于扩展性。

📚 目录

🎯 你会用这个Llama MCP服务器做什么?

本地AI+克劳德桌面的革命

这个Python MCP服务器在Claude Desktop的复杂界面和本地托管的Llama模型之间创建了一个强大的桥梁。以下是这种组合的革命性之处:

1. 隐私优先的人工智能操作 🔒

挑战:出于隐私考虑,处理敏感数据的组织不能使用云人工智能。

解决方案:此MCP服务器将所有内容都保持在本地,同时提供企业级AI功能。

实际应用:

  • 医疗保健:医院可以使用人工智能分析患者记录,而不会违反HIPAA合规性
  • 法律:律师事务所可以完全保密地处理客户机密文件
  • 金融:银行可以在不暴露客户信息的情况下分析交易数据
  • 政府:各机构可以处理气隙系统的机密文件

示例实现:

# Process sensitive medical records locally
async def analyze_patient_data(patient_file):
    # Data never leaves your server
    content = await tool_manager.execute("read_file", {"path": patient_file})
    
    # Use specialized medical model
    analysis = await llama_service.complete(
        prompt=f"Analyze patient data for risk factors: {content}",
        model="medical-llama:latest",  # Your HIPAA-compliant fine-tuned model
        temperature=0.1  # Low temperature for medical accuracy
    )
    
    # Store results locally with encryption
    await secure_storage.save(analysis, encrypted=True)

2. 自定义模型部署 🎯

挑战:通用模型不理解您的领域特定语言和要求。

解决方案:通过MCP接口部署自己的微调模型。

实际应用:

  • 研究实验室:使用基于专有研究数据训练的模型
  • 企业:部署根据公司文档进行微调的模型
  • 教育机构:使用根据课程特定内容培训的模型
  • 特定行业的:法律、医疗、金融或技术领域模型

示例实现:

# Switch between specialized models based on task
class ModelSelector:
    def __init__(self):
        self.models = {
            "general": "llama3:latest",
            "code": "codellama:latest",
            "medical": "medical-llama:13b",
            "legal": "legal-llama:7b",
            "finance": "finance-llama:13b"
        }
    
    async def select_and_query(self, domain: str, prompt: str):
        model = self.models.get(domain, "llama3:latest")
        return await llama_service.complete(
            prompt=prompt,
            model=model,
            temperature=0.3 if domain in ["medical", "legal"] else 0.7
        )

3. 混合智能系统 🔄

挑战:没有一个人工智能模型擅长一切。

解决方案:将克劳德的推理与拉玛的生成能力结合起来。

实际应用:

  • 软件开发:Claude规划架构,Llama生成实现
  • 内容创建:克劳德创建大纲,拉玛撰写详细内容
  • 数据分析:Claude解释结果,Llama生成报告
  • 研究:克劳德提出假设,拉玛探索其含义

示例实现:

# Hybrid workflow combining Claude and Llama
class HybridAI:
    async def complex_task(self, requirement: str):
        # Step 1: Use Claude for high-level planning
        plan = await claude.create_plan(requirement)
        
        # Step 2: Use local Llama for detailed implementation
        implementation = await llama_service.complete(
            prompt=f"Implement this plan: {plan}",
            model="codellama:34b",
            max_tokens=4096
        )
        
        # Step 3: Use Claude for review and refinement
        refined = await claude.review_and_refine(implementation)
        
        return refined

4. 离线和边缘计算 🌐

挑战:许多环境缺乏可靠的互联网或禁止云连接。

解决方案:完全的人工智能功能,无需任何互联网要求。

实际应用:

  • 远程操作:石油钻井平台、船舶、远程研究站
  • 工业物联网:有实时要求的工厂车间
  • 实地考察:地质调查、野生动物研究、灾害应对
  • 安全设施:军事基地、研究实验室、政府大楼

示例实现:

# Edge deployment for industrial quality control
class EdgeQualityControl:
    def __init__(self):
        self.config = Config(
            llama_model_name="quality-control:latest",
            enable_streaming=True,
            max_context_length=8192  # Optimized for edge devices
        )
        
    async def inspect_product(self, sensor_data: dict):
        # Process sensor data locally
        analysis = await llama_service.complete(
            prompt=f"Analyze sensor readings for defects: {sensor_data}",
            temperature=0.1,  # Consistent results needed
            max_tokens=256   # Quick response for real-time processing
        )
        
        # Trigger local actions based on analysis
        if "defect" in analysis.lower():
            await self.trigger_alert(analysis)
        
        return analysis

5. 实验与研究 🧪

挑战研究人员需要可重复的结果和对模型行为的完全控制。

解决方案:对人工智能管道的各个方面完全透明和控制。

实际应用:

  • 学术研究:论文的可重复实验
  • 模型比较:A/B测试不同的模型和参数
  • 行为分析:了解模型如何响应不同的输入
  • 提示工程:为特定任务制定最佳提示

示例实现:

# Research experiment framework
class ExperimentRunner:
    async def run_experiment(self, hypothesis: str, test_cases: list):
        results = []
        
        # Test multiple models
        for model in ["llama3:7b", "llama3:13b", "llama3:70b"]:
            # Test multiple parameters
            for temp in [0.1, 0.5, 0.9, 1.5]:
                model_results = []
                
                for test in test_cases:
                    response = await llama_service.complete(
                        prompt=test,
                        model=model,
                        temperature=temp,
                        seed=42  # Reproducible results
                    )
                    
                    model_results.append({
                        "input": test,
                        "output": response,
                        "model": model,
                        "temperature": temp,
                        "timestamp": datetime.now()
                    })
                
                results.append(model_results)
        
        # Analyze and save results
        analysis = self.analyze_results(results)
        await self.save_experiment(hypothesis, results, analysis)
        
        return analysis

6. 经济高效的扩展 💰

挑战:API成本对于高容量应用可能会变得过高。

解决方案:一次性硬件投资,无限使用。

实际应用:

  • 初创企业:没有烧尽资金的原型
  • 教育:为所有学生提供人工智能访问,无需担心预算问题
  • 非营利组织:在不产生持续成本的情况下利用人工智能
  • 大批量加工:批处理作业、数据分析、内容生成

成本分析示例:

# Cost comparison calculator
class CostAnalyzer:
    def calculate_savings(self, monthly_tokens: int):
        # API costs (approximate)
        api_cost_per_million = 15.00  # USD
        monthly_api_cost = (monthly_tokens / 1_000_000) * api_cost_per_million
        
        # Local costs (one-time hardware)
        hardware_cost = 2000  # Good GPU setup
        electricity_monthly = 50  # Approximate
        
        # Calculate break-even
        months_to_break_even = hardware_cost / (monthly_api_cost - electricity_monthly)
        
        return {
            "monthly_api_cost": monthly_api_cost,
            "monthly_local_cost": electricity_monthly,
            "monthly_savings": monthly_api_cost - electricity_monthly,
            "break_even_months": months_to_break_even,
            "first_year_savings": (monthly_api_cost * 12) - (hardware_cost + electricity_monthly * 12)
        }

7. 实时处理

挑战网络延迟使得云AI不适合实时应用。

解决方案:本地处理的响应时间低于秒。

实际应用:

  • 交易系统:以毫秒为单位分析市场数据
  • 游戏:实时NPC对话和行为
  • 机器人学:对传感器输入的即时响应
  • 实时翻译:即时语言翻译

示例实现:

# Real-time stream processing
class StreamProcessor:
    def __init__(self):
        self.buffer = []
        self.processing = False
        
    async def process_stream(self, data_stream):
        async for chunk in data_stream:
            self.buffer.append(chunk)
            
            if not self.processing and len(self.buffer) > 0:
                self.processing = True
                
                # Process immediately without network delay
                result = await llama_service.complete(
                    prompt=f"Analyze: {self.buffer[-1]}",
                    model="tinyllama:latest",  # Fast model for real-time
                    max_tokens=50,
                    stream=True
                )
                
                async for token in result:
                    yield token  # Stream results immediately
                
                self.processing = False

8. 自定义工具集成 🛠️

挑战通用AI无法与您的特定系统和数据库交互。

解决方案:构建与您的基础设施集成的自定义工具。

实际应用:

  • 开发运维:可以管理特定基础设施的AI
  • 数据库管理:通过自然语言查询和管理您的数据库
  • 系统管理:自动化复杂的管理任务
  • 商业智能:连接到您的BI工具和数据仓库

示例实现:

# Custom tool for database operations
class DatabaseTool(BaseTool):
    @property
    def name(self) -> str:
        return "company_database"
    
    @property
    def description(self) -> str:
        return "Query and manage company database"
    
    async def execute(self, query: str, operation: str = "select") -> ToolResult:
        # Connect to your specific database
        async with get_company_db() as db:
            if operation == "select":
                results = await db.fetch(query)
                return ToolResult(success=True, data=results)
            elif operation == "analyze":
                # Use Llama to analyze query results
                analysis = await llama_service.complete(
                    prompt=f"Analyze this data: {results}",
                    temperature=0.3
                )
                return ToolResult(success=True, data=analysis)

9. 合规与治理 📋

挑战:监管要求要求完整的控制和审计跟踪。

解决方案:所有人工智能操作的完全透明和记录。

实际应用:

  • 医疗保健:HIPAA符合审计跟踪
  • 金融:SOX符合交易监控
  • 法律:律师-客户特权保护
  • 政府:安全审查要求

示例实现:

# Compliance-aware AI system
class ComplianceAI:
    def __init__(self):
        self.audit_logger = AuditLogger()
        self.encryption = EncryptionService()
        
    async def process_regulated_data(self, data: str, user: str, purpose: str):
        # Log access for audit
        audit_id = await self.audit_logger.log_access(
            user=user,
            data_type="regulated",
            purpose=purpose,
            timestamp=datetime.now()
        )
        
        # Encrypt data in transit
        encrypted = self.encryption.encrypt(data)
        
        # Process with local model (data never leaves premises)
        result = await llama_service.complete(
            prompt=f"Process: {encrypted}",
            model="compliance-llama:latest"
        )
        
        # Log completion
        await self.audit_logger.log_completion(
            audit_id=audit_id,
            success=True,
            result_hash=hashlib.sha256(result.encode()).hexdigest()
        )
        
        return self.encryption.encrypt(result)

10. 教育环境 🎓

挑战教育机构需要为所有学生提供负担得起的人工智能接入。

解决方案:单次部署为无限学生提供服务,无需每次使用成本。

实际应用:

  • 计算机科学:动手教授AI/ML概念
  • 研究项目:没有预算限制的学生研究
  • 写作中心:面向所有学生的人工智能辅助写作
  • 语言学习:个性化语言练习

示例实现:

# Educational AI assistant
class EducationalAssistant:
    def __init__(self):
        self.student_profiles = {}
        self.learning_analytics = LearningAnalytics()
        
    async def personalized_tutoring(self, student_id: str, subject: str, question: str):
        # Get student's learning profile
        profile = self.student_profiles.get(student_id, self.create_profile(student_id))
        
        # Adjust response based on student level
        response = await llama_service.complete(
            prompt=f"""
            Student Level: {profile['level']}
            Subject: {subject}
            Question: {question}
            
            Provide an explanation appropriate for this student's level.
            """,
            temperature=0.7,
            model="education-llama:latest"
        )
        
        # Track learning progress
        await self.learning_analytics.record_interaction(
            student_id=student_id,
            subject=subject,
            question=question,
            response=response
        )
        
        return response

🐍 为什么是Python?

相对于Types/Node.js的优势

特性Python优势用例
科学计算NumPy、SciPy、Pandas集成数据分析、研究
ML生态系统与PyTorch、TensorFlow直接集成模型实验
简洁更简洁的async/await语法更快的开发
图书馆庞大的AI/ML工具生态系统扩展功能
调试更好的错误消息和调试工具更容易排除故障
演出用于高性能异步的uvloop更好的并发性
类型安全类型提示+Pydantic验证运行时验证

✨ 特性

核心能力

  • 🚀 高性能:异步/等待,支持uvloop
  • 🛠️ 10+内置工具:网络搜索、文件操作、计算等
  • 📝 提示模板:常见任务的预定义提示
  • 📁 资源管理:访问模板和文档
  • 🔄 流媒体支持:实时令牌生成
  • 🔧 高度可配置性:基于环境的配置
  • 📊 结构化日志记录:全面的调试支持
  • 🧪 经过全面测试:包括Pytest测试套件

Python特定功能

  • 🐼 数据科学集成:与Pandas、NumPy合作
  • 🤖 ML框架兼容:与PyTorch、TensorFlow集成
  • 📈 内置分析:绩效指标和监控
  • 🔌 插件系统:易于使用Python包进行扩展
  • 🎯 类型安全:用于验证的Pydantic模型
  • 🔒 安全:内置消毒和验证

💻 系统要求

最低要求

组件最小推荐最佳
python3.9+3.11+最新
中央处理器4芯8芯16+芯
随机存取存储器8GB16GB32GB+
存储10GB SSD50GB SSD100GB NVMe
操作系统Linux/macOS/WindowsUbuntu 22.04最新Linux

型号要求

模型参数RAM用例
tinyllama1.1B2GB测试,快速响应
llama3:7b7B8GB通用
llama3:13b13B16GB高级任务
llama3:70b70B48GB专业使用
codellama7-34B8-32GB代码生成

🚀 快速开始

# Clone the repository
git clone https://github.com/yobieben/llama4-maverick-mcp-python.git
cd llama4-maverick-mcp-python

# Run setup (handles everything)
python setup.py

# Start the server
python -m llama4_maverick_mcp.server

就是这样!服务器现在正在运行并准备连接到Claude Desktop。

📦 详细安装

第一步:Python设置

# Check Python version
python --version  # Should be 3.9+

# Create virtual environment (recommended)
python -m venv venv

# Activate virtual environment
# Linux/macOS:
source venv/bin/activate
# Windows:
venv\Scripts\activate

步骤2:安装依赖项

# Install the package in development mode
pip install -e .

# For development with testing tools
pip install -e .[dev]

步骤3:安装Olama

# macOS
brew install ollama

# Linux
curl -fsSL https://ollama.com/install.sh | sh

# Windows
# Download from https://ollama.com/download/windows

步骤4:配置环境

# Copy example configuration
cp .env.example .env

# Edit configuration
nano .env  # or your preferred editor

步骤5:下载模型

# Start Ollama service
ollama serve

# In another terminal, pull models
ollama pull llama3:latest
ollama pull codellama:latest
ollama pull tinyllama:latest

步骤6:配置Claude桌面

添加到Claude桌面配置:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "llama4-python": {
      "command": "python",
      "args": ["-m", "llama4_maverick_mcp.server"],
      "cwd": "/path/to/llama4-maverick-mcp-python",
      "env": {
        "PYTHONPATH": "/path/to/llama4-maverick-mcp-python/src",
        "LLAMA_MODEL_NAME": "llama3:latest"
      }
    }
  }
}

⚙️ 配置

环境变量

创建一个 .env 文件:

# Ollama Configuration
LLAMA_API_URL=http://localhost:11434
LLAMA_MODEL_NAME=llama3:latest
LLAMA_API_KEY=  # Optional

# Server Configuration
MCP_LOG_LEVEL=INFO
MCP_SERVER_HOST=localhost
MCP_SERVER_PORT=3000

# Features
ENABLE_STREAMING=true
ENABLE_FUNCTION_CALLING=true
ENABLE_VISION=false
ENABLE_CODE_EXECUTION=false  # Security risk
ENABLE_WEB_SEARCH=true

# Model Parameters
TEMPERATURE=0.7  # 0.0-2.0
TOP_P=0.9        # 0.0-1.0
TOP_K=40         # 1-100
REPEAT_PENALTY=1.1
SEED=42  # For reproducibility

# File System
FILE_SYSTEM_BASE_PATH=/safe/path
ALLOW_FILE_WRITES=true

# Performance
MAX_CONTEXT_LENGTH=128000
MAX_CONCURRENT_REQUESTS=10
REQUEST_TIMEOUT_MS=30000
CACHE_TTL=3600
CACHE_MAX_SIZE=1000

# Debug
DEBUG=false
VERBOSE_LOGGING=false

配置类

from llama4_maverick_mcp.config import Config

# Create custom configuration
config = Config(
    llama_model_name="codellama:latest",
    temperature=0.3,
    enable_code_execution=True
)

# Access configuration
print(config.llama_model_name)
print(config.get_model_params())

🛠️ 可用工具

内置工具

工具说明示例
calculator数学计算2 + 2, sqrt(16)
datetime日期/时间操作当前时间,日期数学
json_toolJSON操作解析、提取、转换
web_search搜索网络查询信息
file_read读取文件访问本地文件
file_write写入文件在本地保存数据
list_files列出目录浏览文件系统
code_executor运行代码执行Python/JS/Bash
http_requestHTTP调用API交互

创建自定义工具

# src/llama4_maverick_mcp/tools/custom/my_tool.py
from pydantic import BaseModel, Field
from ..base import BaseTool, ToolResult

class MyToolParams(BaseModel):
    """Parameters for my custom tool."""
    input_text: str = Field(..., description="Text to process")
    option: str = Field(default="default", description="Processing option")

class MyCustomTool(BaseTool):
    @property
    def name(self) -> str:
        return "my_custom_tool"
    
    @property
    def description(self) -> str:
        return "Performs custom processing on text"
    
    @property
    def parameters(self) -> type[BaseModel]:
        return MyToolParams
    
    async def execute(self, input_text: str, option: str = "default") -> ToolResult:
        # Your custom logic here
        result = f"Processed: {input_text} with option: {option}"
        
        return ToolResult(
            success=True,
            data={"result": result, "length": len(input_text)}
        )

📊 使用示例

基本用法

import asyncio
from llama4_maverick_mcp import MCPServer, Config

async def main():
    # Create server with custom config
    config = Config(
        llama_model_name="llama3:latest",
        temperature=0.7
    )
    server = MCPServer(config)
    
    # Run the server
    await server.run()

if __name__ == "__main__":
    asyncio.run(main())

API直接使用

from llama4_maverick_mcp import LlamaService, Config

async def generate_text():
    config = Config()
    llama = LlamaService(config)
    await llama.initialize()
    
    # Simple completion
    result = await llama.complete(
        prompt="Explain quantum computing",
        temperature=0.5,
        max_tokens=200
    )
    print(result)
    
    # Chat completion
    messages = [
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "What is Python?"}
    ]
    response = await llama.complete_chat(messages)
    print(response)

工具执行

from llama4_maverick_mcp.tools import ToolManager

async def use_tools():
    manager = ToolManager(Config())
    await manager.initialize()
    
    # Execute calculator
    result = await manager.execute_tool(
        "calculator",
        {"expression": "factorial(5) + sqrt(16)"}
    )
    print(result)
    
    # Read file
    content = await manager.execute_tool(
        "file_read",
        {"path": "config.json"}
    )
    print(content)

🌟 实际应用

1.文件分析管道

class DocumentAnalyzer:
    def __init__(self):
        self.config = Config(temperature=0.3)
        self.llama = LlamaService(self.config)
        self.tools = ToolManager(self.config)
    
    async def analyze_documents(self, directory: str):
        # List all documents
        files = await self.tools.execute_tool(
            "list_files",
            {"path": directory, "recursive": True}
        )
        
        results = []
        for file in files['data']['files']:
            if file.endswith(('.txt', '.md', '.pdf')):
                # Read document
                content = await self.tools.execute_tool(
                    "file_read",
                    {"path": file}
                )
                
                # Analyze with Llama
                analysis = await self.llama.complete(
                    prompt=f"Summarize and extract key points: {content['data']}",
                    max_tokens=500
                )
                
                results.append({
                    "file": file,
                    "analysis": analysis
                })
        
        return results

2.代码审查系统

class CodeReviewer:
    async def review_code(self, code: str, language: str = "python"):
        prompt = f"""
        Review this {language} code for:
        1. Security vulnerabilities
        2. Performance issues
        3. Best practices
        4. Potential bugs
        
        Code:

{code}

        
        Provide specific suggestions for improvement.
        """
        
        review = await llama_service.complete(
            prompt=prompt,
            model="codellama:latest",
            temperature=0.3
        )
        
        return self.parse_review(review)

3.研究助理

class ResearchAssistant:
    async def research_topic(self, topic: str):
        # Search for information
        search_results = await self.tools.execute_tool(
            "web_search",
            {"query": topic, "max_results": 10}
        )
        
        # Analyze sources
        analysis = await self.llama.complete(
            prompt=f"Analyze these sources about {topic}: {search_results}",
            temperature=0.5
        )
        
        # Generate report
        report = await self.llama.complete(
            prompt=f"Write a comprehensive report on {topic} based on: {analysis}",
            temperature=0.7,
            max_tokens=2000
        )
        
        # Save report
        await self.tools.execute_tool(
            "file_write",
            {
                "path": f"research_{topic}_{datetime.now().strftime('%Y%m%d')}.md",
                "content": report
            }
        )
        
        return report

🧪 发展

运行测试

# Run all tests
pytest

# Run with coverage
pytest --cov=llama4_maverick_mcp

# Run specific test
pytest tests/test_llama_service.py

# Run with verbose output
pytest -v

代码质量

# Format code with Black
black src/

# Lint with Ruff
ruff check src/

# Type checking with mypy
mypy src/

# All quality checks
make quality

创建测试

# tests/test_my_tool.py
import pytest
from llama4_maverick_mcp.tools.custom.my_tool import MyCustomTool

@pytest.mark.asyncio
async def test_my_custom_tool():
    tool = MyCustomTool()
    
    result = await tool.execute(
        input_text="Hello, world!",
        option="uppercase"
    )
    
    assert result.success
    assert "Hello, world!" in result.data["result"]
    assert result.data["length"] == 13

🚀 性能优化

1.使用uvloop(Linux/macOS)

# Automatically enabled if available
# 2-4x performance improvement for async operations
pip install uvloop

2.模型优化

# Use smaller models for simple tasks
config = Config(
    llama_model_name="tinyllama:latest",  # 1.1B params, very fast
    max_context_length=4096,  # Reduce context for speed
    temperature=0.1  # Lower temperature for consistency
)

3.缓存策略

from functools import lru_cache
from cachetools import TTLCache

class CachedLlamaService(LlamaService):
    def __init__(self, config):
        super().__init__(config)
        self.cache = TTLCache(maxsize=1000, ttl=3600)
    
    async def complete(self, prompt: str, **kwargs):
        cache_key = f"{prompt}:{kwargs}"
        
        if cache_key in self.cache:
            return self.cache[cache_key]
        
        result = await super().complete(prompt, **kwargs)
        self.cache[cache_key] = result
        return result

4.批量处理

import asyncio

async def batch_process(prompts: list):
    # Process multiple prompts concurrently
    tasks = [
        llama_service.complete(prompt, temperature=0.5)
        for prompt in prompts
    ]
    
    # Limit concurrency to avoid overwhelming the system
    semaphore = asyncio.Semaphore(5)
    
    async def limited_task(task):
        async with semaphore:
            return await task
    
    results = await asyncio.gather(*[limited_task(t) for t in tasks])
    return results

🔧 故障排除

常见问题

问题解决方案
导入错误检查Python路径: export PYTHONPATH=$PYTHONPATH:$(pwd)/src
找不到Ollama安装: `curl -fsSL https://ollama.com/install.sh \sh`
模型不可用拉力模型: ollama pull llama3:latest
权限不足检查文件权限和基本路径配置
内存错误使用较小的型号或增加系统RAM
超时错误增加 REQUEST_TIMEOUT_MS 在配置中

调试模式

# Enable detailed logging
config = Config(
    debug_mode=True,
    verbose_logging=True,
    log_level="DEBUG"
)

# Or via environment
export DEBUG=true
export MCP_LOG_LEVEL=DEBUG
export VERBOSE_LOGGING=true

健康检查

async def health_check():
    """Check system health."""
    checks = {
        "python_version": sys.version,
        "ollama_connected": config.validate_ollama_connection(),
        "models_available": await llama_service.list_models(),
        "tools_loaded": len(await tool_manager.get_tools()),
        "memory_usage": psutil.virtual_memory().percent,
        "disk_usage": psutil.disk_usage('/').percent
    }
    
    return {
        "status": "healthy" if all(checks.values()) else "degraded",
        "checks": checks,
        "timestamp": datetime.now().isoformat()
    }

🤝 贡献

我们欢迎捐款!看 贡献.md 作为指导方针。

贡献领域

  • 🛠️ 新工具和集成
  • 📝 文档改进
  • 🐛 错误修正
  • 🚀 性能优化
  • 🧪 测试覆盖率
  • 🌐 国际化

开发工作流程

# Fork and clone
git clone https://github.com/YOUR_USERNAME/llama4-maverick-mcp-python.git

# Create branch
git checkout -b feature/your-feature

# Make changes and test
pytest

# Commit with conventional commits
git commit -m "feat: add new amazing feature"

# Push and create PR
git push origin feature/your-feature

📄 许可证

MIT许可证-请参阅 许可证 文件

👨‍💻 作者

约比·本杰明\ 版本0.9\ 2025年8月1日

🙏 致谢

  • MCP协议的拟人化
  • Ollama团队负责本地模特主持
  • 火焰模型的目标
  • 优秀库Python社区

📞 支持

  • 问题:
  • 讨论:
  • 文档: 维基

______________________________________________________________________

准备好体验本地AI的力量了吗? 今天从Calma 4 Maverick MCP Python开始!🦙🐍🚀

目录标签

目录标签

本地AIPythonClaude隐私保护本地部署模型桥接Python实现自定义模型

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotokenlocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP