improving-mcp-tools
Skill727 starsChanged yesterdayMITView on GitHub
Run an improve-my-MCP campaign: an autoresearch-style loop that measures the MCP agent experience with a supplied eval harness, picks the highest-impact tool problem from production data, makes one bounded fix, and keeps it only if before/after scores improve. Use when asked to "improve my MCP", run an MCP improvement campaign, fix tool discoverability or descriptions based on evidence, or prepare an eval-backed PR for a tool change. Every shipped change must carry eval evidence; guardrails below are hard rules.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Before starting a campaign, obtain a benchmark and runnable harness from the operator.
- Distinctive: line 27
If those inputs are unavailable, report the missing evidence and stop the campaign.
- Distinctive: line 31
Use it for description/discoverability changes, since probes cannot detect that an agent picks the wrong tool.
- Distinctive: line 33
Run the supplied harness against a seeded local or devbox stack.
- Distinctive: line 34
Use the same benchmark version for baseline and after scores.
- Very specific: line 38
Measure: Run the harness for a baseline.
- Distinctive: line 47
Fix, bounded: Only files inside the allowlist (below).
- Distinctive: line 76
Evidence or it didn't happen: No PR without a baseline score, an after score, and the exact harness commands used.
- Very specific: line 78
Benchmark integrity: Never edit the supplied benchmark in the same PR as a fix it validates — changing the exam and the answer together …
- Distinctive: line 84
Kill switch: If the campaign config, its feature flag, or the operator says stop — stop mid-iteration, journal state, end cleanly.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Improving MCP tools
An MCP server gets better only in ways you can measure. This skill is the campaign procedure: score the current agent experience, fix the biggest problem, re-score, and only ship changes the numbers justify. It is the operating manual for the "improve my MCP" loop — one iteration per pass, journaled so a later iteration (or a different agent) can resume without repeating work.
The objective function
This repository does not include an MCP benchmark or eval runner. Before starting a campaign, obtain a benchmark and runnable harness from the operator. Record the task set, expected tools, success criteria, benchmark version, and exact commands in the journal. If those inputs are unavailable, report the missing evidence and stop the campaign.
- Probe mode (deterministic, no LLM): measures tool-presence misses, probe failures, and latency p50/p95.
- Agent mode (LLM replay + judge): scores task success and tool-selection accuracy. Use it for description/discoverability changes, since probes cannot detect that an agent picks the wrong tool.
Run the supplied harness against a seeded local or devbox stack. Use the same benchmark version for baseline and after scores.
One iteration
- Measure. Run the harness for a baseline. Pull production evidence with
the MCP analytics tools (
query-mcp-tool-stats,query-mcp-tool-failures,query-mcp-tool-descriptions,query-mcp-tool-sample-intents) and the lenses in the signals scout cookbook (products/signals/skills/signals-scout-mcp-tool-calls/references/queries.md): failure leaderboard, retry/struggle, latency, intents that matched no tool. - Pick one issue. Rank by reach × severity. Skip anything the journal shows with two failed attempts. One issue per iteration — a PR that fixes three things can't be attributed to any of them when scores move.
- Fix, bounded. Only files inside the allowlist (below). Typical fixes: sharpen a tool description so the right intent finds it, tighten an input schema that agents keep getting wrong, fix an annotation, update a skill.
- Validate. Re-run the affected benchmark slice plus a no-regression sample. Keep the change only if the target metric improves and nothing else degrades. A discarded change is a normal outcome — journal it and move on.
- Ship. One PR per iteration with before/after scores in the body (format
in references/campaign-journal.md). Keep
it stampable: ≤400 changed lines, only files inside the allowlist below,
request a stamphog review (MCP first, label fallback, see
/merging-prs). Autonomy level comes from the campaign config — default is draft PR for human review; only arm auto-merge when the operator has explicitly enabled the self-driving experiment (see guardrails). - Journal. Append the iteration record before ending the pass.
Hard guardrails
These are not suggestions; violating any of them ends the campaign pass.
- Allowlist — a campaign PR may only touch:
products/*/mcp/tools.yaml,products/*/skills/**, the codegen outputs ofpnpm generate-tools/scaffold-yaml(services/mcp/src/tools/generated/**andservices/mcp/schema/generated-tool-definitions.json), and docs. Anything else (handler code, package manifests, workflows, migrations, auth paths) → stop and hand the finding to a human as a draft PR or report instead. - Read-only against data. The harness and all production queries are read-only. Never create, mutate, or delete customer-visible objects while measuring.
- Evidence or it didn't happen. No PR without a baseline score, an after score, and the exact harness commands used.
- Benchmark integrity. Never edit the supplied benchmark in the same PR as
a fix it validates — changing the exam and the answer together proves
nothing. Benchmark changes are their own PR and bump
version. - Budgets. Respect the operator's iteration/token/PR caps (default: stop after 3 open unmerged campaign PRs). Two failed attempts on an issue parks it permanently.
- Kill switch. If the campaign config, its feature flag, or the operator says stop — stop mid-iteration, journal state, end cleanly.
Failure modes to expect
- A description change that helps one intent can steal traffic from the right
tool for another — that's why the no-regression sample is mandatory. The
intent-cluster snapshot's
tool_overlaps(seeexploring-mcp-intent-clusters) lists exactly which pairs compete for which intents: snapshot it before a description rewrite and recompute after, and treat a capture shift in an overlapping pair as the regression signal. - Probe latency varies with stack warmth; compare medians across ≥3 runs before attributing a latency change to your fix.
- Tool-presence misses can be feature-flag gating, not catalog absence —
check
getToolsForFeaturesgating before "fixing" discoverability.
Other versions1 project uses a version of this.
Word for word · 1
- PostHog/posthog★ 40k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- hog/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adding-today-highlightsSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-llm-gateway-paritySkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- building-product-empty-statesSkill
- building-the-toolbarSkill
- clickhouse-migrationsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- django-migrationsSkill
- django-startup-timeSkill
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- formatting-slack-messagesSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- implementing-mcp-ui-appsSkill
- implementing-warehouse-sourcesSkill
- improving-drf-endpointsSkill
- ingestion-pipeline-doctor-nodejsSkill
- instrumenting-first-party-metricsSkill
- The first 60 shown.
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
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.

