T
ToolRelay
MCP integration

Turn any API into an MCP-ready tool

ToolRelay's MCP mode exposes every tool you create as an MCP-compatible JSON endpoint. AI agents can discover the schema, call the tool with structured arguments, and receive a wrapped response — with auth, plan limits, and usage logging handled for you.

How a ToolRelay tool maps to MCP

Endpoint URLs

Each tool you create exposes both an MCP endpoint and a raw HTTP proxy. They share the same auth, plan limits, and usage log writes — they only differ in response shape.

MCP endpoint
Raw HTTP proxy

GET — tool metadata

GET /api/mcp/[slug] returns the tool's discovery payload. Agents can use this to populate their tool registry.

{
  "name": "private-pro-test",
  "description": "Example ToolRelay tool",
  "input_schema": { ... },
  "output_example": { ... },
  "method": "POST",
  "endpoint": "https://www.toolrelay.online/api/mcp/private-pro-test",
  "run_endpoint": "https://www.toolrelay.online/api/run/private-pro-test",
  "security": "x-toolrelay-key required"
}

POST — call the tool

POST /api/mcp/[slug] accepts a JSON body with an arguments object. ToolRelay forwards the arguments to your upstream endpoint and returns the response wrapped in MCP-style content.

Private tool example
curl -i -X POST "https://www.toolrelay.online/api/mcp/private-pro-test" \
  -H "Content-Type: application/json" \
  -H "x-toolrelay-key: trk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{"arguments":{"message":"hello from an agent"}}'
Public tool example
curl -i -X POST "https://www.toolrelay.online/api/mcp/your-public-slug" \
  -H "Content-Type: application/json" \
  -d '{"arguments":{"message":"hello"}}'
Wrapped response
{
  "content": [
    { "type": "text", "text": "{\"echoed\":\"hello from an agent\"}" }
  ],
  "upstream_status": 200
}

JSON config example

Drop this into an MCP client / agent config to register the tool by URL.

{
  "name": "private-pro-test",
  "description": "Example ToolRelay tool",
  "endpoint": "https://www.toolrelay.online/api/mcp/private-pro-test",
  "method": "POST",
  "security": "x-toolrelay-key required",
  "headers": {
    "x-toolrelay-key": "trk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "input_schema": {
    "type": "object",
    "properties": {
      "message": {
        "type": "string"
      }
    },
    "required": [
      "message"
    ]
  }
}

Security notes

Known limitation

This is an MCP-ready JSON interface MVP. Full MCP protocol transports (SSE / stdio) and capability negotiation will land in a follow-up. Agents that can call HTTP JSON endpoints with custom headers can use ToolRelay tools today.

Create your first MCP tool