adaptorch-mcp
Run responses may expose versioned verification_diagnostics as bounded
observations, including an untrusted project_report from explicit PDF checks.
verification_diagnostics_schema_version is verification.diagnostics/v1.
Only closed codes, source, scope and four allowlisted tool names survive remote
projection. Logs remain redacted; malformed optional metadata is dropped while
the original result survives.
Installable remote-only Model Context Protocol (MCP) server and Python client for AdaptOrch — bringing DAG topology routing, multi-model synthesis, run-output.v1 / run-generation.v1 generation-limit observations, and verifiable execution receipts to Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Kimi Code, and Grok.
The package forwards a restricted MCP surface to the hosted control plane over authenticated JSON-RPC. It does not install or execute the private AdaptOrch engine. Routing, synthesis, policy and execution remain on the server. The public remote exposure profile keeps local topology and trace oracles out of the MCP surface.
Benchmarks (measured)
GPT LUNA (gpt-6-luna) — Math accuracy vs 3x majority vote (n = 351 paired units)
| Benchmark | n | OFF (1 call) | VOTE x3 | AdaptOrch ON | ON - OFF | ON - VOTE | OFF tok/Q | VOTE tok/Q | ON tok/Q |
|---|---|---|---|---|---|---|---|---|---|
| AIME 2025 | 111 | 57.7% | 58.6% | 73.9% | +16.2 pp | +15.3 pp | 1,110 | 3,308 | 3,129 |
| AIME 2026 | 120 | 65.8% | 67.5% | 78.3% | +12.5 pp | +10.8 pp | 1,095 | 3,182 | 3,076 |
| HMMT Feb 2025 | 120 | 43.3% | 45.8% | 56.7% | +13.3 pp | +10.8 pp | 1,188 | 3,719 | 3,468 |
| Pooled | 351 | 55.6% | 57.3% | 69.5% | +14.0 pp | +12.3 pp | 1,132 | 3,405 | 3,227 |
Per-problem sign tests (90 problems): ON vs OFF 35–4 (p = 3.35e-07); ON vs VOTE x3 33–8 (p = 0.000112), using 5.2% fewer tokens than VOTE x3. Scope: gpt-6-luna (requested model ID, Codex OAuth, default sampling); 351/360 matched units (9 excluded for missing direct samples; no majority on 131 complete VOTE units); ON includes recovered no-answer timeouts; not an official leaderboard result.
Three.js WebGL scenes — OFF (1 call) vs AdaptOrch ON (9 scenes)
| Metric | OFF (1 direct call) | AdaptOrch ON (draft -> review -> final) |
|---|---|---|
| Zero-error renders | 7 / 9 | 9 / 9 |
| Output tokens / wall time | 135,557 tok / 4,823 s | 359,102 tok (2.65x) / 13,409 s (2.78x) |
OFF failed on threejs-voxel-world (GLSL reserved word patch shader crash) and threejs-rubik-cstech (THREE is not defined build script instead of HTML); AdaptOrch ON rendered 9/9 scenes with 0 browser errors (headless Chrome + SwiftShader software WebGL, 1 run per prompt; not a blind quality evaluation). Full 9-scene table in the repository README.
Install
pip install --upgrade "adaptorch-mcp>=0.6.3,<0.7"
adaptorch-mcp-client --help
Use adaptorch-mcp-client to select this remote client explicitly. The
adaptorch-mcp launcher name is retained for compatibility.
One-shot with uvx, without an engine checkout:
uvx --from "adaptorch-mcp==0.6.3" adaptorch-mcp-client --help
For contributors inside this monorepo:
uv sync --all-packages --extra dev
uv run adaptorch-mcp-client --help
Run stdio MCP
Use stdio for Claude Code, Claude Desktop, and other local MCP hosts. The upstream token is the AdaptOrch API key issued at https://adaptorch.com/app/api-keys (ado_live_*, or ado_test_* for test mode; legacy ak_* keys remain accepted).
export ADAPTORCH_CONTROL_PLANE_TOKEN="<ado_live_your-key>"
adaptorch-mcp-client --transport stdio --base-url https://adaptorch.com
For a BYOK-only control plane, configure the provider credential in the MCP process environment:
export ADAPTORCH_MCP_PROVIDER="openai"
export ADAPTORCH_MCP_PROVIDER_MODEL="gpt-4.1-mini"
export ADAPTORCH_MCP_PROVIDER_API_KEY="<provider-api-key>"
The key is never exposed as an MCP tool argument or JSON body field. It is sent only on run submission, redacted from errors, and omitted from status, artifact, usage, and catalog requests. Provider credentials are forwarded only to the configured AdaptOrch service, never executed by a local engine.
Runs submitted through this wrapper are stamped metadata.connector_source="mcp" by the engine, so they appear in the dashboard MCP status card and https://adaptorch.com/app/runs for the key's tenant.
Run HTTP MCP
Use HTTP for local gateways, reverse proxies, or remote MCP clients. Keep the client-facing MCP token separate from the upstream AdaptOrch token.
export ADAPTORCH_CONTROL_PLANE_TOKEN="<upstream-adaptorch-token>"
export ADAPTORCH_MCP_HTTP_AUTH_TOKEN="<client-facing-mcp-token>" # must differ from upstream
adaptorch-mcp-client \
--transport http \
--base-url https://adaptorch.com \
--http-host 127.0.0.1 \
--http-port 8765 \
--http-auth-token "$ADAPTORCH_MCP_HTTP_AUTH_TOKEN"
Health and metrics require the client-facing bearer token:
python - <<'PY'
import os
from urllib.request import Request, urlopen
request = Request(
"http://127.0.0.1:8765/mcp/health",
headers={"Authorization": f"Bearer {os.environ['ADAPTORCH_MCP_HTTP_AUTH_TOKEN']}"},
)
with urlopen(request) as response:
print(response.read().decode("utf-8"))
PY
The built-in HTTP listener is loopback-only. Put an authenticated TLS reverse proxy in front of it for remote clients.
The listener caps concurrent connections at ADAPTORCH_MCP_MAX_SSE_SUBSCRIBERS (engine default 64) plus 64, answering 503 beyond that, waits at most 10 seconds for open streams on shutdown, and sends no server header.
Connections to the control plane
The connector keeps HTTP/1.1 connections alive through adaptorch_client.keepalive, a declared dependency (adaptorch-client>=0.1.6,<0.2). Status, artifact and usage reads reuse one idle connection for up to 4 seconds, so adaptorch_run polling no longer repeats the TCP and TLS handshake on every read. Run submission and cancellation always open a fresh connection and are sent once. A read whose idle connection the server had already closed is written once more on a new connection; timeouts are never re-sent. Redirects and ambient proxies remain disabled, and TLS requires certificate verification and TLS 1.2 or newer.
stdio over SSH
Run the wrapper on another host by letting SSH carry stdio. Keep ADAPTORCH_CONTROL_PLANE_TOKEN in that host's environment (SSH does not forward it unless SendEnv/AcceptEnv allow it), use ssh -T, and keep remote login scripts silent: any banner on stdout breaks JSON-RPC framing.
adaptorch-mcp-smoke --command "ssh -T build-host /opt/adaptorch/bin/adaptorch-mcp" \
--base-url https://adaptorch.com
The smoke reports non-JSON stdout with that hint, without echoing the line, and reads each response straight from the pipe, so an SSH session that keeps stdout open after answering no longer causes a false timeout. The appended --transport stdio --base-url ... --stdio-framing newline arguments travel through SSH to the remote command.
CLI reference
| Command | Purpose | Important options |
|---|---|---|
adaptorch-mcp-client (adaptorch-mcp legacy alias) |
Start the stdio or HTTP MCP server. | --transport {stdio,http}, --base-url, --api-token, --timeout-seconds, --stdio-framing, --http-host, --http-port, --http-auth-token |
adaptorch-mcp-doctor |
Print redacted local diagnostics. | --json, --strict |
adaptorch-mcp-smoke |
Verify stdio initialize + tools/list. |
--command, --base-url, --api-token, --timeout-seconds, repeatable --expected-tool |
For adaptorch-mcp, the public wrapper resolves the control-plane URL in this order: explicit --base-url, then trimmed/validated ADAPTORCH_CONTROL_PLANE_BASE_URL, then the hosted fallback https://adaptorch.com. adaptorch-mcp-smoke uses the same order and hosted fallback. Pass --base-url explicitly in checked-in MCP client configs for reproducible behavior.
Environment variables
| Variable | Purpose | Notes |
|---|---|---|
ADAPTORCH_CONTROL_PLANE_TOKEN |
Upstream AdaptOrch API key (ado_live_*/ado_test_*, legacy ak_*) from /app/api-keys. |
Required unless --api-token is passed. |
ADAPTORCH_CONTROL_PLANE_BASE_URL |
Base URL used when --base-url is omitted. |
Trimmed and validated as HTTP(S); do not embed credentials. |
ADAPTORCH_MCP_PROVIDER |
BYOK provider name, or auto. |
Set with ADAPTORCH_MCP_PROVIDER_MODEL; run submission only. auto uses the one provider whose own key variable is set (OPENAI_API_KEY, ANTHROPIC_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, GOOGLE_API_KEY, XAI_API_KEY, OPENCODE_GO_API_KEY, OPENAI_CODEX_API_KEY, WORKBUDDY_API_KEY, DEEPSEEK_API_KEY, COMMANDCODE_API_KEY) and fails closed otherwise. |
ADAPTORCH_MCP_PROVIDER_MODEL |
BYOK provider model. | Set with ADAPTORCH_MCP_PROVIDER; run submission only. |
ADAPTORCH_MCP_PROVIDER_API_KEY |
BYOK provider key. | Process-local and secret-safe; optional only for keyless providers. Mutually exclusive with ADAPTORCH_MCP_PROVIDER_API_KEY_COMMAND. |
ADAPTORCH_MCP_PROVIDER_API_KEY_COMMAND |
Rotating BYOK credential. | Caller-owned command (no shell) printing only the access token; resolved once per submission, never for polling or redaction. |
ADAPTORCH_MCP_PROVIDER_AUTH_TYPE |
api_key or oauth. |
OAuth currently supports explicit openai_codex. Both server and local engine need matching source support. |
ADAPTORCH_MCP_PROVIDER_ACCOUNT_ID |
Request-scoped OAuth account selection. | Forwarded as X-Provider-Account-Id, omitted from repr/errors; does not reuse the host account. |
ADAPTORCH_MCP_HTTP_AUTH_TOKEN |
Client-facing bearer token for HTTP/SSE MCP. | Required for HTTP and must differ from the upstream token. |
ADAPTORCH_MCP_EXPOSURE_PROFILE |
MCP exposure policy. | remote (default) hides local route/trace oracles; full explicitly restores the parent surface. |
ADAPTORCH_MCP_ALLOW_INSECURE_CONTROL_PLANE |
Development-only remote HTTP opt-in. | Truthy values allow plaintext non-loopback control-plane URLs; never enable in production. |
ADAPTORCH_MCP_ALLOWED_ORIGINS |
Comma-separated HTTP origin allowlist. | Use with browser or remote HTTP clients. |
ADAPTORCH_MCP_MAX_PAYLOAD_SIZE_BYTES |
Maximum accepted HTTP request body size. | Keep bounded for public deployments. |
ADAPTORCH_MCP_REQUEST_TIMEOUT_SECONDS |
HTTP request timeout budget. | Applies to HTTP server request handling. |
ADAPTORCH_MCP_MAX_SSE_SUBSCRIBERS |
Maximum concurrent SSE subscribers. | Defaults are provided by adaptorch.mcp_server. |
ADAPTORCH_MCP_TIMEOUT_SECONDS |
Control-plane client timeout for app-factory usage. | Useful when embedding the ASGI app. |
ADAPTORCH_MCP_HTTP_HOST / ADAPTORCH_MCP_HTTP_PORT |
Shell/template values for --http-host and --http-port. |
CLI flags are authoritative. |
ADAPTORCH_REPRODUCIBLE |
Benchmark/eval reproducibility beta. | Benchmark/eval scope only; not general runtime determinism. |
ADAPTORCH_ROUTER_ACCURACY_GATE |
Online-router learned-model gate. | point default or wilson; advanced/operator use. |
ADAPTORCH_PAPER_SEMANTIC_WEIGHT |
Paper-mode lexical/semantic blend. | Default 0.35; nonzero values use Python scoring over the native fast path. |
Engine-delegated optional controls
The wrapper forwards these controls to the installed adaptorch engine; it does
not implement routing, synthesis, or benchmark algorithms itself. See the root
configuration guide for non-env controls such as manifest_canonical_sha256,
pass_rate_credit, quality_signal, prefer_multi_model_ensemble_singleton,
and MCP prefer_ensemble_singleton.
Tool surface
| Tool | Purpose |
|---|---|
adaptorch_run |
Submit an AdaptOrch task payload and optionally wait. |
adaptorch_get_run |
Read a run summary, optional bounded Correctness Wall view, and optional run-output.v1 / run-generation.v1 output (include_output=true) by run_id. |
adaptorch_get_artifacts |
Read artifact metadata for a run. |
adaptorch_list_runs |
List recent runs. |
adaptorch_cancel_run |
Request run cancellation (write/destructive; keep manually approved). |
adaptorch_recheck_claim |
Opt-in BYOK claim recheck against supplied quotes when advertised by the authenticated control plane. |
adaptorch_server_metrics |
Read redacted MCP server metrics. |
adaptorch_capabilities |
Read synthesis modes, topologies, extractors, verifier/VERA vocabularies, connectors, server features, and plan catalog. |
adaptorch_usage |
Read the calling tenant's usage window (plan level, period, used, limit, remaining, percentage). |
adaptorch_plan_catalog |
Read hosted plan catalog (Pro $39/mo, Team $149/mo; 3-day free trial, annual discount). |
adaptorch_get_traces and adaptorch_route_topology are available only when ADAPTORCH_MCP_EXPOSURE_PROFILE=full. In the default profile, run diagnostics and telemetry are redacted, run-resource templates are hidden, completions are disabled, and server events are not broadcast to SSE subscribers.
For modern MCP clients, adaptorch_get_run advertises a closed outputSchema and returns structuredContent reconstructed from the wrapper's own allowlist projection. Its optional correctness_wall is bounded advisory observability from the installed parent AdaptOrch engine. Even a PASS verdict is not a correctness proof, active-selector decision, or authorization to apply a candidate; inspect its claim_boundary and recommended_action.
For a control plane with the new modelstudio-maas provider, see
ModelStudio Token Plan. This is a
source-checkout integration, not a claim that the hosted service has been upgraded.
Security boundary
The hardened defaults reduce direct algorithm-oracle, transport, and token-confusion risk. They do not provide DRM: reverse engineering cannot be made impossible for distributed Python code or a queryable black-box service. Keep proprietary algorithms and rate-limit/model-extraction defenses on the hosted control plane; treat full as trusted local/operator mode only.
Remote control-plane URLs require HTTPS by default. Plain HTTP is accepted only for exact loopback addresses, unless the development-only ADAPTORCH_MCP_ALLOW_INSECURE_CONTROL_PLANE=1 opt-in is set. The HTTP MCP listener itself accepts only loopback binds.
Diagnostics and smoke tests
adaptorch-mcp-doctor
adaptorch-mcp-doctor --json
adaptorch-mcp-doctor --strict
The doctor command reports package availability, expected MCP tools, redacted environment metadata, and controlPlane base-url plus transport-policy validity without printing token values. The control-plane token entry adds formatRecognized (prefix check against the dashboard ado_*/ak_* key contract, booleans only). --strict fails for invalid exposure profiles, malformed URLs, or remote plaintext URLs without the explicit development opt-in.
export ADAPTORCH_CONTROL_PLANE_TOKEN="<ado_live_your-key>"
adaptorch-mcp-smoke --base-url https://adaptorch.com
Expected JSON includes "ok": true, adaptorch_plan_catalog, and the expected core tool subset. If no base URL is supplied, smoke targets https://adaptorch.com; pass --base-url http://127.0.0.1:8000 for a local control plane. Add repeatable --expected-tool <name> flags when validating a specific hosted/core release.
Example configs
../../examples/claude_desktop_config.json../../examples/omk.mcp.json../../examples/mcp-http.env.example
Checked-in examples use placeholders or environment interpolation. Fill real URLs and tokens only in local, uncommitted config files. For shared or production clients, avoid auto-approving run, artifact, and trace readers unless those payloads are already sanitized.
HTTP app factory
create_default_mcp_http_app() embeds the canonical AdaptOrch MCP HTTP ASGI app. It requires an upstream control-plane token in the environment.
export ADAPTORCH_CONTROL_PLANE_TOKEN="<upstream-adaptorch-token>"
export ADAPTORCH_CONTROL_PLANE_BASE_URL="https://adaptorch.com"
export ADAPTORCH_MCP_HTTP_AUTH_TOKEN="<client-facing-mcp-token>" # distinct from upstream
from adaptorch_mcp import create_default_mcp_http_app
app = create_default_mcp_http_app()
License
Proprietary — Copyright ClassicMate. All rights reserved. See LICENSE.
Metadata
Release files for adaptorch-mcp 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| adaptorch_mcp-0.6.3.tar.gz | 122.8 kB | Without provenance | Details for adaptorch_mcp-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| adaptorch_mcp-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for adaptorch_mcp-0.6.3-py3-none-any.whl |
Total release size: 189.3 kB
Release files / adaptorch_mcp-0.6.3.tar.gz
| Download URL | adaptorch_mcp-0.6.3.tar.gz |
|---|---|
| Size | 122.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19f5b7ba8b375baf8a5e6f87279a0ff61f770befaddd451984eba64c3aa1a5f0
|
|
BLAKE2b-256 checksum How to use checksums |
3dd8054b065773b79b322571eeff573bd35b383e1d9157556b96359c60925d18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / adaptorch_mcp-0.6.3-py3-none-any.whl
| Download URL | adaptorch_mcp-0.6.3-py3-none-any.whl |
|---|---|
| Size | 66.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31032fa9c0b1468e0088947e654f34a05cd70d0f5e5b21dfac1b245d2c3ecb3b
|
|
BLAKE2b-256 checksum How to use checksums |
a53edf678b3c0d952989b1bf538ae7e35a497b465cb3eb905331a20b29ed63b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for adaptorch-mcp 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.