GitHub Stars
28
User Rating
Not Rated
Favorites
0
Views
26
Forks
6
Issues
2
README
tRPC <-> MCP
Serve tRPC routes via MCP.
Usage
2. Add to meta
import { initTRPC } from '@trpc/server';
import { type McpMeta } from 'trpc-to-openapi';
const t = initTRPC.meta<McpMeta>().create();
3. Enable for routes
export const appRouter = t.router({
sayHello: t.procedure
.meta({ openapi: { enabled: true, description: 'Greet the user' } })
.input(z.object({ name: z.string() }))
.output(z.object({ greeting: z.string() }))
.query(({ input }) => {
return { greeting: `Hello ${input.name}!` };
});
});
4. Serve
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { createMcpServer } from 'trpc-mcp';
const mcpServer = createMcpServer(
{ name: 'trpc-mcp-example', version: '0.0.1' },
appRouter,
);
const transport = new StdioServerTransport();
await mcpServer.connect(transport);
Author Information
80
Followers
17
Repositories
0
Gists
0
Total Contributions
Related MCPs
kakao-api-mcp-server
14
The kakao-api-mcp-server is a TypeScript-based server that utilizes the Kakao API. It is designed with a rich set of features to facilitate efficient communication with the API, allowing developers to easily integrate Kakao's services. Notably, it enhances real-time data retrieval and user authentication features, with a strong focus on security.