Overview
tRPC <-> MCP is a tool that allows you to serve tRPC routes as an MCP (Model Context Protocol) server, enabling seamless integration between tRPC and MCP.
To use tRPC <-> MCP, you need to initialize it in your TypeScript project, define your routes, and then serve them using the MCP server.
- Easy integration of tRPC routes with MCP. - Supports TypeScript for type safety. - Allows for custom metadata in routes.
- Building APIs that require both tRPC and MCP functionalities.
- Creating server applications that need to handle complex data interactions.
- Enabling real-time communication between different services using MCP.
Add to your AI client
Use these steps to connect tRPC <-> MCP in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"trpc-mcp-jacse": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"trpc-mcp-jacse": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"trpc-mcp-jacse": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"trpc-mcp-jacse": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"trpc-mcp-jacse": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"trpc-mcp-jacse": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-trpc-mcp-jacse"
]
}
}
}