Skip to main content

A FastMCP-based Model Context Protocol server for intelligent multi-agent code coordination

Project description

CoordMCP - Multi-Agent Code Coordination Server

Python 3.10+ FastMCP License: MIT Version

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",
  
  "mcp": {
    "coordmcp": {
      "type": "local",
      "command": ["python", "-m", "coordmcp"],
      "enabled": true,
      "environment": {
        "COORDMCP_LOG_LEVEL": "INFO"
      }
    }
  },
}

Optional (But Recommended) : Create a system prompt configuration file in project directory and copy paste the content of SYSTEM_PROMPT.md

๐Ÿƒ 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 directory
  • get_project - Get project by ID/name/path
  • list_projects - Browse all projects
  • get_active_agents - See who's working

๐Ÿ—๏ธ Project Management

  • create_project - Create new project with workspace
  • get_project_info - Get project details
  • get_project_decisions - View decision history
  • search_decisions - Search through decisions

๐Ÿ‘ค Agent Management

  • register_agent - Register as agent
  • get_agents_in_project - View project agents
  • get_agent_context - View agent activity

๐Ÿ“ Context & Coordination

  • start_context - Start working on task
  • end_context - Finish task
  • lock_files - Lock files before editing
  • unlock_files - Unlock files when done
  • get_locked_files - Check file locks

๐Ÿ’พ Memory & Documentation

  • save_decision - Record technical decisions
  • update_tech_stack - Track technologies
  • get_tech_stack - View tech stack
  • log_change - Log code changes
  • get_recent_changes - View recent activity

๐Ÿ›๏ธ Architecture

  • get_architecture_recommendation - Get guidance
  • analyze_architecture - Analyze structure
  • validate_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_type is valid: "opencode", "cursor", "claude_code", or "custom"
  • Check that capabilities is a list of strings
  • Verify the server is running

๐Ÿ“– Documentation

๐Ÿค 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


Made with โค๏ธ for better multi-agent coding experiences

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coordmcp-0.1.1.tar.gz (140.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coordmcp-0.1.1-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

Details for the file coordmcp-0.1.1.tar.gz.

File metadata

  • Download URL: coordmcp-0.1.1.tar.gz
  • Upload date:
  • Size: 140.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for coordmcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a45e77ea80bf4516856811e9b555a324248a428f6c3cf14267875a9c4c086a5
MD5 a12eb36da4a248618f787228b1cf0849
BLAKE2b-256 81e90b5261feead7c635b4b56b36b8d0d590102a07a10872a9bb1dcaca1bfb2e

See more details on using hashes here.

File details

Details for the file coordmcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: coordmcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for coordmcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a859872c155b0e5c1d82c84fa6252ff3c92dec8ac2dc4bb3716f6f662d4f73d
MD5 4d12b9f468802b49996c164a5f535631
BLAKE2b-256 5ef30f0a7d7e8cfa274e48fcb364c6bc225aae818984e93a3300f97e5f80b9db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page