module Riffer::Mcp
Riffer::Mcp provides integration with Model Context Protocol (MCP) servers.
Register MCP servers globally; agents opt-in by tag via the use_mcp DSL. Tags are application-defined; see docs/14_MCP.md (Tags section).
Riffer::Mcp.register( name: "github", tags: [:github], endpoint: "https://mcp.github.com", discovery_headers: -> { {"Authorization" => "Bearer #{ENV['GITHUB_TOKEN']}"} } ) class MyAgent < Riffer::Agent model "openai/gpt-4o" use_mcp :github end
Public Class Methods
Source
# File lib/riffer/mcp.rb, line 36 def self.register(manifest_or_hash) Registry.register(manifest_or_hash) end
Registers an MCP server, blocking until tool discovery completes.
Raises on discovery failure. Pass a Manifest instance or a hash with the same keys.
Source
# File lib/riffer/mcp.rb, line 54 def self.registrations Registry.registrations end
Returns all current registrations keyed by name (for introspection).
Source
# File lib/riffer/mcp.rb, line 46 def self.unregister(name) Registry.unregister(name) end
Removes a registration by name.
Subsequent agent runs will not see tools from this server.