MCP cover image
See in Github
2025-02-07

Serve tRPC routes as an MCP server

1

Github Watches

2

Github Forks

11

Github Stars

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);

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • https://jgadvisorycpa.com
  • This GPT assists in finding a top-rated business CPA - local or virtual. We account for their qualifications, experience, testimonials and reviews. Business operators provide a short description of your business, services wanted, and city or state.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • OffchainLabs
  • Go implementation of Ethereum proof of stake

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • modelcontextprotocol
  • Model Context Protocol Servers

  • Mintplex-Labs
  • The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

    Reviews

    3 (1)
    Avatar
    user_MoKCyTVO
    2025-04-17

    As a dedicated user of trpc-mcp, I must say this tool is exceptional. Created by Jacse, this GitHub-hosted project offers a seamless and efficient way to develop and manage RPC endpoints. Its integration and ease of use have significantly enhanced my workflow. Highly recommended for any developer looking for a reliable RPC solution!