Getting Started
Installation
Install the adapter, confirm runtime support, and add optional Elysia integrations.
Requirements
- Elysia
>=1.4.0 - Node.js
>=20.11or Bun>=1.1 - TypeScript
>=5.8for TypeScript projects - Native ESM
Install the adapter
npm install @mwillbanks/elysia-mcp-adapter elysiaelysia 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/openapinpm install @elysiajs/bearernpm install @elysiajs/opentelemetryOpenAPI 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.