Open source · Apache-2.0 · Node ≥ 20

One layer between your agents and everything they touch.

MCP-compatible gateway + agent-to-agent mesh. Drop-in. Local-first. Open source.

npx -y github:SpeakQuery/mycel init
Star on GitHub

Imports your existing Claude, Cursor, VS Code and Windsurf MCP configs. No account. No telemetry.

Tools in context
180 → 8
Tool-definition tokens
38k → 1.9k
Round trips, multi-step task
10 → 1

Launch video

The problem

MCP made tools pluggable. It didn't make them cheap, fast or safe.

Connect a dozen servers and your agent pays for it on every turn. Eight pains we kept hitting:

  1. Context bloat

    Every server dumps its full tool schemas up front. Thirty servers cost tens of thousands of tokens before the first word.

  2. Everything flows through the model

    Moving 10k rows from tool A to tool B means 10k rows in the context window.

  3. Round-trip storms

    A 10-step task becomes 10 inference turns, each one slow and billed.

  4. Security bolted on

    Tool output can smuggle instructions, descriptions can change silently (rug pulls), and API keys sit in prompts.

  5. Tools don't describe their cost

    No latency, no price, no hint whether a call can be undone.

  6. Long-running work has no home

    Video, render and training calls simply time out.

  7. Agents can't safely delegate

    Sub-agents inherit full credentials, with no way to narrow them.

  8. No black box

    Nobody can see what an agent did, or why.

Before / after

Same tools. A fraction of the context.

Measured with mycel bench: the same catalog of 12 servers, called directly over MCP and through Mycel.

Direct MCP

  • 180tool schemas loaded up front
  • 38ktokens of tool definitions
  • 10inference round trips

Through Mycel

  • 8meta-tools, schemas on demand
  • 1.9ktokens of tool definitions
  • 1round trip with Code Mode

Reproduce it yourself: npx -y github:SpeakQuery/mycel bench. Numbers vary with your catalog and task.

Architecture

A gateway on the way in, a mesh on the way out.

Clients speak plain MCP to Mycel. Remote agents speak A2A. Behind it, every upstream server and agent is reached through one trust layer and one recorder.

Mycel architecture MCP clients such as Claude, Cursor, ChatGPT or a local LLM connect to Mycel over stdio or HTTP. Remote agents connect over A2A JSON-RPC. Inside Mycel: eight meta-tools; Router, Code Mode, Ref Store, Jobs and Model Router modules; a trust layer with policy, taint, secrets, pinning and capability tokens; and a flight recorder feeding a dashboard and OTLP. Mycel connects to GitHub, video model and database servers over MCP and to other agents over A2A. Claude · Cursor · ChatGPT · local LLM any MCP client, zero changes Remote agents A2A-compatible MCP · stdio | HTTP A2A JSON-RPC MYCEL Meta-tools search describe call run ref job delegate ask Router Code Mode Ref Store Jobs Model Router TRUST LAYER Policy · Taint · Secrets · Pinning · Capability tokens FLIGHT RECORDER Every call traced → Dashboard (localhost:4747) · JSONL · OTLP MCP MCP MCP A2A GitHub server Video model Database Other agents
On small screens, scroll the diagram sideways.

Features

Twenty features. All shipped in v1.

A 10-line config works. Every advanced feature is opt-in.

Speed & context

  • 01

    Smart Tool Router

    The model sees 8 meta-tools instead of 300. BM25 search over the catalog; schemas load on demand.

    mycel_search · mycel_describe · mycel_call
  • 02

    Code Mode

    The model writes a short JS script that chains many calls in a QuickJS WebAssembly sandbox. Only the result returns.

    mycel_run
  • 03

    Ref Store

    Large or binary results are stored content-addressed and replaced by a model-sized digest. Refs pass straight between tools.

    ref://sha256…
  • 04

    Job Queue

    Long calls become jobs with progress, cancel, resume, retries and provider fallback.

    mycel_job
  • 05

    Cost & Budget

    Per-tool cost and latency contracts, estimates before running, per-task and per-day caps.

    dryRun
  • 06

    Tool Contracts

    Every tool gets an effect class (read, write, destructive, external), idempotency, cost and latency.

    mycel_describe

Trust

  • 07

    Policy Firewall

    YAML rules allow, deny or require approval by tool glob or effect. Approve via MCP elicitation or the CLI.

    mycel approve <id>
  • 08

    Provenance / Taint

    Content from web, email or unknown servers is labelled. Destructive actions with tainted inputs need approval.

    automatic
  • 09

    Secret Vault

    The model only sees a placeholder. Real values are injected at call time and scrubbed from outputs.

    {{secret:GITHUB_TOKEN}}
  • 10

    Manifest Pinning

    Tool definitions are hashed. Silent changes are detected and blocked until re-approved.

    mycel.lock
  • 14

    Capability Tokens

    Macaroon-style delegation tokens. A sub-agent can only narrow tools, effects, budget and expiry, never widen them.

    mycel token attenuate

Visibility

  • 11

    Flight Recorder

    Every call traced: timing, tokens saved, cost, policy decisions. JSONL and OTLP export. Replay any task.

    mycel replay
  • 12

    Live Dashboard

    A local web UI for the timeline, token savings, cost, jobs and approvals.

    localhost:4747
  • 19

    Benchmark

    Reproducible: the same catalog, direct MCP vs Mycel, counting context tokens and round trips.

    mycel bench

Mesh & integration

  • 13

    A2A Bridge

    Mycel is an A2A agent with an Agent Card, and calls remote A2A agents as tools. MCP and A2A in one layer.

    mycel_delegate
  • 15

    Model Router

    Tiered routing (fast, balanced, deep) to any OpenAI-compatible or Anthropic endpoint for sub-tasks and digests.

    mycel_ask
  • 16

    Universal import

    Reads Claude Desktop, Claude Code, Cursor, VS Code and Windsurf configs.

    mycel init
  • 17

    Both transports

    Serve over stdio for desktop clients or Streamable HTTP for teams. Upstreams over either.

    mycel serve --http
  • 18

    Python client

    Call tools, refs, jobs and A2A agents from Python.

    pip install mycel-client
  • 20

    Plugin adapters

    A provider adapter, for example a new video model, is about 50 lines.

    examples/

How it works

Configure once. Let the model write the glue.

1 Declare servers, policy and budgets

One file. Secrets stay placeholders; unknown servers are marked untrusted; large results become refs.

mycel.yaml
servers:
  github: { command: npx, args: ["-y", "@modelcontextprotocol/server-github"], env: { GITHUB_TOKEN: "{{secret:GITHUB_TOKEN}}" } }
  studio: { url: "https://studio.example.com/mcp", trust: untrusted }
policy:
  - match: { effect: destructive }
    action: approve
  - match: { tool: "github.*delete*" }
    action: deny
budget: { perTaskUsd: 5, perDayUsd: 50 }
refs: { inlineLimitBytes: 8000 }

2 The model writes one script, not ten turns

Via mycel_run, the script runs in a QuickJS sandbox. Intermediate data never enters the context; only the return value does.

code mode · sandboxed JS
const issues = await tools.call("github.list_issues", { repo: "acme/web", state: "open" });
const stale = issues.filter(i => daysSince(i.updated_at) > 30);
for (const i of stale) await tools.call("github.add_label", { repo: "acme/web", issue: i.number, label: "stale" });
return { labelled: stale.length };

3 Policy decides before anything irreversible

Rules match by effect or tool glob. A destructive call pauses for approval; a forbidden one never reaches the server.

mycel.yaml · policy
policy:
  # reads flow freely
  - match: { effect: read }
    action: allow
  # anything destructive waits for a human
  - match: { effect: destructive }
    action: approve
  # and some things are simply off-limits
  - match: { tool: "github.*delete*" }
    action: deny

Where it fits

MCP vs A2A vs Mycel

MCP and A2A are protocols. Mycel is a layer that speaks both and adds what they leave to implementers.

CapabilityMCPA2AMycel
What it isProtocol: agent ↔ toolsProtocol: agent ↔ agentGateway + mesh implementing both
Tool discoveryAll schemas listed up frontSkills on an Agent CardSearch, schemas on demand
Multi-step chainingOne model turn per callPer taskCode Mode: one turn
Large resultsInline in contextArtifactsContent-addressed refs + digests
Long-running workProgress notificationsTask lifecycleJob queue with resume, retries, fallback
Policy & approvalsLeft to the clientLeft to the agentYAML firewall + elicitation
SecretsLeft to the serverAuth schemes declaredVault, injected and scrubbed
Rug-pull detectionNot specifiedNot specifiedManifest pinning
Scoped delegationNot specifiedNot specifiedAttenuable capability tokens
ObservabilityNot specifiedNot specifiedFlight recorder, OTLP, replay
Client changes neededn/an/aNone

Quickstart

Running in under a minute.

  1. Import your setup

    Finds your existing MCP configs and writes mycel.yaml.

    npx -y github:SpeakQuery/mycel init
  2. Point your client at Mycel

    Replace your server list with one entry. stdio for desktop, --http for teams.

    npx -y github:SpeakQuery/mycel serve
  3. Watch it work

    Timeline, savings, cost and approvals at localhost:4747.

    npx -y github:SpeakQuery/mycel dashboard

FAQ

Questions, answered straight.

Is Mycel a new protocol?

No. Mycel is a drop-in layer. To your client it is a standard MCP server; to other agents it is a standard A2A agent. Your existing MCP servers and clients keep working with zero changes.

Does it send my data anywhere?

No. Mycel is local-first: no account, no cloud, no telemetry. Traces stay on your machine as JSONL unless you configure your own OpenTelemetry endpoint. The only network traffic is to the servers, agents and models you configure.

Does it solve prompt injection?

No, and we'd be wary of anyone who says they do. Mycel reduces and exposes the risk: untrusted content is tainted, destructive actions with tainted inputs require approval, secrets never reach the model, tool manifests are pinned, and every decision is recorded. That makes attacks harder and visible, not impossible.

Which clients does it work with?

Any MCP client: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, ChatGPT connectors and local LLM hosts, over stdio or Streamable HTTP.

What does it cost?

Nothing. Mycel is open source under the Apache-2.0 license. Budgets in the config cap what your tools and models spend.

Grow the network.

Star the repo, open an issue, or write an adapter in 50 lines.

npx -y github:SpeakQuery/mycel init
View on GitHub