MCP Cross-Model Delegation

io.github.Jostophe-021由 GitHub 帳號 Jostophe-021 發布v1.0.0更新於 Oct 24, 2026

Local MCP framework for bounded cross-model delegation, routing and evidence verification.

發布方自己的服務:Delegation School

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理把受限文字任務委派給 Gemini 或 Anthropic,依條件在供應商之間路由,並在本機核驗引文。

可以做什麼
  • 透過單一介面把附帶選用上下文的受限文字任務委派給 Gemini 或 Anthropic,支援手動、規則或基準加權路由。
  • 擷取結構化發現,並在本機對照所提供的上下文核驗引文是否確實存在。
  • 套用呼叫端條件,例如允許或已核准的供應商、隱私模式、成本與延遲上限、結構化輸出與證據要求。
  • 解釋路由決策,列出可用與被拒的供應商、原因代碼與備援鏈,且不發出 API 呼叫。
  • 以確定性的假供應商執行離線基準測試,或選擇性進行跨供應商的線上基準實驗。
適用情境
適合需要把受限文字工作交給第二個模型、在明確的隱私、成本與延遲限制下比較或路由 Gemini 與 Anthropic,或核驗擷取引文是否確實出現在原文中的情境。它著重實驗與量測,而非自主多步驟代理。
執行需求
以本機程序執行:需要 Python 3.12 或 3.13 與 uv,或使用已發佈的 Docker 映像。實際呼叫至少需要一個供應商金鑰:GEMINI_API_KEY 和/或 ANTHROPIC_API_KEY,須自行在環境中設定;離線基準不需金鑰。可選設定 DEFAULT_PROVIDER 與 CROSSMODEL_HISTORY_PATH。HTTP 監聽僅限本機回環位址。
安裝前請注意
線上呼叫可能在你的 Gemini 或 Anthropic 帳戶產生費用,Claude 訂閱不提供 Anthropic API 額度。金鑰屬機密:不要提交,也不要貼到指令或聊天中。哪些文字離開本機由呼叫端決定,其對提示注入的防護被描述為緩解措施而非保證。儲存原始回應應僅限可再散布的資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MCP Cross-Model Delegation,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MCP Cross-Model Delegation

English | Français

[Tests] [Security] [Python 3.12 and 3.13] [License: Apache-2.0]

An open, reproducible and security-conscious framework for measuring, comparing, routing and verifying bounded work across heterogeneous language models.

One Python core powers an MCP server and a benchmark CLI: measure → compare → route → verify → improve. V1 supports Gemini, Anthropic, and a deterministic fake provider for offline tests. Routing is explicit, quotation evidence is checked locally, and no improvement in quality, cost, or latency is claimed without measurement.

mermaid
flowchart LR    A["TASK + CONTEXT"] --> B["Caller constraints"]    B --> C["Router"]    H["Benchmark history"] -. "weighted policy" .-> C    C --> D["Gemini or Anthropic"]    D --> E["Result"]    E --> F["Local quote check<br/>for extraction"]    E --> G["Optional benchmark evaluation"]    F --> G

What you can do today

  • Delegate bounded text work to Gemini or Anthropic through one interface.
  • Apply privacy, capability, cost, and latency constraints before provider selection; inspect routing reasons.
  • Verify extracted quotations against the supplied context.
  • Run deterministic offline benchmarks without API keys, or opt in to live cross-provider experiments.

Why this is different

The same loop measures, routes, executes, verifies evidence, and evaluates results. The default policy is manual; rules and benchmark_weighted require explicit opt-in. Historical scores do not promise future quality or latency. See the architecture, methodology, and use cases.

Try it in 5 minutes

Python 3.12 or 3.13 and uv are supported. A Gemini API key and an Anthropic API key are independent; configure either or both. A Claude subscription does not provide Anthropic API credits.

bash
git clone https://github.com/Jostophe-021/mcp-cross-model-delegation.gitcd mcp-cross-model-delegationuv sync --locked --extra all --extra testuv run crossmodel doctoruv run crossmodel providersuv run crossmodel bench run benchmarks/datasets/basic.jsonl

The benchmark above uses FakeProvider and needs no API key. Software validation only — not an LLM performance result. See the four offline examples.

Try a real provider

Set GEMINI_API_KEY or ANTHROPIC_API_KEY only when you intend to call a real provider. Live API usage may incur provider charges. Start with synthetic or redistributable text, and inspect the planned call count before a live benchmark.

From this repository, install only the needed adapter with uv sync --locked --extra gemini or uv sync --locked --extra anthropic. The base package needs neither provider SDK for offline benchmarks. PyPI publication is a separate release step; install from the repository until a PyPI release is verified.

Set GEMINI_API_KEY and/or ANTHROPIC_API_KEY in your own environment. .env.example shows names only; never commit .env or paste a key into a command, issue, or chat. Set DEFAULT_PROVIDER=anthropic if Anthropic is your manual default. Run crossmodel serve to expose streamable HTTP MCP at http://127.0.0.1:8000/mcp. MCP_HOST=0.0.0.0 is refused because the server has no public client authentication.

MCP tools

ToolPurpose
delegate_taskDelegate a bounded TASK with optional CONTEXT, provider, policy, and constraints.
extract_findingsExtract structured findings, then locate quotations locally in CONTEXT.
gemini_delegate_task, gemini_extract_findingsV0.1 compatibility aliases using Gemini and manual routing.

Generic tools default to policy="manual". provider follows DEFAULT_PROVIDER, then Gemini if configured, then the first configured provider. Opt in to policy="rules" or policy="benchmark_weighted". For weighted routing in MCP, the server operator sets CROSSMODEL_HISTORY_PATH to a local/public history.json produced by a benchmark; callers cannot choose a file path. Constraints include allowed_providers, privacy_mode, approved_providers, max_cost, max_latency, require_structured_output, require_evidence, fallback_allowed, and explicit allow_unknown_cost. A strict cost or latency cap rejects unknown values. privacy_mode="local_only" rejects both included external providers with NO_ELIGIBLE_PROVIDER.

The tools accept only caller-supplied text. They do not read files, email, Drive, or apps, execute code, or take actions in other services. The caller decides what may leave the machine. TASK and CONTEXT remain distinct JSON fields; instructions in CONTEXT are untrusted. This is a mitigation, not a security guarantee. The security model details the limits.

Explain a route

bash
crossmodel route explain --policy rules --constraints '{"privacy_mode":"external_allowed"}'crossmodel route explain --provider gemini --policy manualcrossmodel route explain --policy benchmark_weighted --history results/<run-id>/history.json

This makes no API call. It prints eligible and rejected providers, reason codes, fallback chain, and score components. Only measured common metrics are scored; missing values remain null.

Benchmark

The default run uses only FakeProvider; it never calls a paid API. It tests software behavior, not LLM research hypotheses.

bash
crossmodel bench run benchmarks/datasets/basic.jsonlcrossmodel bench report results/<run-id>crossmodel bench generate /tmp/long.jsonl --size medium --seed 42

Each run writes manifest.json, results.jsonl, summary.json, and history.json. Results omit TASK, CONTEXT, and responses by default; they include a SHA-256 of the exact context used. The dataset contains small, manually audited synthetic arithmetic, extraction, evidence, prompt-injection, error-detection, and long-context tasks. Generated long contexts record characters, seed, generator version, and tokens: null until measured.

For live experiments, use --live --provider gemini --orchestrator anthropic (or your configured providers). The CLI prints providers, conditions, task count, repetitions, and planned API calls before execution. Use --repetitions N --shuffle --seed 42 to repeat and randomize condition order. Concurrency is one. Cost is unavailable without a separate dated pricing source; no price is hardcoded. --save-responses writes raw answers and findings, so use it only with redistributable data. The four conditions are orchestrator_only, fixed_delegation, structured_delegation, and routed_delegation; V1 measures one model call per condition and does not implement a second orchestrator synthesis call. See benchmark format and methodology.

Develop and build

bash
uv sync --locked --extra all --extra testuv run pytest -quv run ruff check gateway.py server.py contracts.py routing.py execution.py evidence.py cli.py providers benchmarks testsuv builddocker build -t mcp-cross-model-delegation:1.0.0 .

The Docker image contains no API keys. Under Linux, docker run --rm --network host --env-file .env mcp-cross-model-delegation:1.0.0 keeps the MCP listener on host loopback. Docker Desktop host networking varies; local Python is the simpler option. The release workflow publishes ghcr.io/jostophe-021/mcp-cross-model-delegation:1.0.0 with OCI metadata and an SPDX SBOM. The optional OpenAI Secure MCP Tunnel can connect a compatible remote client without opening an inbound port; this repository includes no tunnel identifier or credential.

MCP Registry

Version 1.0.0 was accepted by the official MCP Registry publisher as io.github.Jostophe-021/mcp-cross-model-delegation. Its declared package is the public GHCR image. The Registry remains a preview service; check its current listing before relying on discovery.

Research

This project is designed to test when delegation helps, when it does not, and which trade-offs it introduces. Start with the methodology, research roadmap, synthetic dataset and benchmark format, result schema, and first live experiment guide. Publish only non-sensitive raw results, a summary, and limitations; cite the version using CITATION.cff.

Build your own version

text
Fork → Provider / Policy / Evaluator / Dataset → Your derivative project                                                ↘ Optional upstream contribution

The extending guide shows the V1 interfaces and their current limits. The contributing guide explains how to keep a fork current with upstream.

Forks and derivative projects

Forking and adaptation are explicitly welcome. On GitHub, use Fork when you want the upstream relationship to remain visible. Independent derivative projects are also permitted under Apache-2.0, subject to the applicable license and attribution requirements. Generic improvements are welcome upstream; forks are free to diverge. Preserve the applicable LICENSE and NOTICE, identify your changes, and cite the original project when relevant.

Related work and support

Generic cross-model delegation predates this project. The related work page links to existing bridges, multi-provider systems, routing, and evaluation tools. For usage and research questions, see SUPPORT.md and Discussions; report vulnerabilities through private reporting.

This is not

  • A claim that multi-model delegation always helps or one provider is universally superior.
  • An autonomous agent platform, a production security boundary by itself, or a prompt-injection guarantee.
  • An official OpenAI, Anthropic, or Google product.

No custom telemetry is enabled. Unknown token usage, cost, and quality remain unknown. See the research roadmap, changelog, contributing guide, Discussions, and citation metadata. The code is under Apache-2.0.

來源:README.md,提交 e0cf7c9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.0.0最新Sep 25, 2026
  2. v0.1.0Sep 25, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Delegation 整合