Elysia × Model Context Protocol
Elysia MCP Adapterelysia-mcp-adapterroutes become protocol

Your routes,protocol-ready.

Expose existing Elysia APIs as MCP tools without bypassing the framework behavior that makes them production-ready.

server.ts
import { mcp } from
  "@mwillbanks/elysia-mcp-adapter"
import { Elysia, t } from "elysia"

new Elysia()
  .use(mcp())
  .get("/users/:id",
    ({ params }) => params,
    {
      params: t.Object({
        id: t.String(),
      }),
      detail: {
        operationId: "users.get",
      },
    },
  )
  .listen(3000)

Elysia stays in control

Every route-backed call travels through Elysia parsing, validation, hooks, guards, and response mapping.

One protocol gateway

Turn HTTP routes into tools by default, then opt resources and prompts into the same focused registry.

Secure defaults

Origin checks, denied model headers, credential redaction, and binary limits ship as the baseline.

Choose your path

From first route to a deliberate MCP surface.

Start with automatic route tools, add protocol-native primitives, then narrow and harden the surface for production.