Discover MCPs & agents
Loading MCPs and agentsβ¦
Loading MCPs and agentsβ¦
π Generate executable TypeScript tools from MCP servers with 98% token savings. Progressive loading pattern for AI agents. Production-ready.
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
GitHub checked 0m ago
Turn any MCP server into a typed TypeScript SDK that a model programs against. Loops, joins and large results stay in code, and only the answer reaches the model's context.
[!TIP] Inspired by Anthropic's engineering blog post on Code Execution with MCP.
Calling MCP tools one at a time has costs besides loading tool definitions (which many hosts now defer on their own):
mcp-execution-cli generate introspects a server and writes one TypeScript file per tool, a type-only catalog.ts with one signature per tool, and a small runtime bridge. A model reads the signatures it needs, writes a script that calls the tools, and reads only what the script prints.
Only text a model reads costs context. Importing a module when a script runs puts nothing into the context.
| Task | Better choice |
|---|---|
| Single lookup, or one or two sequential calls | Direct tool call: nothing to combine |
| Small server catalog | Direct tool call: the definitions are cheap to hold |
| Many calls over a list, pagination, joins across tools | Script: the loop runs in code and one answer comes back |
| Large results that are filtered or aggregated before use | Script: the full result never enters the context |
Some hosts offer their own code execution mode for MCP tools. This project does not replace it: it produces the typed SDK (parameter and result types, a catalog and a bridge to the server) that a script, run by any means you have, imports. The generated files run with plain Node.js; no host feature is required.
mcp-execution-cli stats <server-id> prints, from a generated directory, the size in bytes and the estimated tokens (bytes divided by 4, always labelled an estimate) of each level a model can read: the server's own definitions as recorded at generation, all tool files, one tool file and catalog.ts. For the in-repo fixture server (9 tools):
| Level | Bytes | Tokens (estimate) |
|---|---|---|
| server definitions (recorded) | 1898 | 475 |
| all tool files | 5250 | 1313 |
| one tool file (mean) | 583 | 146 |
catalog.ts | 1899 | 475 |
These are sizes of text a model reads if it reads that level in full. They do not show that a model did, they are not real token counts, and a host that already defers tool definitions starts from a lower baseline.
The scenario harness (crates/mcp-cli/tests/context_cost_harness.rs, offline, part of cargo nextest run --all-features -p mcp-execution-cli) compares the bytes that reach the context when K calls are made one call per shell command and when one run script makes them, against the same fixture. With a fixed script, the single script is the smaller of the two from K = 5 (for K = 1, 2 and 3 one call per command is smaller; at K = 10 it is 680 against 348 bytes, at K = 20 it is 1380 against 438). The figures prove only these scenarios. They do not prove more than that: the script is fixed, not written by a model, so the cost of writing it is not counted; the server is the in-repo fixture only; tokens are an estimate (bytes/4), not a real count; turn overhead and prompt caching are not modelled.
cargo install mcp-execution-cli
The install uses the Cargo.lock shipped with the release, so dependency fixes arrive with a new release.
Download from GitHub Releases:
# macOS (Apple Silicon)
curl -L https://github.com/bug-ops/mcp-execution/releases/latest/download/mcp-execution-cli-macos-arm64.tar.gz | tar xz
# macOS (Intel)
curl -L https://github.com/bug-ops/mcp-execution/releases/latest/download/mcp-execution-cli-macos-amd64.tar.gz | tar xz
# Linux (x86_64)
curl -L https://github.com/bug-ops/mcp-execution/releases/latest/download/mcp-execution-cli-linux-amd64.tar.gz | tar xz
# Linux (ARM64)
curl -L https://github.com/bug-ops/mcp-execution/releases/latest/download/mcp-execution-cli-linux-arm64.tar.gz | tar xz
# Windows (x86_64 or ARM64)
# Download mcp-execution-cli-windows-amd64.zip or
# mcp-execution-cli-windows-arm64.zip from the releases page
git clone https://github.com/bug-ops/mcp-execution
cd mcp-execution
cargo install --path crates/mcp-cli
Add individual crates to your project:
cargo add mcp-execution-core # Foundation types
cargo add mcp-execution-introspector # MCP server analysis
cargo add mcp-execution-codegen # TypeScript generation
cargo add mcp-execution-files # Virtual filesystem
cargo add mcp-execution-skill # SKILL.md generation
[!IMPORTANT] Requires Rust 1.100 or later for building from source.
# 1. Configure MCP server in ~/.claude/mcp.json
# 2. Generate tools
mcp-execution-cli generate --from-config github
# Output: ~/.claude/servers/github/
# - createIssue.ts
# - updateIssue.ts
# - ... (one file per tool)
# Read the compact signatures of every tool
cat ~/.claude/servers/github/catalog.ts
# Read one tool in full (types and JSDoc)
cat ~/.claude/servers/github/createIssue.ts
catalog.ts is the cheap level to read first: one type-only signature per tool. Open a tool file only for a tool you need in full.
# Write ~/.claude/skills/github/SKILL.md from the generated package
mcp-execution-cli skill --server github
# Also insert the catalog each time the skill is loaded (default: --catalog static)
mcp-execution-cli skill --server github --catalog at-load --overwrite
Text reported by the server stays data in the generated skill: nothing in it runs, is substituted or attaches a file when a host loads it. A server id or skill name containing --- is refused.
With --catalog at-load the skill asks the host to run mcp-execution-cli catalog --server=github on load and pre-approves exactly that command. The output is escaped and bounded, and a long catalog is cut between entries. The mcp-execution-cli on the host's PATH must be a version that has the catalog command: with an older install the command fails and the skill does not load. The option cannot be combined with --servers-dir. A host that refuses the command refuses to load the skill.
# The tool name and an optional JSON object follow `--`
mcp-execution-cli call --from-config github -- create_issue '{"owner":"myorg","repo":"myrepo","title":"Bug"}'
call accepts the same server flags as generate (--from-config, --http, --sse or a command) and prints the result as one compact JSON line within the output budget. An empty success prints nothing. A tool error exits 3, a non-object or malformed JSON argument exits 2 without echoing it.
A generated tool file also runs directly with Node.js, one JSON object as the argument:
node ~/.claude/servers/github/createIssue.ts '{"owner":"myorg","repo":"myrepo","title":"Bug"}'
Outside run this starts a hidden mcp-execution-cli helper process. The binary is $MCP_EXECUTION_CLI when set, otherwise mcp-execution-cli on PATH; a set but unusable MCP_EXECUTION_CLI is an error and never falls back to PATH.
[!NOTE] Generated files are TypeScript that Node.js runs directly. This needs Node.js 22.18.0 or newer (on the 23 line, 23.6.0 or newer), or Bun or Deno (see Supported Runtimes);
mcp-execution-cli setupchecks for one, and reports whether the helper binary is found.
For many calls, a join or a large result, write one script and run it. A script imports servers as mcp:<server-id>:
// ~/scripts/open-issues.mts (adapt the result handling to the types in catalog.ts)
import { listIssues } from 'mcp:github';
const { items } = await listIssues({ owner: 'myorg', repo: 'myrepo', state: 'open' });
console.log(items.map((issue) => `#${issue.number} ${issue.title}`).join('\n'));
mcp-execution-cli run ~/scripts/open-issues.mts
Keep scripts outside ~/.claude/servers/<id>/: generate replaces that directory on every run. run - reads the script from stdin and arguments after -- go to the script.
What run prints:
[mcp-execution <token>] run started; the same token marks every line the runner adds, so text printed by the script cannot pass for it.--max-output bytes (default 16384) and its stderr at --max-stderr bytes (default 4096). The remainder is saved to a private file under the per-user state directory and a notice names it.[mcp-execution <token>] script_status exit 0 (or exit N, signal N, timed out).completed calls may have changed state.--timeout is 1 to 600 seconds (default 60). --format json prints one envelope with the same fields.Exit codes: 0 success, 1 other error, 2 invalid input, 3 server or tool error, 4 timeout, 5 a check found problems (drift, scripts check), 6 the script itself exited non-zero or was killed by a signal.
Optional checks and limits:
| Flag | Effect |
|---|---|
--typecheck | Runs tsc --noEmit first and exits 2 before node starts on a type error. Skipped with a note, and the script runs, when tsc is missing, when Node type definitions are not installed, or when the dependencies of the generated SDK are not installed (run npm install in the server directory to enable the check). Real type errors in your script still exit 2. |
--dry-run | Executes only the tools listed under reads in the policy file and skips every other call, rejecting it with write_skipped; the report lists the skipped writes and says the result is incomplete. |
--policy FILE | Policy file for --dry-run: JSON {"version":1,"reads":["github/list_issues"]}. Default: mcp-execution/policy.json in the per-user config directory. The default policy is empty, so every call counts as a write. |
--restrict | Limits file reads to the script, the servers directory and the run directory, and grants no file writes, child processes or workers. Network access is narrowed only on Node.js 25 and later. On Windows the flag needs Node.js below 25 (exit 2 otherwise), so network access is not narrowed there. |
--save NAME | Saves the script as a named recipe after it exits 0 (see below). --overwrite replaces an existing recipe. |
[!WARNING]
runis not a sandbox. The script runs with your user privileges, so read a script before running it and never run one that came from tool output. The journal,--dry-runand--restrictare diagnostics and a narrowing, not a security boundary. A script cannot read its own stdin underrun; a raw read of file descriptor 0 breaks the run. Child processes a script starts can outlive the run.
A script that worked can be kept with the skill of its server. It starts with a header block (JSON in a comment) that is read without running anything:
/*! mcp-script
{"v":1,"name":"open-issues","description":"List open issues of a repository","parameters":[],"tools":["github/list_issues"],"writes":"read_only"}
*/
import { listIssues } from 'mcp:github';
// ...
# Save after a successful run: ~/.claude/skills/github/scripts/open-issues.ts
mcp-execution-cli run ~/scripts/open-issues.mts --save open-issues
# List saved scripts by signature (no bodies), then check them against the live tool list
mcp-execution-cli scripts list --server github
mcp-execution-cli scripts check --server github
scripts check exits 5 when a saved script references a tool the server no longer has or is invalid (its name, its header or the file itself; --format json gives each one a reason of invalid_name, invalid_header or unreadable), and changes nothing. generate and skill never touch the scripts/ directory, and no command runs a saved script on its own. A skill holds at most 50 scripts of up to 64 KiB each.
# Compare the live tool list with the metadata recorded at generation (writes nothing)
mcp-execution-cli drift --from-config github
Exit 0: no drift. Exit 5: the tool list or endpoint differs from the recorded one. When the server was generated under another name or into another directory, pass the same --name and --servers-dir you gave generate.
| Runtime | Generated tool files (<runtime> <tool>.ts '<json>') | run, --typecheck, --restrict |
|---|---|---|
| Node.js 22.18+ (on the 23 line, 23.6+) | Supported | Supported; on 22.18 name a script with a top-level for await .mts |
| Bun | Supported (tested with bun <tool>.ts '<json>') | Not supported: run starts Node.js |
| Deno | Supported (tested with deno run -A <tool>.ts '<json>') | Not supported: run starts Node.js |
The Bun and Deno rows are exercised by acceptance_runtime_compat against the fixture server; CI fails when either runtime is missing from its job because it sets MCP_EXECUTION_REQUIRE_ALT_RUNTIMES=1. Without that variable the tests skip a missing runtime.
setup accepts a suitable Node.js. Without one it runs a one-line .ts file with Bun, then Deno, and reports the first that works together with a caveat: run, --typecheck and --restrict still need Node.js. With --format json the result names it in runtime (name, version) and carries caveat (null for Node.js).
npx tsx <tool>.ts '<json>'; run, typecheck and --restrict still need Node.js 22.18 or newer.| Feature | Description |
|---|---|
| Typed SDK | TypeScript parameter and result types converted from MCP JSON schemas |
| Compact Catalog | catalog.ts lists one type-only signature per tool |
| One-Shot Calls | call runs one tool of any stdio, HTTP or SSE server and prints a bounded result |
| Script Runner | run executes a script with bounded output, a journal, optional type check, dry run and --restrict |
| Saved Scripts | run --save, scripts list and scripts check keep and verify working scripts per skill |
| Measured Cost | stats prints bytes and estimated tokens per level; drift compares the live tool list with generation |
| Direct Execution | Each generated tool file runs with Node.js and takes one JSON argument |
| Any MCP Server | stdio, HTTP and SSE servers via the rmcp SDK |
| Crate | Description |
|---|---|
| mcp-execution-core | Foundation types, traits, and error handling |
| mcp-execution-introspector | MCP server analysis using rmcp SDK |
| mcp-execution-codegen | TypeScript SDK generation from MCP tool definitions |
| mcp-execution-files | Virtual filesystem for code organization |
| mcp-execution-skill | SKILL.md generation for Claude Code |
| mcp-execution-server | MCP server exposing SDK generation |
| mcp-execution-cli | Command-line interface |
Dependency Graph:
mcp-execution-cli β {mcp-execution-codegen, mcp-execution-introspector, mcp-execution-files, mcp-execution-core, mcp-execution-skill}
mcp-execution-server β {mcp-execution-codegen, mcp-execution-introspector, mcp-execution-files, mcp-execution-core, mcp-execution-skill}
mcp-execution-codegen β {mcp-execution-introspector, mcp-execution-core}
mcp-execution-files β {mcp-execution-codegen, mcp-execution-core}
mcp-execution-introspector β {rmcp, mcp-execution-core}
mcp-execution-skill β mcp-execution-core
See mcp-cli README for full reference.
# Generate TypeScript tools from config (recommended)
mcp-execution-cli generate --from-config github
# Preview what would be generated without writing to disk
mcp-execution-cli generate --from-config github --dry-run
# Call one tool, run a script, inspect saved scripts
mcp-execution-cli call --from-config github -- list_issues '{"state":"open"}'
mcp-execution-cli run script.mts
mcp-execution-cli scripts list --server github
# Context cost of a generated server, and drift against the live server
mcp-execution-cli stats github
mcp-execution-cli drift --from-config github
# Introspect MCP server from config
mcp-execution-cli introspect --from-config github
# Introspect with detailed schemas
mcp-execution-cli introspect --from-config github --detailed
# Manual configuration (alternative)
mcp-execution-cli introspect docker --arg=run --arg=-i --env=TOKEN=xxx
# Shell completions
mcp-execution-cli completions bash
[!TIP] Use
--from-configto load server settings from~/.claude/mcp.jsoninstead of manual arguments.
Regenerate every server directory when upgrading to 1.0, because the generated bridge and the _meta.json schema changed in 0.x releases and older output no longer parses or runs. Within 1.x the _meta.json and helper protocol versions do not change; they change only in a major release.
mcp-execution-cli generate --from-config <SERVER>
Breaking changes to act on when coming from 0.x:
_meta.json is at schema version 3, and the bridge is a thin client of the mcp-execution-cli helper. A tool file run directly with node needs a matching mcp-execution-cli (MCP_EXECUTION_CLI or PATH). closeAllConnections, the bridge's SIGINT/SIGTERM handlers and MCPBRIDGE_REQUEST_TIMEOUT_MS are removed.generate and introspect accept exactly one of --from-config, a positional command, or --http/--sse. call takes the tool after --. Exit code 6 means a script run by run failed. The --progressive-output flag of generate and drift is now --servers-dir. The JSON result of setup replaces node_version with runtime and caveat.Identifier_Status=Allowed characters, so a server exposing a tool named with a space or @/+/(/&/</> fails introspection instead of being accepted. The server_id of the MCP tools must be 1-64 lowercase letters, digits or hyphens; any other value is a tool result with isError: true. Windows reserved device names (con, prn, aux, nul, com0-com9, lpt0-lpt9) are not valid server directory names on any platform: --name con is rejected, and a name derived from a command or URL gets -server appended. In any letter case, these names also give a generated tool file and its export a _2-style suffix, and are rejected as saved script names (--save).jiff::Timestamp instead of chrono::DateTime<Utc>, and serialized fractions of a second drop trailing zeros. GenerateSkillResult::server_description holds a validated SkillDescription, and a custom servers directory is serialized as servers_dir, also in the generate_skill result.mcp-execution-runtime package was removed in v0.9.0; use the TypeScript bridge written by mcp-execution-cli generate.The complete list is in the ### Breaking section of each release in the changelog.
Generation and export timings come from the Criterion benchmarks; reproduce them with:
cargo bench --profile bench-fast -p mcp-execution-codegen -p mcp-execution-files
mcp-execution-cli skill)cargo build --workspace # Build
cargo nextest run --workspace # Test
cargo clippy --workspace # Lint
cargo +nightly fmt --workspace # Format
[!NOTE] All development follows Microsoft Rust Guidelines.
Minimum Supported Rust Version: 1.100
MSRV = stable minus two, raised in a minor release.
1.100 is a one-time exception to this rule, taken so that cargo honours registry.global-min-publish-age, the dependency cooldown in .cargo/config.toml. The exception ends once stable minus two reaches 1.100 (when Rust 1.102 is stable); the normal rule applies again from then.
Licensed under either of Apache License 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you shall be dual-licensed as above, without any additional terms or conditions.
Loading reviews...
GitHub checked 0m ago. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.