Class: BundleUp::Unify::MCP
- Inherits:
-
Object
- Object
- BundleUp::Unify::MCP
- Defined in:
- lib/bundleup/unify/mcp.rb
Overview
The Unified MCP server.
Same protocol and headers as Proxy MCP, but the tools are BundleUp's normalized ones rather than the provider's. Tools only — Unified MCP exposes no resources or prompts.
The server is stateless and POST-only, so there is no session to close.
Constant Summary collapse
- BASE_URL =
'https://unify.bundleup.io/v1/mcp'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#connection_id ⇒ Object
readonly
Returns the value of attribute connection_id.
Instance Method Summary collapse
-
#call_tool(name, args = {}) ⇒ Object
Call a unified tool with optional arguments.
-
#hosted ⇒ Object
The URL and a single bearer token carrying both the API key and the connection, for model-hosted MCP clients that cannot set headers.
-
#initialize(api_key, connection_id) ⇒ MCP
constructor
A new instance of MCP.
-
#list_tools ⇒ Object
List the available unified tools.
Constructor Details
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/bundleup/unify/mcp.rb', line 15 def api_key @api_key end |
#connection_id ⇒ Object (readonly)
Returns the value of attribute connection_id.
15 16 17 |
# File 'lib/bundleup/unify/mcp.rb', line 15 def connection_id @connection_id end |
Instance Method Details
#call_tool(name, args = {}) ⇒ Object
Call a unified tool with optional arguments.
37 38 39 40 41 |
# File 'lib/bundleup/unify/mcp.rb', line 37 def call_tool(name, args = {}) raise ArgumentError, 'Tool name is required to call a tool.' if name.nil? || name.to_s.empty? @client.call_tool(name, args) end |
#hosted ⇒ Object
The URL and a single bearer token carrying both the API key and the connection, for model-hosted MCP clients that cannot set headers.
25 26 27 28 29 |
# File 'lib/bundleup/unify/mcp.rb', line 25 def hosted separator = ::BundleUp::MCP::CREDENTIAL_SEPARATOR { url: BASE_URL, token: "#{@api_key}#{separator}#{@connection_id}" } end |
#list_tools ⇒ Object
List the available unified tools.
32 33 34 |
# File 'lib/bundleup/unify/mcp.rb', line 32 def list_tools @client.list_tools end |