Repository navigation
security(mcp): per-tool read-only gate for MCP over HTTP - #1441
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
ajianaz
force-pushed
the
security/mcp-read-only-gate
branch
from
October 13, 2026 03:23
e85853b to
9c34916
Compare
This was referenced Oct 13, 2026
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.
What
Access { Full, ReadOnly }READ_ONLY_TOOLS: 22 read toolshandle_jsonrpc_as(uteke, raw, access)isError: trueand the textRead-only token cannot use <tool>. Nothing runs.POST /mcpis now registeredwrites: false.Access::ReadOnlyfor a read-only token andAccess::Fullotherwise.handle_jsonrpc) is still full access.docs/mcp.mdgains a "Read-only tokens" section,docs/configuration.mdis corrected, and there is a CHANGELOGSecurityentry.Why
Part of #1439: one behaviour on every surface. Before this change:
/mcpwas a write route, so a read-only token could not call any MCP tool, not even recall.docs/mcp.mdalready recommended a read-only token "for clients that only need to recall"./mcp, nothing inside MCP was gated.uteke-cloud already refuses destructive MCP tools for read-only keys and returns route refusals as MCP tool errors. This brings OSS in line.
Contract. This is additive for CORE:
writesis#[serde(skip)], sodocs/core-contract.jsonanddocs/api-reference.mdare byte-identical.Testing
cargo test -p uteke-mcp: 34 passed, including 7read_only_gate_testscargo test -p uteke-server: all suites pass, includingmcp_read_only_testsand the existingread_only_token_gets_403_on_exactly_the_writing_rowscargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo run -p docgen && git diff --exit-code docs/: no diffuteke_room_documentalias is read-only.uteke_stats.uteke_rememberwithisError, and nothing is stored.READ_ONLY_TOOLSentry to a registry row withwrites: false, in both directions./mcpcalling a write tool (it resolves toAccess::Full).tools/liststill lists every tool for read-only callers; filtering it is a possible follow-up.