MCP Agent Eda5d6fc

MCPAI代理

提供方 joohnnie

AI代理 stdio · 本地进程 无需鉴权 社区 / 第三方 Claude DesktopClaude
查看接入方式

一个基于模型上下文协议(MCP)的生产级智能代理系统,提供工具调用、资源访问和提示模板功能,适用于LLM应用开发和任务自动化场景。

一句话选型结论

按资料字段整理

MCP Agent Eda5d6fc 属于AI代理类 MCP 服务器,stdio · 本地进程,无需鉴权,可直接接入 Claude Desktop、Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权无需鉴权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

多代理系统Python本地部署LLM工具集成任务编排Python开发AI工作流

安装与配置

stdio · 本地进程 无需鉴权
客户端在本机拉起子进程,数据不出本机
pip install -e .

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude,换客户端不用重新研究配置。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Agent Eda5d6fc当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方joohnnie上游标注的维护方 joohnnie
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

13.8 KB
来自项目仓库与上游目录的原文,未做删改

MCP Demo Server with Intelligent Agent System

A production-ready demonstration of a Model Context Protocol (MCP) server implemented in Python, featuring an intelligent Agent System with subagents and orchestration capabilities. This project showcases best practices for building MCP servers and multi-agent systems with comprehensive examples.

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). MCP servers expose:

  • Tools: Executable functions that LLMs can call (e.g., calculator, file operations)
  • Resources: Data sources that LLMs can read (e.g., configuration, documentation)
  • Prompts: Reusable prompt templates for common tasks

Features

Agent System (NEW!)

Production-ready intelligent agents that work with MCP:

  1. Agent - Core agent with MCP integration
    - Execute tasks using MCP tools
    - Delegate work to specialized subagents
    - Track task execution and results
    - Handle errors, retries, and timeouts

  2. SubAgents - Specialized agents for specific tasks
    - CalculatorSubAgent - Mathematical calculations
    - FileOperationsSubAgent - File system operations
    - WeatherSubAgent - Weather information
    - TimestampSubAgent - Timestamp operations
    - DataProcessingSubAgent - Data processing pipelines

  3. AgentOrchestrator - Multi-agent coordination
    - Manage pools of agents
    - Auto-assign tasks to capable agents
    - Execute workflows with dependencies
    - Parallel and sequential execution
    - Result aggregation and statistics

  4. Task Management - Robust task system
    - Task definitions with priorities
    - State tracking (pending, in_progress, completed, failed)
    - Retry logic and timeout handling
    - Detailed result tracking

MCP Server Tools

  1. Calculator - Basic mathematical operations
    - Operations: add, subtract, multiply, divide
    - Full input validation and error handling

  2. File Operations - File system interactions
    - Read, write, list directories, check file existence
    - Safe path handling with proper error messages

  3. Weather - Simulated weather information
    - Get weather data for any city
    - Support for Celsius and Fahrenheit

  4. Timestamp - Get current time in various formats
    - ISO format, Unix timestamp, human-readable format

Resources Available

  1. Server Configuration (config://server/settings)
    - Current server settings and metadata
    - JSON formatted configuration

  2. System Information (system://info)
    - OS, Python version, working directory
    - Server process information

  3. Documentation (docs://getting-started)
    - Getting started guide
    - Usage instructions

Prompts Provided

  1. Code Review - Generate code review checklists
    - Customizable by programming language
    - Adjustable complexity level

  2. Documentation - Documentation templates
    - API, User, and Developer documentation types
    - Project-specific customization

  3. Debug Assistant - Debugging guidance
    - Structured debugging approach
    - Common techniques and best practices

Installation

Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)

Install Dependencies```bash

Clone the repository

git clone https://github.com/yourusername/mcp-agent.git
cd mcp-agent

Install the package

pip install -e .

Or install dependencies directly

pip install -r requirements.txt


### Development Setup```bash
# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

# Format code
black src/

# Lint code
ruff check src/

Usage

Running the Agent System Demo

Experience the full power of the agent system:```bash

Run comprehensive agent system demo

python examples/agent_demo.py


This demo showcases:
- Simple agent with basic tasks
- Agent with subagents (task delegation)
- Orchestrator managing multiple agents
- Multi-step workflow execution
- Data processing pipeline

### Quick Agent System Example```python
import asyncio
from mcp_demo import Agent, AgentCapability, Task
from mcp_demo import CalculatorSubAgent, FileOperationsSubAgent
from mcp_demo import AgentOrchestrator, Workflow, WorkflowStep

async def main():
    # Create main agent with subagents
    main_agent = Agent(name="MainAgent")
    calc_sub = CalculatorSubAgent(parent_agent=main_agent)
    file_sub = FileOperationsSubAgent(parent_agent=main_agent)

    # Create tasks
    calc_task = Task(
        name="Calculate",
        task_type="calculation",
        parameters={"operation": "add", "a": 10, "b": 20},
    )

    # Execute - automatically delegated to appropriate subagent
    async with main_agent, calc_sub, file_sub:
        result = await main_agent.execute_task(calc_task)
        print(f"Result: {result.data}")

asyncio.run(main())

Using the Orchestrator```python

from mcp_demo import AgentOrchestrator, CalculatorSubAgent, Task

async def orchestrate():
# Create orchestrator
orch = AgentOrchestrator(name="MainOrch")

# Register agents
orch.register_agent(CalculatorSubAgent())

# Execute tasks in parallel
async with orch:
    results = await orch.execute_tasks(
        [task1, task2, task3],
        parallel=True,
    )

    # Get statistics
    stats = orch.get_statistics()
    print(f"Success rate: {stats['overall_success_rate']:.1f}%")

### Running the MCP Server

The server uses stdio for communication, which is the standard transport for MCP servers:```bash
# Run directly with Python
python -m mcp_demo.server

# Or use the installed script
mcp-demo

Configuration for Claude Desktop

To use this MCP server with Claude Desktop, add it to your Claude configuration file:

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

Windows: `%APPDATA%\Claude\claude_desktop_config.json````json
{
"mcpServers": {
"demo": {
"command": "python",
"args": [
"-m",
"mcp_demo.server"
],
"env": {}
}
}
}


Or using the installed command:```json
{
  "mcpServers": {
    "demo": {
      "command": "mcp-demo",
      "args": [],
      "env": {}
    }
  }
}

Using with MCP Client

You can also use the included example client:```bash
python examples/client.py


## Project Structure```
mcp-agent/
├── src/
│   └── mcp_demo/
│       ├── __init__.py          # Package initialization
│       ├── server.py            # MCP server implementation
│       ├── agent.py             # Core agent with MCP integration
│       ├── subagent.py          # Specialized subagents
│       ├── orchestrator.py      # Multi-agent orchestration
│       └── task.py              # Task management system
├── examples/
│   ├── client.py                # Example MCP client
│   ├── agent_demo.py            # Comprehensive agent system demo
│   └── claude_config.json       # Example Claude Desktop config
├── tests/
│   ├── __init__.py
│   ├── test_server.py           # Server tests
│   └── test_agents.py           # Agent system tests
├── docs/
│   ├── ARCHITECTURE.md          # MCP server architecture
│   └── AGENT_SYSTEM.md          # Agent system documentation
├── pyproject.toml               # Project configuration
├── requirements.txt             # Production dependencies
├── requirements-dev.txt         # Development dependencies
├── README.md                    # This file
└── LICENSE                      # MIT License

Code Architecture

Server Implementation

The server follows a clean, modular architecture:```python
class MCPDemoServer:
"""Main server class with handler methods"""

def __init__(self, name: str):
    """Initialize server and register handlers"""

async def list_tools(self) -> list[Tool]:
    """Return available tools"""

async def call_tool(self, name: str, arguments: Any) -> list[TextContent]:
    """Execute a tool"""

async def list_resources(self) -> list[Resource]:
    """Return available resources"""

async def read_resource(self, uri: AnyUrl) -> str:
    """Read a resource"""

async def list_prompts(self) -> list[Prompt]:
    """Return available prompts"""

async def get_prompt(self, name: str, arguments: dict) -> GetPromptResult:
    """Get a prompt with arguments"""

### Key Design Patterns

1. **Type Safety**: Full type hints with Pydantic models
2. **Error Handling**: Comprehensive try-catch with logging
3. **Validation**: Input validation using Pydantic schemas
4. **Logging**: Structured logging to file and stderr
5. **Async/Await**: Proper async patterns throughout
6. **Separation of Concerns**: Each tool in its own method

## Examples

### Example 1: Using the Calculator Tool```python
# Tool call from LLM client
{
  "name": "calculator",
  "arguments": {
    "operation": "add",
    "a": 15,
    "b": 27
  }
}

# Response
{
  "content": [
    {
      "type": "text",
      "text": "Result: 15 add 27 = 42"
    }
  ]
}

Example 2: Reading a Resource```python

Read server configuration

{
"uri": "config://server/settings"
}

Response (JSON)

{
"server_name": "mcp-demo-server",
"version": "1.0.0",
"max_connections": 100,
"features": ["tools", "resources", "prompts"]
}


### Example 3: Getting a Prompt```python
# Get code review prompt
{
  "name": "code-review",
  "arguments": {
    "language": "Python",
    "complexity": "complex"
  }
}

# Response: Detailed code review checklist for Python

Development

Adding a New Tool

  1. Define input schema with Pydantic:```python
    class MyToolInput(BaseModel):
    param1: str = Field(description="Description")
    param2: int = Field(default=0, description="Description")

2. Add tool to `list_tools()`:```python
Tool(
    name="my_tool",
    description="What this tool does",
    inputSchema=MyToolInput.model_json_schema(),
)
  1. Implement tool logic:```python
    async def _my_tool(self, arguments: dict) -> list[TextContent]:
    tool_input = MyToolInput(**arguments)
    # Your implementation here
    return [TextContent(type="text", text="Result")]

4. Add to `call_tool()` dispatcher:```python
if name == "my_tool":
    return await self._my_tool(arguments)

Adding a New Resource

  1. Add to list_resources():```python
    Resource(
    uri=AnyUrl("my://resource"),
    name="My Resource",
    description="What this resource provides",
    mimeType="application/json",
    )

2. Add handler in `read_resource()`:```python
if uri_str == "my://resource":
    data = {"key": "value"}
    return json.dumps(data, indent=2)

Adding a New Prompt

  1. Add to list_prompts():```python
    Prompt(
    name="my-prompt",
    description="What this prompt does",
    arguments=[
    {
    "name": "arg1",
    "description": "Argument description",
    "required": True,
    }
    ],
    )

2. Add handler in `get_prompt()`:```python
if name == "my-prompt":
    arg1 = arguments.get("arg1")
    message = f"Prompt template with {arg1}"
    return GetPromptResult(
        messages=[
            PromptMessage(
                role="user",
                content=TextContent(type="text", text=message),
            )
        ]
    )

Testing

Run the comprehensive test suite:```bash

Run all tests

pytest

Run with coverage

pytest --cov=mcp_demo --cov-report=html

Run specific test files

pytest tests/test_server.py # MCP server tests
pytest tests/test_agents.py # Agent system tests

Run with verbose output

pytest -v

Run agent tests only

pytest tests/test_agents.py -v


## Best Practices Demonstrated

1. **Input Validation**: All tool inputs validated with Pydantic
2. **Error Handling**: Comprehensive error handling with meaningful messages
3. **Logging**: Structured logging for debugging and monitoring
4. **Type Safety**: Full type hints throughout the codebase
5. **Documentation**: Comprehensive docstrings and comments
6. **Testing**: Unit tests for all major functionality
7. **Code Quality**: Formatted with Black, linted with Ruff
8. **Async Patterns**: Proper use of async/await
9. **Resource Management**: Proper cleanup and resource handling
10. **Security**: Safe file operations with path validation

## Troubleshooting

### Common Issues

**Issue**: Module not found error```bash
# Solution: Install in development mode
pip install -e .

Issue: Server not appearing in Claude Desktop```bash

Solution: Check configuration file path and JSON syntax

Restart Claude Desktop after configuration changes


**Issue**: Import errors for `mcp` package```bash
# Solution: Install latest MCP SDK
pip install --upgrade mcp

Debug Mode

Enable debug logging:```python
import logging
logging.basicConfig(level=logging.DEBUG)


Check the log file:```bash
tail -f mcp_server.log

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Documentation

  • Agent System Documentation - Complete guide to the agent system
  • MCP Server Architecture - MCP server design and implementation
  • Agent Demo Examples - Comprehensive usage examples

Resources

  • MCP Documentation
  • MCP Python SDK
  • Claude Desktop
  • MCP Specification

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with the MCP Python SDK
  • Inspired by the MCP community examples
  • Thanks to Anthropic for developing the Model Context Protocol

Support

  • Create an issue: GitHub Issues
  • Documentation: README
  • MCP Community: MCP Discord

Happy MCP Server Building! 🚀

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
MCP Agent Eda5d6fc 怎么安装?

在客户端按下面的安装命令接入:pip install -e .。装完在客户端配置里引用同一个包或端点。

MCP Agent Eda5d6fc 怎么在 Claude Desktop、Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Agent Eda5d6fc 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Agent Eda5d6fc 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Agent Eda5d6fc 支持哪些客户端?

资料标注支持 Claude Desktop、Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Agent Eda5d6fc 能提供哪些能力?

资料显示能力标签包括 AI代理、Python、Claude、AI工作流。具体工具清单以官方文档为准。

MCP Agent Eda5d6fc 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

MCP Agent Eda5d6fc 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。