agentleFS
LeostrukaLeostruka/devin-bundle/skills/mcp-governance/SKILL.md

mcp-governance

Skill0 starsChanged 3 months agoMITView on GitHub

Use when considering adding an MCP server, when context feels bloated with tool definitions, when auditing which servers consume the most context budget, before committing mcp_config.json changes, or when deciding which servers to keep active per task. Estimates per-server tool-definition token cost and guides lazy enablement.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every MCP server injects all its tool definitions into the system prompt of every conversation — even when unused.

    line 9
  2. Distinctive:

    Default state: minimal or zero MCP servers.

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

MCP Governance

Every MCP server injects all its tool definitions into the system prompt of every conversation — even when unused. Two "plug-and-play" servers can eat a third of a 200k window before the first user message. Audit before adding; keep only what earns its tokens.

Principle: MCP servers should be active only when a task needs them. Default state: minimal or zero MCP servers. Enable on demand; disable when done.

Rule of thumb: tool count per server under 10-15 keeps tool-selection accuracy above 90% (arXiv:2606.30317). A 5-tool server with huge descriptions can still cost more than a 15-tool terse one — measure token cost, not just count.

Audit workflow

  1. List configured servers: python3 "{{APPDATA}}/devin/skills/mcp-governance/scripts/mcp-context-audit.py" --config mcp_config.json Reports transport, command/url, static bloat risk. No tool calls made.
  2. Measure real tool counts: mcp_list_tools server_name="<srv>", then pipe the tool list to the estimator: python3 ".../scripts/mcp-context-audit.py" --tools tools_<srv>.json Estimates token cost (chars/4) and flags >10-15 tools.
  3. Decide:

    SignalAction
    Server unused in N sessionsRemove from mcp_config.json
    Tool count > 15Prefer narrower server or scope tools
    Token cost > 5% of windowJustify with concrete usage; else remove
    Untrusted serverReview code/permissions first; sandbox
  4. Verify after removal: re-run step 1; confirm budget dropped (context-budget.py --full).

Lazy enablement workflow

  1. Classify each server:

    ClassificationCriteriaAction
    Always-onUsed in >50% of sessions, cost <3% of windowKeep
    On-demandSpecific task types (Jira, database, deploy)Enable only for those tasks
    Rarely used<10% of sessionsRemove; re-add when needed
    Never usedConfigured but never invokedRemove immediately
  2. Disable temporarily: move the server entry from mcp_config.json to mcp_config.disabled.json, restart session; move back when needed.
  3. Plugin installs: devin plugins info <name> shows which MCP servers a plugin provides — factor that cost into keeping the plugin.
  4. Verify savings: re-run context-budget.py --full.

Decision heuristic: task starts → needs MCP tools? NO → minimal servers active. YES → enable only what's needed → audit cost → work → disable.

Anti-patterns

  • Keeping all servers always-on "just in case" — the #1 cause of MCP bloat.
  • Auditing once and never again — servers grow tools over time.
  • Adding servers without measuring before/after.
  • Trusting tool count alone — check token cost.
  • Skipping the trust review — MCP servers run with user permissions; evaluate architecture patterns/anti-patterns before adding.
  • Treating MCP config as immutable — it's a living config.

Source

Tool-count accuracy threshold: arXiv:2606.30317. Context tax framing: Matt Pocock, "Context Windows Explained for Coding Agents".

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.