Repository navigation
A deployment can serve code.scip_ingest and code.scip_status over MCP, for its repositories only - #916
Merged
Conversation
…, for its repositories only MCP hides the two compiler-tier upload ops with the rest of the ingest surface: their callers post to /v1. A producer whose only route to the deployment is an MCP connection builds a compiler-tier index and cannot deliver it, since a call by tool name and one through loom_op both answer OP_NOT_ON_MCP. LOOM_MCP_CODE_UPLOAD_TOOLS takes the two ops off the hidden set. Both are then callable by tool name and through loom_op, and `all` lists them by its own rules. No curated roster names them, so the default listings keep their token ceilings, and the operation catalogue keeps describing the default. On MCP the upload is reached by every caller that may write some namespace, a memory namespace of its own included, and the handler took any namespace. With the setting on it accepts a part only for a namespace that has a repository entry and answers RESOURCE_NOT_FOUND for any other, as code.refresh does. With the setting off neither the listing nor the handler changes. Signed-off-by: pufit <[email protected]>
… named repository's upload lands No test failed if the predicate that takes code.scip_ingest and code.scip_status off the hidden set started to un-hide another op: every assertion named the two ops, and the test that every hidden op answers OP_NOT_ON_MCP runs with the setting off. The 503 the upload answers while the self-service registry is not read yet, when which namespaces have a repository entry is not known, had no test either. The MCP reference tells an uploader to send the namespace itself: a code tool's namespace that names a repository, and is not a namespace the caller can read, resolves to the index of the repository's default branch, and the upload lands there. The system overview said that MCP never calls a hidden op; it names the setting that serves the two. Signed-off-by: pufit <[email protected]>
Signed-off-by: pufit <[email protected]>
zlareb1
approved these changes
Nov 18, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
No findings in MCP visibility and routing, role and namespace authorization, repository-entry refusals, or the unchanged default catalogue. All 291 focused upload, transport, toolset and settings tests pass locally; the four generated-reference checks pass. Live database uploads were validated by CI rather than locally.
zlareb1
reviewed
Nov 18, 2026
Signed-off-by: pufit <[email protected]>
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
LOOM_MCP_CODE_UPLOAD_TOOLS=trueservescode.scip_ingestandcode.scip_statusover MCP, by tool name and throughloom_op, for an uploader that reaches Loom through MCP only. With it on,code.scip_ingestaccepts an upload only for a namespace that has a repository entry. Default off.Why
MCP hides
code.scip_ingestandcode.scip_statuswith the rest of the ingest surface. The callers they were written for post to/v1: a CI job, and the compiler-tier workers' own harness. A producer whose only route to the deployment is an MCP connection, such as a build environment behind an MCP gateway, builds a compiler-tier index and cannot deliver it: a directtools/callandloom_opboth answerOP_NOT_ON_MCP.LOOM_MCP_CODE_UPLOAD_TOOLStakes the two ops off the hidden set for the deployment that sets it. Both are then callable by tool name and throughloom_opon every toolset butassistant; onreadonly,loom_oproutes the status only, as it routes no write.alllists them by its existing rules (both arestable, and acode.*op needsLOOM_MCP_CODE_TOOLS=true),readonlythen listscode.scip_status, and no curated roster names either. A scripted uploader calls a tool by name, and a tool listed oncoreorcodingcosts tokens in every session.Serving the upload over MCP changes who reaches it. Hidden, it is reached by programs that post to
/v1. On MCP it is reached by every caller that holds the writer role on some namespace, and an agent holds that role on its own memory namespace. The handler takes any namespace its caller may write, the staging table keeps a part for seven days, and the apply worker reads a complete batch whole. So with the setting on, the handler accepts a part only for a namespace that has a repository entry, operator-configured or self-service, and answersRESOURCE_NOT_FOUNDfor any other, ascode.refreshanswers for a namespace that is not configured. With the setting off the handler makes no such check.The operation catalogue stays a registry fact.
ops.capabilities, the reach census and the generated operation tables report both ops as hidden whatever the setting, as they report thecode.*ops without readingLOOM_MCP_CODE_TOOLS. The MCP reference says what the setting serves.Alternatives and what each costs:
coreorcoding. An uploader needs a callable tool, not a listed one, and both listings have a token ceiling.Scope and risk
server/settings(one field, one clause in themcp_toolsetcomment),server/operations/toolsets.py(the two ops in their own set, one predicate, a keyword onlisted_under_all), the three MCP modules that tested the hidden set (mcp_op.py,mcp_call.py,mcp_tools.py),server/code/app/ingest.py(one check before any write), three documentation pages and the generated settings references.code.refresh; the curated rosters and their token ceilings; and what describes the default, which isops.capabilities,op_toolsets, the reach census, the action manifest and the mentor's notes.namespacesclaim is*holds the role it carries on every standard code namespace of its org. A grant row of its subject does not narrow it: the cap applies to a claim that names the namespace, never to*; anns_writeclaim and therestrictedclassification do narrow it. Such a token could already upload to each of them over HTTP, and the setting adds the MCP route. So a deployment that turns the setting on gives no agent a flat*token with the writer role, and gives its uploader a token that names the repository's namespace.LOOM_CODE_REPOS_JSONrestores its uploads.code.refreshand the code reads do. A self-service repository added on another replica is known withinLOOM_CODE_REPOS_REFRESH_SECONDS(30 by default), and until the registry's first read the op answers 503, as the other code ops do.namespacethat the caller cannot read and that names a repository (owner/name, or its name) resolves to that repository's code namespace, the default branch's when it has several, and the result says so (namespace_resolved). The upload is a code tool, so an uploader names the exact namespace.Compatibility, rollout and rollback
OP_NOT_ON_MCPover MCP, andcode.scip_ingestanswersRESOURCE_NOT_FOUND(404 over HTTP) for a namespace without a repository entry on every transport.LOOM_MCP_CODE_UPLOAD_TOOLS, defaultfalse, read at start. No default changes.code_scip_applyworker, whichLOOM_CODE_SCIP_APPLY_ENABLEDstarts, as before.OP_NOT_ON_MCPuntil they are replaced.Tests
tests/unit/test_mcp_code_upload_tools.py(new) calls the MCP endpoint with the real handlers and a store that keeps the parts in memory.loom_opanswerOP_NOT_ON_MCPfor both ops, and theloom_ophelp catalogue omits both.loom_opcomplete a batch, andcode.scip_statusreports it by either route.alllists both with the code tools and neither without,readonlylists the status only, andcore,coding,atomic,tasks,trackerandassistantlist neither.RESOURCE_NOT_FOUNDby either route and stores nothing.code.refresh, hidden beside them, still answersOP_NOT_ON_MCPby either route.ops.capabilitiesreports both ops as hidden with the setting on.tests/unit/test_code_scip_ingest.py: the handler takes a part for a namespace without an entry while the setting is off and refuses the next part once it is on; an operator entry and a self-service entry both take a part; with the setting on and the self-service registry not read yet, the op answers 503 and stores nothing.tests/unit/test_op_transport_contract.py: with the setting on, a viewer's upload over MCP answersAUTH_INSUFFICIENTand runs no handler, and a writer's upload and a viewer's status call reach their handlers.test_mcp_listing_budget.py,test_mcp_toolset.py,test_mcp_coding_toolset.py,test_mcp_assistant_toolset.py) also pass with the setting forced on, so listing the two tools underallbreaks no text rule or token ceiling.make lintandmake typecheckpass. The regenerated diff is the new setting inconfiguration.md,status.md,loom.example.yaml, the settings schema and the defaults snapshot, plus the rewordedmcp_toolsetdescription;docs/reference/operations.md,operations/code.md,errors.md, the reach manifest and the SDK tables are unchanged.ruff format --check, Biome, Prettier and Taplo pass over the tree.make format-checkitself did not start locally becauseshfmtis not installed there; the change has no shell file.pytest tests/unit -n autoran on macOS, where the suite is red with or without this change: the parse child's address-space limit is refused there, so the tests that parse source fail, and the localclickhousebinary rejects settings the SQL tests pass. With coverage it reported 1221 failed and 38677 passed; on the base commit, without coverage, 1223 failed and 38666 passed. No test fails only with this change, and the nine test ids it had at that point pass; the two added since pass in the focused runs.pytest bench -qpasses (251). CI's Linux run is the gate for the full suite.code.scip_ingestskips the new check.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: every place the MCP transport tests the hidden set (the listing, the direct call,
loom_op's routing, its help catalogue and its refusal); the three states through the MCP endpoint with the real handlers; that the catalogue and every generated operation table are unchanged; the regenerated diff, which holds the one setting and the rewordedmcp_toolsetdescription; each documentation sentence against the code path it names.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code