MCP Agent Orchestration System
Система оркестровки агента MCP
Реализация на Python системы оркестровки агентов на основе состояний с использованием протокола контекста модели (MCP).
Что такое МКП?
Протокол контекста модели (MCP) позволяет приложениям предоставлять контекст для LLM стандартизированным способом, отделяя заботы предоставления контекста от фактического взаимодействия LLM. С помощью MCP вы можете создавать серверы, которые предоставляют:
Ресурсы : источники данных, предоставляющие информацию магистрам права
Инструменты : функции, позволяющие LLM выполнять действия.
Подсказки : шаблоны многократного использования для взаимодействия с LLM
Related MCP server: Stratum MCP Server
Установка
Предпосылки
Python 3.10 или выше
MCP Python SDK 1.2.0 или выше
Настройка вашей среды
Использование УФ (рекомендуется)
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a new directory for our project
uv init mcp-agents-orchestra
cd mcp-agents-orchestra
# Create virtual environment and activate it
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
# Install dependencies
uv add "mcp[cli]" httpxИспользование пипа
# Create a new directory for our project
mkdir mcp-agents-orchestra
cd mcp-agents-orchestra
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Unix/macOS
venv\Scripts\activate # On Windows
# Install dependencies
pip install "mcp[cli]" httpxКлонировать или загрузить файлы проекта
Поместите файлы проекта в свой каталог:
orchestrator.py— основной сервер MCP, реализующий конечный автоматorchestrator_client.py— Клиент, демонстрирующий процесс оркестровкиrequirements.txt— Зависимости для проекта.gitignore— файл игнорирования Git
Структура проекта
orchestrator.py— основной сервер MCP, реализующий конечный автоматorchestrator_client.py— Клиент, демонстрирующий процесс оркестровкиrequirements.txt— Зависимости для проекта
Запуск системы оркестровки
Запустите сервер оркестровки напрямую для тестирования:
python orchestrator.pyВ отдельном терминале запустите клиент, чтобы увидеть оркестровку в действии:
python orchestrator_client.pyИнтеграция с Claude для рабочего стола
1. Установите Claude для рабочего стола
Убедитесь, что у вас установлен Claude for Desktop. Вы можете загрузить последнюю версию с сайта Anthropic .
2. Настройте Claude для рабочего стола
Откройте файл конфигурации Claude for Desktop:
macOS/Linux:
# Create or edit the configuration file code ~/Library/Application\ Support/Claude/claude_desktop_config.jsonОкна:
# Path may vary depending on your Windows version code %APPDATA%\Claude\claude_desktop_config.jsonДобавьте конфигурацию сервера оркестратора:
{ "mcpServers": { "agent-orchestrator": { "command": "python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/orchestrator.py" ] } } }Замените путь на абсолютный путь к вашему файлу orchestrator.py.
Сохраните файл конфигурации и перезапустите Claude for Desktop.
3. Использование Orchestrator в Claude
После настройки вы сможете:
Открыть Claude для рабочего стола
Нажмите на значок сервера MCP на боковой панели.
Выберите «agent-orchestrator» из списка доступных серверов.
Начните взаимодействовать с системой оркестровки
Клод сможет:
Переход между различными состояниями агента
Хранить и извлекать информацию из базы знаний
Поддерживайте контекст разговора при переходах между состояниями
Доступ к подсказкам, специфичным для штата
Агентские Штаты
Система оркестровки реализует конечный автомат со следующими состояниями:
IDLE : Ожидание инструкций
ПЛАНИРОВАНИЕ : Создание структурированного плана для задачи
ИССЛЕДОВАНИЕ : Сбор информации, необходимой для выполнения задачи
ИСПОЛНЕНИЕ : Выполнение запланированных действий.
ОБЗОР : Оценка результатов и определение следующих шагов
ОШИБКА : Обработка ошибок или непредвиденных ситуаций
Настройка системы
Добавление новых штатов
Добавьте состояние в перечисление
AgentStateвorchestrator.pyСоздайте функцию подсказки для нового состояния
Обновите логику перехода в
_get_available_transitions()Добавить обработчики для нового состояния в функции доступа к ресурсам
Создание пользовательских инструментов
Добавьте новые инструменты, создав функции, декорированные @mcp.tool() :
@mcp.tool()
def my_custom_tool(arg1: str, arg2: int, ctx: Context) -> str:
"""Description of what this tool does
Args:
arg1: Description of arg1
arg2: Description of arg2
"""
# Implementation here
return "Result"Разработка и тестирование
Использование MCP CLI
MCP CLI предоставляет инструменты для разработки и тестирования:
# Install MCP CLI if you haven't already
pip install "mcp[cli]"
# Test your server with the MCP Inspector
mcp dev orchestrator.py
# Install in Claude Desktop
mcp install orchestrator.pyРучное тестирование с помощью Python
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async with stdio_client(StdioServerParameters(command="python", args=["orchestrator.py"])) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Test state transitions
await session.call_tool("transition_state", arguments={"new_state": "PLANNING"})Ресурсы
Лицензия
Данный проект лицензирован по лицензии MIT — подробности см. в файле LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
AI-powered spec-to-task decomposition and execution orchestration for coding agents.
AI work orchestration for plans, tasks, teams, and coding-agent dispatch.
Sovereign Agent OS — Persistent Memory, Governance & Compliance for AI Agents.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceAn orchestration system that breaks down user prompts into actionable tasks and delegates them to specialized agents (Roo Modes) using LangChain.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to execute formal, stateful workflows with typed contracts, postcondition enforcement, and structured retry logic.1Apache 2.0
- AlicenseAqualityCmaintenanceA persistent state machine and notification system for AI agents to manage complex, multi-step workflows via the Model Context Protocol, preventing context drift by maintaining structured checklists and sending desktop alerts.14162Apache 2.0
- AlicenseNot gradedqualityDmaintenanceOrchestrates AI agents through structured markdown documents, enabling multi-agent workflows with automatic context injection and workflow management.144MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aviz85/mcp-agents-orchestra'
If you have feedback or need assistance with the MCP directory API, please join our Discord server