Skip to main content

One CLI that auto-routes tasks to the best AI model — Gemini, GPT, Claude, DeepSeek, Llama. No model selection needed.

Project description

MMCP Python SDK

Multiple Model Context Protocol — orchestrate AI models as a coordinated DAG.

Python port of the @mmcp/core TypeScript SDK.

Install

pip install mmcp-core

# With LangChain/LangGraph support
pip install mmcp-core[langchain]

# Development
pip install mmcp-core[dev]

Quick Start

import asyncio
from mmcp_core import MMCPOrchestrator, RoleBasedRouter, MemoryStore

async def main():
    orc = MMCPOrchestrator({
        "router": RoleBasedRouter({
            "architect": {"model_id": "claude-haiku-4-5-20251001"},
            "reviewer":  {"model_id": "claude-haiku-4-5-20251001"},
        }),
        "store": MemoryStore(),
    })

    result = await orc.run_chain(
        "Explain the observer pattern in Python.",
        ["architect", "reviewer"]
    )

    print(f"✅ {result.output}")
    print(f"🪙 Tokens: {result.total_tokens}")
    print(f"💰 Cost: ${result.total_cost_usd:.6f}")

asyncio.run(main())

DAG Operations

Operation Signature Description
fork 1 → N Spawn parallel sub-contexts
merge N → 1 Combine parent outputs
handoff 1 → 1 Pass to different model/role
shard 1 → N Split long content
verify 1 → 2 Trust contract (challenger + synthesizer)

LangGraph Tracer — One Line

from langchain_mmcp import MMCPTracer

tracer = MMCPTracer(
    regulation_tags=["SOC2", "GDPR"],
    export_path="./mmcp-audits/"
)

# Add to ANY LangGraph or LangChain pipeline
result = app.invoke(input, config={"callbacks": [tracer]})

# Access audit trail
wire_dag = tracer.get_wire_dag()
tracer.print_summary()

Wire Format

Every execution produces a JSON WireDAG with:

  • SHA-256 audit hashes per node
  • Full parent DAG lineage
  • Token usage and cost per node
  • Regulation compliance tags
  • Tamper-proof audit chain

Environment

export ANTHROPIC_API_KEY=sk-ant-...

License

MIT

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

mmcp_core-1.0.0.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

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

mmcp_core-1.0.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file mmcp_core-1.0.0.tar.gz.

File metadata

  • Download URL: mmcp_core-1.0.0.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mmcp_core-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1cc64e9942b244e11a2835525fa0aadbe6d7d3df19fc23dc188cd19525cf3870
MD5 e9ae989eadeaeb331f9c4046ca0cc2cf
BLAKE2b-256 30234a2612b53b58f8942c1b1255e77a5d1ba13991c90dfe6498225d8f599f84

See more details on using hashes here.

File details

Details for the file mmcp_core-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mmcp_core-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mmcp_core-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f796764cc84b80813bb0e783028d1740e8b2f00f207d8d734a7b01d1295632c
MD5 11e488b4b09c54116da11bc631727874
BLAKE2b-256 c02ad93d6d5a0ae3e3509da9fa7943bc852d035b2db32e5f1516ae1575dfe5f1

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