mcp_authorization v0.7.1

Configuration

Two configuration methods (not attributes) turn a domain into grouped facades โ€” see Tool grouping:

# config/initializers/mcp_authorization.rb
McpAuthorization.configure do |config|
  config.server_name    = "my-app"
  config.server_version = "1.0.0"

  # Build a context from each MCP request.
  # Return anything that responds to .current_user.can?(symbol).
  config.context_builder = ->(request) {
    user = User.authenticate(request.headers["Authorization"])
    OpenStruct.new(current_user: user)
  }
end

Options๐Ÿ”—

OptionDefaultDescription
server_name"mcp-authorization"Name in MCP handshake
server_version"1.0.0"Version in MCP handshake
mount_path"/mcp"URL prefix for MCP endpoints
default_domain"default"Domain when no :domain segment in path
tool_paths["app/mcp"]Directories where tool classes live (relative to Rails.root)
tool_producers[]Callables that register tool classes built at runtime โ€” see Generated tools
shared_type_paths["sig/shared"]Directories where shared .rbs type files live
context_builderrequired(request) -> context
cli_context_buildernil(domain:, role:) -> context for rake tasks
strict_schemafalseEmit stricter compiled schemas
tools_list_cachenil:memory, :redis, or any object responding to get/set โ€” see Caching tools/list
tools_list_cache_ttl3600Per-entry TTL in seconds
tools_list_cache_redisnilExplicit Redis client for the :redis store
tools_list_cache_redis_urlnilExplicit Redis URL; falls back to ENV["REDIS_URL"], then Redis.new

Two configuration methods (not attributes) turn a domain into grouped facades โ€” see Tool grouping:

MethodPurpose
facet_domain :domain, group_by: :category, ...Present this domain as one facade tool per category. Optional schema_strategy:, uncategorized:, facade_suffix:.
categories { summary :key, "text" }Declare one summary line per group, used as each facade description's lead.

Collected from README.md in the repository. Edit it there, not here.