Class: PermissionedServer
- Inherits:
-
MCP::Server
- Object
- MCP::Server
- PermissionedServer
- Defined in:
- app/mcp/permissioned_server.rb
Overview
MCP::Server that gates tools/call on service permissions, so a tool hidden
from tools/list can't just be invoked by name.
Why a subclass rather than overriding @handlers[TOOLS_CALL]: the gem does NOT
route tools/call through the handler hash — MCP::Server#handle_request has a
hard-coded when Methods::TOOLS_CALL then call_tool(...) branch, so a handler
override there silently no-ops and leaves every tool callable. Overriding the
(private) call_tool is what actually intercepts execution.
Instance Method Summary collapse
-
#initialize(tool_service_map:) ⇒ PermissionedServer
constructor
A new instance of PermissionedServer.
Constructor Details
#initialize(tool_service_map:) ⇒ PermissionedServer
Returns a new instance of PermissionedServer.
28 29 30 31 |
# File 'app/mcp/permissioned_server.rb', line 28 def initialize(tool_service_map:, **) @tool_service_map = tool_service_map super(**) end |