A FastMCP-based Model Context Protocol server for intelligent multi-agent code coordination
Project description
CoordMCP - Multi-Agent Code Coordination Server
CoordMCP is a powerful Model Context Protocol (MCP) server that enables intelligent coordination between multiple AI coding agents. It provides shared long-term memory, context management, file locking, and architectural guidance - all without requiring additional LLM API calls.
๐ What is CoordMCP?
CoordMCP solves the multi-agent coordination problem by acting as a central hub where AI agents can:
- Share project memory across sessions and agents
- Prevent file conflicts through intelligent locking
- Track technical decisions with rationale and context
- Maintain project context across multiple work sessions
- Get architecture recommendations using rule-based analysis
- Coordinate work between multiple agents simultaneously
Why CoordMCP?
When multiple AI agents (OpenCode, Cursor, Claude Code, etc.) work on the same project, they often:
- โ Overwrite each other's changes
- โ Forget decisions made in previous sessions
- โ Lack visibility into what other agents are doing
- โ Make inconsistent architectural choices
CoordMCP solves all of these problems with a unified coordination layer that persists project state and enables seamless multi-agent collaboration.
โจ Key Features
๐ง Long-Term Memory
- Store and retrieve architectural decisions with full context
- Track technology stack across the entire project
- Maintain change history with impact assessment
- Query project metadata and dependencies
๐ค Multi-Agent Coordination
- Agent registration with capabilities and session tracking
- Context switching between projects and tasks
- File locking to prevent edit conflicts
- Activity monitoring to see what other agents are doing
๐๏ธ Architecture Guidance
- Pattern library with 9+ design patterns
- Rule-based recommendations (no LLM costs)
- Code structure validation
- Dependency analysis
๐ Comprehensive Logging
- Change tracking with architecture impact
- Decision history with rationale
- Session logs for debugging
- File operation history
โก Zero LLM Costs
All architectural recommendations and analysis use rule-based logic - no expensive LLM API calls required!
๐ Quick Start Guide
Prerequisites
- Python 3.10 or higher
- pip (Python package manager)
Installation
Option 1: Install from PyPI (Recommended)
# Install the latest stable version
pip install coordmcp
# Verify installation
coordmcp --version
Option 2: Install from Source
# Clone the repository
git clone https://github.com/yourusername/coordmcp.git
cd coordmcp
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
๐ง MCP Configuration
CoordMCP is an MCP (Model Context Protocol) server that integrates with AI coding agents. Here's how to configure it for different agents:
OpenCode Configuration
Create an opencode.jsonc file in your project root:
{
"$schema": "https://opencode.ai/config.json",
"name": "CoordMCP Configuration",
"description": "Configuration for using CoordMCP with OpenCode",
"mcp": {
"coordmcp": {
"type": "local",
"command": ["python", "-m", "coordmcp"],
"enabled": true,
"environment": {
"COORDMCP_DATA_DIR": "${workspaceFolder}/.coordmcp/data",
"COORDMCP_LOG_LEVEL": "INFO"
}
}
},
"tools": {
"coordmcp_*": true
},
"agent": {
"default": {
"system": [
"You are an intelligent coding assistant integrated with CoordMCP.",
"",
"=== CRITICAL WORKFLOW ===",
"For EVERY project, you MUST follow this sequence:",
"",
"1. Discover or Create Project:",
" - Try: await coordmcp_discover_project(path=os.getcwd())",
" - If not found: await coordmcp_create_project(name, workspace_path=os.getcwd(), description)",
"",
"2. Register as Agent:",
" - await coordmcp_register_agent(name='YourName', type='opencode', capabilities=['python', 'react'])",
"",
"3. Start Context:",
" - await coordmcp_start_context(agent_id, project_id, objective='Your objective')",
"",
"4. Work with Coordination:",
" - Check active agents: await coordmcp_get_active_agents(project_id)",
" - Check locked files: await coordmcp_get_locked_files(project_id)",
" - Lock files before editing: await coordmcp_lock_files(agent_id, project_id, files=['src/file.py'])",
" - Record decisions: await coordmcp_save_decision(project_id, title, description, rationale)",
" - Update tech stack: await coordmcp_update_tech_stack(project_id, category, technology)",
" - Log changes: await coordmcp_log_change(project_id, file_path, change_type, description)",
" - Unlock files when done: await coordmcp_unlock_files(agent_id, project_id, files)",
"",
"5. End Session:",
" - await coordmcp_end_context(agent_id, summary='What you completed')",
"",
"Always use workspace_path=os.getcwd() for the current project directory."
]
}
}
}
Claude Code Configuration
For Claude Code, add to your claude_desktop_config.json:
{
"mcpServers": {
"coordmcp": {
"command": "python",
"args": ["-m", "coordmcp"],
"env": {
"COORDMCP_DATA_DIR": "~/.coordmcp/data",
"COORDMCP_LOG_LEVEL": "INFO"
}
}
}
}
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%AppData%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Cursor Configuration
Add to your .cursorrules or Cursor settings:
[CoordMCP Integration]
You are integrated with CoordMCP for multi-agent coordination.
WORKFLOW:
1. Discover project: await coordmcp_discover_project(path=os.getcwd())
2. Register agent: await coordmcp_register_agent(name='Cursor', type='cursor', capabilities=[])
3. Start context: await coordmcp_start_context(agent_id, project_id, objective)
4. Lock files before editing: await coordmcp_lock_files(agent_id, project_id, files)
5. Record decisions and log changes
6. Unlock files when done: await coordmcp_unlock_files(agent_id, project_id, files)
7. End context: await coordmcp_end_context(agent_id, summary)
๐ Getting Started
Step 1: Start the CoordMCP Server
# Start the server
python -m coordmcp
# Or using the command
coordmcp
# Check version
coordmcp --version
The server will start and listen for MCP connections.
Step 2: Configure Your Agent
Follow the MCP configuration instructions above for your specific agent (OpenCode, Claude Code, Cursor, etc.).
Step 3: Start Working
Once configured, your agent will automatically use CoordMCP for:
- Project discovery in the current directory
- Agent registration with persistent identity
- File locking before modifications
- Decision recording for technical choices
- Change logging for audit trails
Example Workflow
Here's what happens when you say "Create a todo app":
You: Create a todo app
Agent automatically:
โ Discovers/creates project in current directory
โ Registers as agent with capabilities
โ Starts context: "Create todo app"
โ Checks for locked files
โ Locks files: index.html, app.js, styles.css
โ Gets architecture recommendation (if needed)
โ Implements the app
โ Records decision: "Use vanilla JS"
โ Logs changes: Created index.html, app.js, styles.css
โ Updates tech stack: HTML, CSS, JavaScript
โ Unlocks files
โ Ends context
All of this happens automatically - you just code naturally!
๐ Available Tools
CoordMCP provides 35+ tools organized into categories:
๐ Discovery Tools
discover_project- Find project by directoryget_project- Get project by ID/name/pathlist_projects- Browse all projectsget_active_agents- See who's working
๐๏ธ Project Management
create_project- Create new project with workspaceget_project_info- Get project detailsget_project_decisions- View decision historysearch_decisions- Search through decisions
๐ค Agent Management
register_agent- Register as agentget_agents_in_project- View project agentsget_agent_context- View agent activity
๐ Context & Coordination
start_context- Start working on taskend_context- Finish tasklock_files- Lock files before editingunlock_files- Unlock files when doneget_locked_files- Check file locks
๐พ Memory & Documentation
save_decision- Record technical decisionsupdate_tech_stack- Track technologiesget_tech_stack- View tech stacklog_change- Log code changesget_recent_changes- View recent activity
๐๏ธ Architecture
get_architecture_recommendation- Get guidanceanalyze_architecture- Analyze structurevalidate_code_structure- Check compliance
๐ How It Works
Workspace-Based Project Discovery
Projects are linked to directories via workspace_path:
import os
# Discover project in current directory
discovery = await coordmcp_discover_project(path=os.getcwd())
if discovery["found"]:
project_id = discovery["project"]["project_id"]
else:
# Create new project
result = await coordmcp_create_project(
project_name="My App",
workspace_path=os.getcwd(), # Links to current directory
description="A web application"
)
project_id = result["project_id"]
Flexible Project Lookup
All tools support flexible project identification:
# By project ID
await coordmcp_get_project_info(project_id="proj-abc-123")
# By project name
await coordmcp_get_project_info(project_name="My App")
# By workspace path
await coordmcp_get_project_info(workspace_path=os.getcwd())
Priority: project_id > workspace_path > project_name
Session Persistence
Your agent identity persists across sessions:
# First session
gent = await coordmcp_register_agent(name="Dev1", type="opencode")
# Returns: agent_id = "agent-xyz-789"
# Next session (same name = same ID)
agent = await coordmcp_register_agent(name="Dev1", type="opencode")
# Returns: agent_id = "agent-xyz-789" (same!)
๐ ๏ธ Development
Project Structure
coordmcp/
โโโ src/coordmcp/
โ โโโ core/ # Server and tool management
โ โโโ memory/ # Long-term memory system
โ โโโ context/ # Context and file locking
โ โโโ architecture/ # Architecture tools
โ โโโ tools/ # MCP tool implementations
โ โโโ resources/ # MCP resource implementations
โ โโโ storage/ # Storage backends
โโโ src/tests/ # Test suite
โโโ docs/ # Documentation
โโโ examples/ # Example scripts
Running Tests
# Run all tests
python -m pytest src/tests/ -v
# Run specific test category
python -m pytest src/tests/unit/ -v
๐ Troubleshooting
"Project not found" error
# Use discover_project first
discovery = await coordmcp_discover_project(path=os.getcwd())
"Files already locked" error
# Check which agent has the lock
locked = await coordmcp_get_locked_files(project_id=project_id)
for lock in locked["locked_files"]:
print(f"Locked by {lock['agent_name']}: {lock['files']}")
Server won't start
# Check if port is in use
# CoordMCP uses stdio transport (no network ports)
# Just run: python -m coordmcp
# Check for errors
coordmcp --version
Agent not registering
- Ensure
agent_typeis valid: "opencode", "cursor", "claude_code", or "custom" - Check that
capabilitiesis a list of strings - Verify the server is running
๐ Documentation
- Getting Started Guide - Detailed walkthrough
- API Reference - Complete tool documentation
- System Prompt - Full agent configuration
- Quick Reference - Condensed guide
- Contributing Guide - How to contribute
- Security Policy - Security information
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with FastMCP by Jetify
- Inspired by the need for better multi-agent coordination
- Design patterns based on industry best practices
๐ Support
- ๐ง Email: support@coordmcp.dev
- ๐ฌ Discord: Join our community
- ๐ Issues: GitHub Issues
Made with โค๏ธ for better multi-agent coding experiences
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coordmcp-0.1.0.tar.gz.
File metadata
- Download URL: coordmcp-0.1.0.tar.gz
- Upload date:
- Size: 141.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faeb61de63696825e3e1e30b116308f4421ab6ac037d7238601640f8af5e361a
|
|
| MD5 |
398e6bd5b7f176132d7448a429659852
|
|
| BLAKE2b-256 |
1edd14243e0933a5f91dd0126d4ee1cb6c55d6d773265e1328388c2cd5f3801c
|
File details
Details for the file coordmcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coordmcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 107.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3946a85140766a1cb0e9390cf4fd4923f1886c16bab0c82892ee191d801d732b
|
|
| MD5 |
27965ca03cef8408cb2d5b52e35a6582
|
|
| BLAKE2b-256 |
3f52ab37c5702aaf045dc7ff984648fad57901a1ad24054ab67ac8a5552c9d35
|