Skip to main content
Glama

docs-mcp-server

trpcService.ts1.38 kB
/** * Fastify service to register unified tRPC API at /api. * Merges pipeline and data store routers under a single endpoint. */ import { initTRPC } from "@trpc/server"; import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify"; import type { FastifyInstance } from "fastify"; import type { IPipeline } from "../pipeline/trpc/interfaces"; import { createPipelineRouter, type PipelineTrpcContext } from "../pipeline/trpc/router"; import type { IDocumentManagement } from "../store/trpc/interfaces"; import { createDataRouter, type DataTrpcContext } from "../store/trpc/router"; type UnifiedContext = PipelineTrpcContext & DataTrpcContext; export async function registerTrpcService( server: FastifyInstance, pipeline: IPipeline, docService: IDocumentManagement, ): Promise<void> { const t = initTRPC.context<UnifiedContext>().create(); // Define a single root-level health check to avoid duplicate keys from feature routers const healthRouter = t.router({ ping: t.procedure.query(async () => ({ status: "ok", ts: Date.now() })), }); const router = t.mergeRouters( healthRouter, createPipelineRouter(t), createDataRouter(t), ); await server.register(fastifyTRPCPlugin, { prefix: "/api", trpcOptions: { router, createContext: async (): Promise<UnifiedContext> => ({ pipeline, docService }), }, }); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arabold/docs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server