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 58+ 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"
}
}
}
~/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: