trpc-mcp logo

trpc-mcp

by Jacse

Serves tRPC routes via MCP. It allows you to expose your tRPC API through the Model Context Protocol.

View on GitHub

Last updated: N/A

What is trpc-mcp?

trpc-mcp is a library that enables serving tRPC routes via the Model Context Protocol (MCP). This allows you to expose your tRPC API through MCP.

How to use trpc-mcp?

To use trpc-mcp, you need to initialize tRPC with McpMeta, enable OpenAPI metadata for your routes, and then create and connect an MCP server using the createMcpServer function and StdioServerTransport.

Key features of trpc-mcp

  • Serving tRPC routes via MCP

  • OpenAPI metadata support

  • Easy integration with tRPC

  • Integration with Model Context Protocol

Use cases of trpc-mcp

  • Exposing tRPC APIs through MCP

  • Integrating tRPC with systems that use MCP

  • Building microservices with tRPC and MCP

  • Creating a unified API interface using tRPC and MCP

FAQ from trpc-mcp

What is tRPC?

tRPC is a TypeScript library that allows you to build end-to-end type-safe APIs.

What is MCP?

MCP stands for Model Context Protocol, a protocol for communication between different parts of a system.

How do I enable OpenAPI metadata for my routes?

You can enable OpenAPI metadata by adding a meta property to your tRPC procedures with the openapi: { enabled: true } option.

What is StdioServerTransport?

StdioServerTransport is a transport mechanism provided by @modelcontextprotocol/sdk/server/stdio.js for communicating with the MCP server.

Can I use a different transport mechanism?

The documentation only mentions StdioServerTransport. Other transports might be possible depending on the MCP SDK.