Repository navigation
Guard tools on the official MCP SDK and ActionMCP - #39
Merged
Merged
Conversation
The resolver needs what identifies the human (server context, token, session). That must not land in an append-only ledger, so it travels as request:, apart from metadata:, and is cleared when the call ends.
Records no session id: on some transports the id alone resumes a session, and the ledger is append-only.
Under the testing kit, or a host wrapping Reeve.invoke around the call, the wrapper opened a second envelope with no principal, so the call was refused and recorded twice.
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.
Changes
Reeve now guards tools on two more MCP libraries: the official Ruby SDK and ActionMCP. Each is opt-in with one require. Once required, every tool of that library is denied, allowed, scoped and recorded the same way fast-mcp tools already are, and an unguarded tool is refused under the default setting. Nothing changes for a host that requires neither.
On both libraries Reeve allows or refuses a tool's output as a whole rather than narrowing it, because these tools return finished responses instead of records. The README says so, along with the one weakness of that check and how a tool author closes it.
What identifies the user (a server context, a token, a session) can now reach the principal resolver without ever being written to the ledger.
The testing kit, matchers and compliance suite now work unchanged on tools from all three libraries.
Testing
Full suite green at every commit on SQLite and on PostgreSQL at the tip, rubocop clean, adapter tests pass on the oldest and newest supported versions of both libraries, and the built gem contains the new adapter files.