module Riffer::Mcp
Integration with Model Context Protocol (MCP) servers. Register servers globally; agents opt-in by tag via the use_mcp DSL. Tags are application-defined; see docs/14_MCP.md.
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 Instance Methods
Source
# File lib/riffer/mcp.rb, line 34 def register(manifest_or_hash) Registry.register(manifest_or_hash) end
Registers an MCP server, blocking until tool discovery completes. Raises on discovery failure.
Source
# File lib/riffer/mcp.rb, line 49 def registrations Registry.registrations end
Returns all current registrations keyed by name.
Source
# File lib/riffer/mcp.rb, line 41 def unregister(name) Registry.unregister(name) end
Removes a registration by name; subsequent agent runs wonβt see its tools.