Elysia MCP Adapterelysia-mcp-adapter
Getting Started

Installation

Install the adapter, confirm runtime support, and add optional Elysia integrations.

Requirements

  • Elysia >=1.4.0
  • Node.js >=20.11 or Bun >=1.1
  • TypeScript >=5.8 for TypeScript projects
  • Native ESM

Install the adapter

npm install @mwillbanks/elysia-mcp-adapter elysia

elysia is a peer dependency. The adapter does not bring another application framework or a full MCP framework into your runtime.

Add the plugin

import { mcp } from '@mwillbanks/elysia-mcp-adapter'
import { Elysia } from 'elysia'

const app = new Elysia().use(mcp())

This installs three fluent methods and registers the MCP HTTP endpoint:

  • .mcpTool()
  • .mcpResource()
  • .mcpPrompt()

The default endpoint is /mcp.

Optional integrations

Install only the integrations your application uses:

npm install @elysia/openapi
npm install @elysiajs/bearer
npm install @elysiajs/opentelemetry

OpenAPI route metadata and schemas are reused by the adapter. Bearer authentication hooks and OpenTelemetry instrumentation remain part of the same Elysia lifecycle. See Route-backed Tools, Security, and Transportation for complete examples.

On this page