MCP Agent Orchestration System

by aviz85

Not rated
GitHub

About

A state-based agent orchestration system using the Model Context Protocol (MCP).

Details

Author
aviz85
Categories
Developer Tools

Setup

Install MCP Agent Orchestration System in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/aviz85/mcp-agents-orchestra

Follow the installation instructions in the repository README, then restart your MCP client.

A state-based agent orchestration system using the Model Context Protocol (MCP).

A Python implementation of a state-based agent orchestration system using the Model Context Protocol (MCP).

The Model Context Protocol (MCP) allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. With MCP, you can build servers that expose:

- Resources: Data sources that provide information to LLMs
- Tools: Functions that allow LLMs to perform actions
- Prompts: Reusable templates for LLM interactions

- Python 3.10 or higher
- MCP Python SDK 1.2.0 or higher

# 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

Place the project files in your directory:

- orchestrator.py- The main MCP server implementing the state machine
- orchestrator_client.py- Client demonstrating the orchestration flow
- requirements.txt- Dependencies for the project
- .gitignore- Git ignore file

- orchestrator.py- The main MCP server implementing the state machine
- orchestrator_client.py- Client demonstrating the orchestration flow
- requirements.txt- Dependencies for the project
- Start the orchestration server directly for testing:
- In a separate terminal, run the client to see the orchestration in action:

Make sure you have Claude for Desktop installed. You can download the latest version fromAnthropic's website.
-

Open your Claude for Desktop configuration file:

# 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

Add the orchestrator server configuration:

{ "mcpServers": { "agent-orchestrator": { "command": "python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/orchestrator.py" ] } } }

Replace the path with the absolute path to your orchestrator.py file.

Save the configuration file and restart Claude for Desktop.
- Open Claude for Desktop
- Click on the MCP server icon in the sidebar
- Select "agent-orchestrator" from the list of available servers
- Start interacting with the orchestration system

- Transition between different agent states
- Store and retrieve information from the knowledge base
- Maintain conversation context across state transitions
- Access state-specific prompts

The orchestration system implements a state machine with the following states:

- IDLE: Waiting for instructions
- PLANNING: Creating a structured plan for a task
- RESEARCHING: Gathering information needed for a task
- EXECUTING: Carrying out planned actions
- REVIEWING: Evaluating results and determining next steps
- ERROR: Handling errors or unexpected situations
- Add the state to theAgentStateenum inorchestrator.py
- Create a prompt function for the new state
- Update the transition logic in_get_available_transitions()
- Add handlers for the new state in resource access functions

Add new tools by creating functions decorated with@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"

The MCP CLI provides tools for development and testing:

# 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
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"})

- MCP Python SDK Documentation
-
Model Context Protocol Specification

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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.