MCP Server

Use Stockyard as an MCP backend for AI-powered editors and tools.

What is MCP?

The Model Context Protocol (MCP) is an open protocol that lets AI-powered tools connect to external services. Stockyard implements the MCP SSE transport, so any MCP-compatible client — Claude Desktop, Cursor, Windsurf, Cline — can use Stockyard as their LLM backend.

Every request through MCP passes through Stockyard’s full middleware chain: tracing, cost tracking, guardrails, audit logs, caching, and all 76 proxy modules.

Endpoints

Stockyard exposes two MCP endpoints:

GET  /mcp/sse       — SSE connection (client subscribes here)
POST /mcp/message   — Message endpoint (client sends JSON-RPC here)

Available Tools

The MCP server exposes a single chat tool that accepts:

{
  "model": "gpt-4o",
  "messages": [{"role": "user", "content": "Hello"}],
  "temperature": 0.7,
  "max_tokens": 1000
}

The tool routes the request through all configured middleware modules and returns the LLM response.

Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "stockyard": {
      "url": "https://your-stockyard-instance.com/mcp/sse",
      "transport": "sse"
    }
  }
}
Config location: On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %APPDATA%\Claude\claude_desktop_config.json.

Cursor

Create .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "stockyard": {
      "url": "https://your-stockyard-instance.com/mcp/sse",
      "transport": "sse"
    }
  }
}

Windsurf

In Windsurf settings, add the MCP server:

{
  "mcpServers": {
    "stockyard": {
      "serverUrl": "https://your-stockyard-instance.com/mcp/sse"
    }
  }
}

Editor-Specific Guides

For detailed setup instructions for each editor, see:

Compare Stockyard

vs LiteLLM · vs Helicone · vs Portkey · Pricing · Blog

Explore: Proxy-only mode · Self-hosted proxy · OpenAI-compatible
Why route AI editors through a proxy

AI-powered editors like Cursor, Windsurf, and Claude Desktop send LLM requests directly to providers. This works until you need cost tracking across editors, guardrails that apply regardless of which tool made the request, or an audit trail of every prompt your team sends. Stockyard's MCP server sits between the editor and the provider, applying the same middleware chain to editor traffic that it applies to application traffic. Cache hits from one editor benefit all editors. Guardrails block the same patterns everywhere. Cost tracking aggregates spend from every source into a single dashboard.

The setup requires adding a single JSON block to your editor's MCP configuration — the Stockyard URL and transport type. From that point, every request from the editor flows through Stockyard's middleware. The editor does not know or care that a proxy exists. It sends requests to the MCP endpoint, and Stockyard forwards them to the configured provider after applying caching, guardrails, cost tracking, and any other active middleware modules.