Repository navigation
insights: the scan reads MCP servers built into a person's own repos - #18
Merged
Merged
Conversation
… you wrote" even when Claude Code never connects to them
The row read only stdio servers whose script sits in a plugin folder of theirs, from Claude Code's configs. A product
that holds a JSON-RPC MCP endpoint an external client calls (a route under /mcp, a controller answering tools/list and
tools/call, a runbook, tests) read "none of yours": no config names it and no mcp__ tool call ever will.
The anatomy inventory now reads such servers from the repo's files (collect_mcp_built -> anatomy.json mcp_built):
an MCP SDK dependency in package.json, composer.json, pyproject, requirements, go.mod, Cargo.toml or a Gemfile; a code
file named mcp (or inside a folder named mcp) that answers tools/call or tools/list or builds a server with an SDK; an
HTTP route registered under /mcp; a doc named mcp that calls it an MCP server; a test named mcp that posts those methods.
Two kinds at least, one of them code, never a name alone; whose it is by one git log over the evidence files (the
manifests left out), the artifacts' majority rule. Candidate files are kept by name during the walk, capped, and read
under an 8 s budget per target (about 0.1 s on a laptop with a few repos).
board.r_mcp_write lists them beside the plugin-folder servers with their own wording ("1 MCP server built into your
product (<repo>: /mcp/<route>); Claude Code never called it"), 0 calls, state built, the evidence paths on the list
entry; "What you've built" shows such an entry in the list rather than folding it as unused. Unit tests next to each
module (test_mcp_built, test_board_mcp_write, test_view_built). The version is left for the release.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
AlexJov996
force-pushed
the
insights-mcp-built
branch
from
November 12, 2026 11:51
b0d9f40 to
9826b5e
Compare
…until it is decided The row "MCP servers you wrote" feeds the level: a server listed there makes "MCP servers and tools you built" read as yours, which can lift a laptop from L1 to L2 and add "could be L3" or "could be L4". Whether a server built into a product, which an outside client calls and Claude Code never does, belongs in that row is a question for an issue. The board, the Built tab and their tests are back as on main. Kept: the scan reads such servers from the repo's files into anatomy.json (mcp_built), with its tests.
The new scan step judged a server's files by a majority rule of its own. ownership.py is the one place every part of the scan asks, and it knows more than a majority: an install receipt, or a committed copy of someone else's file (a server copied from an upstream clone on the same laptop reads installed, not theirs). classify_origin now takes the server's files together, the commits that touched any of them, as a skill folder is judged by every commit on the folder. A test builds the copied server.
…do not crowd out the repo's own files A program that calls someone else's MCP server read as one built: the SDKs ship client and server in one package, and a client sends "tools/call" too. A handler now has to answer the method (a case, a comparison or a key it dispatches on) or build the server side of an SDK, and a dependency counts as serving code only beside a route under /mcp. On a real laptop, a hand-written client of another product's server stopped reading as a server; the servers built there stayed. The candidate files are capped per kind in walk order, so a vendor folder holding an MCP package could fill the cap before the repo's own handler was seen. Vendored and example paths are now left out when the files are noted, a cap that is reached is noted in could_not_read, and the 8 s for reading candidates is shared by every target (as git's budget is), not given to each. Tests: a client in TypeScript and in Python, and a vendor folder larger than the cap.
The test file's docstring no longer points at whose laptop it was and says the rules the tests now hold, its run line works under python3 -I, one route file sits in a made-up module folder, and a cap's comment says what the cap is for instead of one repo's count.
…git budget is spent Run to its end on a real laptop, the scan had spent its 40 s of per-file git history before it reached MCP servers, so no server's commits were read and ownership.py read every one as theirs, a clone of someone else's server included. The lookup is one git log per server found, so it now runs outside that budget. A test spends the budget first.
Every file and folder the walk meets was split at its capitals to look for "mcp" as a word. A plain substring test now comes first. On a real laptop (20 folders) the walk with this step took 13.1 s against 12.5 s without it (medians of six warm runs), and reading the candidates 0.3 s.
…another repo Run to its end on a real laptop, the file inventory stopped with a KeyError: one codebase sat in three checkouts, and ownership.py's copy rule asked git about the other checkouts. classify_origin kept the last of those answers as the file's own, and with the per-file budget spent that answer held no commits. It now keeps the answer about the file it was asked about. And since nothing reads the list of servers yet, a failure while reading one is noted in could_not_read instead of ending the scan. A test builds the two checkouts with the budget spent.
Member
|
Thank you for this one too, and for leaving the version alone. You found a real blind spot: an MCP server built into someone's own product never showed up, because the tool only looked inside their plugins. Your scan part is in, and your commit stays exactly as you pushed it. We added a few commits on your branch:
We took the counting out for now and opened an issue (#24). It can move a level, so it needs a decision first. Your code for it stays in your commit. It ships in the next release, with credit in the release notes. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before and after: The "MCP servers you wrote" row counted only stdio servers whose script sits in a plugin folder of yours, read from Claude Code's configs. An MCP server built into your own product (a JSON-RPC endpoint under
/mcpthat answerstools/listandtools/call, with a runbook and tests, called by an external client) read "none of yours", since no Claude Code config names it and nomcp__tool call ever will. Now the scan reads such servers from the repo's files and the row says "1 MCP server built into your product (shop: /mcp/notes); Claude Code never called it", state built, 0 calls, with the evidence files listed; the Built tab lists it instead of folding it as unused.How a server is read (
collect_mcp_builtin the anatomy inventory,anatomy.jsonmcp_built): five kinds of signal, from file contents, never a name alone: an MCP SDK dependency in package.json, composer.json, pyproject, requirements, go.mod, Cargo.toml or a Gemfile; a code file named mcp (or under a folder named mcp) that answerstools/call/tools/listor builds a server with an SDK; an HTTP route registered under/mcp; a doc named mcp that calls it an MCP server; a test named mcp that posts those methods. Two kinds at least, one of them code. Whose it is: onegit logover the evidence files per repo, the artifacts' majority rule, manifests left out. Vendor, fixture and plugin folders are skipped. Candidates are kept by name during the walk, capped, and read under an 8 s budget per target.Test: from
plugins/insights/scripts,cd setup-snapshot/experiments/2026-10-27-anatomy && python3 -m unittest test_mcp_built(temp git repos: a composer.json or package.json MCP dependency plus an Mcp controller handlingtools/callreads as the person's server; a folder merely named mcp does not; one signal is not enough; a teammate's server is not theirs; vendor copies are not read),cd v15/engine && python3 -m unittest test_board_mcp_write, andcd v15/engine/variants/views && python3 -m unittest test_view_built test_view_mylevel. All green on top of main. Two code-only runs on a laptop with such a product listed its server in the row with its route and evidence paths.CHANGELOG.md,marketplace.jsonorkit.json.