Skip to main content

MCP bridge for MPAC: coordinate coding agents working on the same repository

Project description

mpac-mcp

mpac-mcp is the MCP-facing bridge for MPAC.

It does not re-implement the coordination protocol. Instead it:

  • detects the current repository context
  • ensures a local MPAC sidecar is running
  • queries the sidecar for shared coordination state
  • exposes high-level tools to MCP-compatible coding clients

All bundled smoke scripts now run against an isolated scratch workspace copied from the requested repo path, so repeated runs do not inherit stale conflicts or frozen scope from a long-lived sidecar session.

Current scope

This initial scaffold focuses on the shortest end-to-end path:

  • local sidecar auto-discovery / auto-start
  • repository-root detection
  • session summary query
  • first MCP tools:
    • who_is_working
    • begin_task
    • check_overlap
    • get_file_state
    • ack_conflict
    • submit_change
    • yield_task
    • escalate_conflict
    • resolve_conflict
    • take_over_task
  • a Milestone 0 validation script for "two processes share one local coordinator"
  • an end-to-end smoke script for "one external client + one MCP-owned task"
  • an end-to-end smoke script for "begin task -> submit change -> yield task"
  • an end-to-end smoke script for "ack -> escalate -> resolve"
  • an end-to-end smoke script for "suspend -> claim -> take over"

Multi-tenant Hosted Mode (Authenticated Profile)

When deploying a hosted coordinator for multiple projects/teams:

  1. Set MPAC_TOKEN_TABLE as a JSON env var mapping bearer tokens to allowed sessions:

    {
      "<token-for-alice>": {"allowed_sessions": ["proj-alpha"], "roles": ["contributor"]},
      "<token-for-bob>":   {"allowed_sessions": ["proj-beta"],  "roles": ["contributor"]}
    }
    
  2. Start the sidecar in multi-session mode:

    mpac-mcp-sidecar --multi-session --host 0.0.0.0 --port 8766 --tls
    

    The sidecar auto-detects MPAC_TOKEN_TABLE and switches to security_profile=authenticated.

  3. Clients connect with their token in the HELLO credential field:

    wss://your-host/session/proj-alpha
    

    Tokens bound to proj-alpha can only join proj-alpha — cross-session access returns CREDENTIAL_REJECTED.

See deploy/fly-coordinator/ for a complete Docker + Caddy + fly.io deployment recipe.

Development status

This directory is the start of the mpac-mcp product entry point. It is intentionally thin: MPAC remains the runtime and coordination engine; mpac-mcp is the integration layer.

Running the Milestone 0 smoke check

From this repository root:

python3 mpac-mcp/src/mpac_mcp/milestone0.py --workspace .

This will:

  • derive a deterministic local sidecar port from the repo path
  • start the local sidecar if it is not already running
  • launch two independent demo clients
  • announce two overlapping intents
  • query the sidecar summary and print the result

Running the tool smoke check

From this repository root:

python3 mpac-mcp/src/mpac_mcp/smoke_tools.py --workspace .

This will:

  • ensure the local sidecar is running
  • launch one independent demo client
  • call begin_task(...) through the bridge
  • call check_overlap(...)
  • confirm that overlap is visible through shared sidecar state

Running the commit smoke check

From this repository root:

python3 mpac-mcp/src/mpac_mcp/smoke_commit.py --workspace .

This will:

  • ensure the local sidecar is running
  • call begin_task(...)
  • call submit_change(...) once with a derived state_ref_before
  • verify the sidecar state changed
  • call yield_task(...)

Running the governance smoke check

From this repository root:

python3 mpac-mcp/src/mpac_mcp/smoke_governance.py --workspace .

This will:

  • ensure the local sidecar is running
  • launch one contributor client and one arbiter client
  • call begin_task(...) to create a real overlap
  • call ack_conflict(...)
  • call escalate_conflict(...)
  • call resolve_conflict(...)

Running the takeover smoke check

From this repository root:

python3 mpac-mcp/src/mpac_mcp/smoke_takeover.py --workspace .

This will:

  • ensure the local sidecar is running
  • launch one client that leaves with GOODBYE(intent_disposition="transfer")
  • verify the sidecar exposes a suspended intent
  • call take_over_task(...)
  • verify the replacement intent becomes active

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

mpac_mcp-0.1.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

mpac_mcp-0.1.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file mpac_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mpac_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mpac_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fdcec3dea9789e27f1edb713d2fcb36a00da095e17878f8ce7d429b43d1c6129
MD5 f93d83adc2fe8dd6d70ea2bed53b83d2
BLAKE2b-256 fb7f96bfaf158e26ee9ccc29c987a6ba53fe9f067fdc74bb340028624375b4e3

See more details on using hashes here.

File details

Details for the file mpac_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mpac_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mpac_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e6817845a98262fb2dfc73617b47a6fad061519c4783f0d6ab309a9d0c75914
MD5 5e9e508c9fb8dbbdc2e06891e5a73c1e
BLAKE2b-256 b29f408f6d19a96fe88fc15f107dc59e73f377b667ddde6da9e366a19f99e3dc

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