Repository navigation
feat(mcp): read takes uri for one file and uris for several - #6860
Merged
Merged
Conversation
read was the only MCP tool whose path parameter was plural, so agents guessed uri and failed. uri now takes one URI or a list; uris still works. Passing both, or no URI, returns INVALID_ARGUMENT naming the parameter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe uri as the single-file parameter and uris as the batch one, so agents still see that read can take several files in one call. Both names keep accepting a string or a list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MCP read tool now takes uri for one file and uris for several. The uri-guard deny message and the openviking-skills SKILL.md read a single file, so they show read(uri=...). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_portable_schema collapsed uri's union to an array, so clients that validate against the schema rejected read(uri=...). Pin it to a string; uris stays an array. The gateway notice shows uri targets, the ov-resources skill shows read(uri), and the rejection tests go through mcp.call_tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZaynJarvis
approved these changes
Nov 2, 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.
Description
readwas the only MCP tool whose path parameter was plural.ls,tree,download,write,edit,grep,glob,forget, the ACL tools and REST/api/v1/content/read?uri=all useuri, so agents guessuriand the call fails. In one user's Claude Code history, 25 of 394readcalls (about 6%) senturi. Several came right after auto-compaction removed the earlier correct calls from context.This follows the 2026-10-06 decision (智恒, 郑啸):
readtakesurifor one file andurisfor several, matching the other tools. The decision lists three places to change: the 火山-hosted Go MCP, the MCP docs and the Claude Code plugin. This PR covers the open-source Python MCP, the docs, the plugins and the gateway. The hosted Go MCP needs the same change separately.Human Involvement
Related Issue
None.
Type of Change
Changes Made
read(openviking/server/mcp_endpoint.py): newuriparameter for one file, whileurisstill reads several in one call. At runtime both accept a string or a list. Passing both, or no URI, returnsINVALID_ARGUMENTwith both forms in the message._portable_schemacollapses unions to their most general branch, which turneduriinto an array. Clients that validate against the schema (the pi plugin's Ajv, Gemini function calling) would then rejectread(uri="…"). A per-tool override now pinsread.urito{"type": "string"}, andurisstays an array.openviking_gateway/tool_catalog.py): the read notice usesurifirst, thenuris, so auricall still shows its target.06-mcp-integration.mdread row listsurifor one file andurisfor several.read(uri="…"). Edited inexamples/memory-plugin-shared/lib/uri-guard.mjsand regenerated withsync.mjs.openviking-skills/SKILL.mdcheck (9 copies, still identical) andagent-plugins/skills/ov-resources/SKILL.mdnow showread(uri).openviking_read) are unchanged.check-plugin-version-bumps.shpasses: Claude Code 0.7.21, Codex 0.11.19, agent-hook 0.5.30 (with host manifests), OpenCode 0.5.24, DSH 0.5.32, pi 0.4.27.Existing callers that send
uriskeep working unchanged.Testing
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
I have tested this on the following platforms:
tests/server/test_mcp_endpoint.py:urianduris, each as a string and as a list, throughmcp.call_tool.mcp.call_tooland assertisErrorwithINVALID_ARGUMENT.uriisstring,urisis anarrayof strings, and neither is required.main.tests/gateway/test_tools.py: auricall shows its target in the notice.Plugins:
uri-guard,codebuddyandmarketplacesuites pass, andcheck-plugin-version-bumps.shpasses.Checklist
Additional Notes
Release order: the plugins also run against the hosted Go MCP. Release these plugin versions only after the hosted Go MCP accepts
uri. Before then, an agent on the hosted service that copiesread(uri="…")from the hint would fail.🤖 Generated with Claude Code