Module: McpToolkit

Defined in:
lib/mcp_toolkit.rb,
lib/mcp_toolkit/version.rb,
sig/mcp_toolkit.rbs

Overview

The toolkit for building account-scoped, read-only MCP servers on top of the official mcp gem. See README.md for the satellite + authority quickstarts.

Entry points:

McpToolkit.configure { |c| ... }  # set up the server
McpToolkit.config                 # the active Configuration
McpToolkit.registry               # the active config's resource registry

MCPToolkit is provided as an alias for the same module.

Defined Under Namespace

Modules: Filtering, Server, TokenKinds Classes: Configuration, Engine, Error, FieldSelection, GetExecutor, ListExecutor, Registry, Resource, ResourceSchema, Serialization, ServerController, Session, SqlSanitizer, UnknownResourceMessage

Constant Summary collapse

VERSION =

Returns:

  • (String)
"0.3.0"

Class Method Summary collapse

Class Method Details

.configObject

The active Configuration (created on first access).



94
95
96
# File 'lib/mcp_toolkit.rb', line 94

def self.config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields the active configuration for mutation, returning it.

McpToolkit.configure do |c|
c.server_name = "my-app-mcp"
c.central_app_url = ENV.fetch("MCP_CENTRAL_APP_URL")
c.registry.default_required_permissions_scope "my_app__read"
end

Yields:



88
89
90
91
# File 'lib/mcp_toolkit.rb', line 88

def self.configure
  yield(config) if block_given?
  config
end

.registryObject

The active config's resource registry. Register resources against this in a boot initializer.



100
101
102
# File 'lib/mcp_toolkit.rb', line 100

def self.registry
  config.registry
end

.reset_config!Object

Replaces the active configuration with a fresh default. Primarily for tests.



105
106
107
# File 'lib/mcp_toolkit.rb', line 105

def self.reset_config!
  @config = Configuration.new
end