agentleFS
joeblackwaslikejoeblackwaslike/mcp-exec/AGENTS.md

mcp-exec

AGENTS.md1 starsChanged 6 months agoMITView on GitHub

Claude Code plugin + MCP server that proxies downstream MCP servers through a sandboxed execution layer, keeping intermediate results out of the context window. When working on or developing this plugin (modifying hooks, commands, skills, or plugin.json), load these before making any structural changes: Also consult docs/architecture/ for design context: TODO: [write docs/architecture/{files}.md and list each here with description after prd finalized] mcp-exec exposes two tools to Claude Code: - tools(query) — searches connected MCP servers, returns trimmed summaries -…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 1 is common, 1 is distinctive, and 3 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When working on or developing this plugin (modifying hooks, commands, skills, or plugin.json), load these before making any structural …

    line 7
  2. Very specific:

    Sandbox config: read sandbox block from ~/.claude/settings.json + .claude/settings.json, merge arrays, map to SandboxRuntimeConfig.

    line 64
  3. Very specific:

    MCP server hosts: read from .claude/mcp.json at startup.

    line 65
  4. Distinctive:

    No hosted/cloud product — local-first only

    line 92
  5. Common:

    No vendor lock-in or credential system assumptions

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

mcp-exec

Claude Code plugin + MCP server that proxies downstream MCP servers through a sandboxed execution layer, keeping intermediate results out of the context window.

Plugin Development

When working on or developing this plugin (modifying hooks, commands, skills, or plugin.json), load these before making any structural changes:

  • plugin-dev@claude-plugins-official — canonical directory layout, manifest spec, hook wiring format, command frontmatter rules
  • skill-creator@claude-plugins-official — skill description quality, progressive disclosure, trigger reliability, writing style

Also consult docs/architecture/ for design context:

TODO: [write docs/architecture/{files}.md and list each here with description after prd finalized]

Project overview

mcp-exec exposes two tools to Claude Code:

  • tools(query) — searches connected MCP servers, returns trimmed summaries
  • exec(code, runtime) — runs code in an OS-level sandbox, returns only final output

Goal: reduce per-workflow token consumption by 80–95% on multi-tool tasks.

Plugin structure

Distributed as a Claude Code plugin (plugin.json at root). Registers:

  • The mcp-exec MCP server (auto-added to user's MCP config on install)
  • Skills in skills/ (SKILL.md + SDK references + examples)
  • install-skill command for appending the skill loader to CLAUDE.md

Stack

  • TypeScript / Node.js
  • @anthropic-ai/sandbox-runtime (srt) for OS-level sandboxing
  • MCP SDK for server/client communication
  • uv for Python runtime (v0.3+)

File layout

src/
  server.ts              ← MCP server entry, registers tools/exec
  catalog/
    index.ts             ← lazy-loaded tool catalog, substring AND search
  sandbox/
    index.ts             ← exec({ runtime, code }) → ExecResult interface
    config.ts            ← reads CC settings.json files, maps to SandboxRuntimeConfig
    runtimes/
      node.ts
      bash.ts
      python.ts          ← v0.3+
skills/
  SKILL.md
  ts-sdk-reference.md
  py-sdk-reference.md    ← v0.3+
  examples/
docs/
  prds/

Key design decisions

  • Sandbox config: read sandbox block from ~/.claude/settings.json + .claude/settings.json, merge arrays, map to SandboxRuntimeConfig. ~30 lines. Do not replicate CC's full config parser.
  • MCP server hosts: read from .claude/mcp.json at startup; server hostnames merged into allowedDomains.
  • Sessions: implicit by default (shared within a conversation); explicit session_id only for parallel isolation. globalThis.* persistence is Node-only — Bash/Python are stateless.
  • Thenable chaining: exec() returns a real Promise<ExecResult> — standard .then(), no auto-piping. Agent uses execResult.stdout to thread raw output between runtimes explicitly.
  • Runtime param: string shorthand ("node", "bash", "python") or config object ({ type: "node", timeout?: number, env?: Record<string,string> }). Sandbox policy is global (settings.json only) — not per-call configurable.

Development milestones

  • v0.1: Node + Bash runtimes, hardcoded Gmail/GDrive shims, tools + exec, implicit sessions, thenable chaining, install-skill CLI
  • v0.2: Generic MCP shim generator, tools(query) with lazy catalog, ts-sdk-reference.md
  • v0.3: Python runtime via uv run --isolated, py-sdk-reference.md
  • v1.0: Token benchmark CI suite, state persistence, telemetry

Documentation

Full docs site at https://joeblackwaslike.github.io/mcp-exec/

  • Guide — Introduction, Installation, Getting Started, Configuration, CLI, Security
  • User Manual — tools(), exec(), Runtimes, Sessions, Examples
  • Developer — Architecture, Plugin Compatibility, Observability, Codex Sandboxing, Agent Plugin Setup
  • Reference — Competitive Analysis, Case Study, Projects Featured In, Changelog
  • Interactive visualization — open docs/how-it-works.html in a browser for the full system visualization

Local development: pnpm docs:dev (runs Docusaurus from website/)

Constraints

  • Zero changes to Claude Code itself — pure MCP config
  • No hosted/cloud product — local-first only
  • No vendor lock-in or credential system assumptions
  • Auth via env vars present in the shell environment (.env, direnv, secrets manager)

Skill activation triggers

using-mcp-exec

Activate when:

  • About to call 2+ MCP tools in sequence and intermediate results don't need to stay in context
  • A single MCP tool call would return large results (record lists, API responses, search results)
  • Multi-step research, data aggregation, or schema processing
  • Fanning out across multiple sources to return a single summary

mcp-exec-dev-workflow

Activate when:

  • Fetching API docs or exploring unfamiliar endpoints during active development
  • Processing large API responses or aggregating data in a dev research workflow
  • Even a single fetch returning 8,000+ tokens of docs — exec() can reduce it to a 200-token summary

Import syntax (inside exec)

import { toolName } from 'mcp/server-name';

Server names match keys in .claude/mcp.json or your Codex MCP config.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.