Elysia MCP Adapter
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Elysia MCP Adapterget user with id user_123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mwillbanks/elysia-mcp-adapter turns eligible Elysia HTTP routes into MCP tools while preserving the request lifecycle you already rely on: parsing, validation, hooks, guards, authentication, error handling, and response mapping. It also provides thin APIs for standalone tools, resources, resource templates, and prompts.
Why this adapter?
Keep Elysia in charge. Route-backed calls run through
app.handle(new Request(...)); handlers are never invoked out of band.Reuse schemas. Existing TypeBox and route schemas are normalized to JSON Schema for MCP clients.
Secure by default. Origin checks are enabled, model-controlled headers are denied, credential-bearing response headers are redacted, and binary responses are disabled.
Stay protocol-focused. The package is ESM-only and does not introduce a second application framework or translate TypeBox to Zod.
Related MCP server: Hono MCP Server
Install
bun add @mwillbanks/elysia-mcp-adapter elysiaNode.js >=20.11, Bun >=1.1, Elysia >=1.4, and TypeScript >=5.8 are supported.
Quick start
import { mcp } from '@mwillbanks/elysia-mcp-adapter'
import { Elysia, t } from 'elysia'
const app = new Elysia()
.use(
mcp({
server: {
name: 'users-api',
version: '1.0.0'
}
})
)
.get(
'/users/:id',
({ params }) => ({ id: params.id }),
{
params: t.Object({ id: t.String() }),
detail: {
operationId: 'users.get',
summary: 'Get a user'
}
}
)
.listen(3000)The adapter exposes GET /users/:id as the users.get MCP tool at POST /mcp. Tool calls are converted to internal HTTP requests and sent back through Elysia:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "users.get",
"arguments": {
"params": { "id": "user_123" }
}
}
}Explicit MCP primitives
Install the plugin, then register MCP-only behavior alongside your HTTP routes:
const app = new Elysia()
.use(mcp({ allowedRoutes: [] }))
.mcpTool(
'math.add',
({ a, b }: { a: number; b: number }) => ({ sum: a + b }),
{
inputSchema: {
type: 'object',
properties: {
a: { type: 'number' },
b: { type: 'number' }
},
required: ['a', 'b'],
additionalProperties: false
}
}
)
.mcpResource('config://runtime', () => ({ environment: 'production' }))
.mcpPrompt(
'review-error',
({ message }: { message: string }) => `Review this error: ${message}`
)Routes become tools by default. Resources and prompts require explicit route metadata or the standalone methods above.
MCP extensions
Tasks, OAuth resource-server enforcement, enterprise authorization profiles, and Apps are opt-in:
app.use(
mcp({
transport: {
protocolVersions: ['2026-07-28', '2025-11-25']
},
extensions: {
tasks: {
version: 'current',
provider
},
auth: {
version: 'current',
resource: 'https://api.example.com/mcp',
authorizationServers: ['https://auth.example.com'],
verifyAccessToken
},
apps: {
version: 'current'
}
}
})
)Omitting an extension version selects current; draft and supported dated versions select immutable implementations recorded in the exported MCP_EXTENSION_SUPPORT manifest. Modern MCP 2026-07-28 uses per-request protocol metadata and server/discover, while legacy 2025-11-25 initialization remains supported. Tasks require modern MCP and a durable provider.
The repository includes tested, package-root examples for every extension:
Tasks uses SQLite subprocess workers and BullMQ with
ioredis-mock.Authorization uses Better Auth, Bun SQLite, OAuth Provider, and SAML SSO.
Apps vanilla and Apps React build one self-contained HTML document with Bun and no Vite or runtime assets.
Client support changes independently of this package. Consult the canonical MCP Extension Support Matrix.
Documentation
The full guides and API reference live at mwillbanks.github.io/elysia-mcp-adapter:
Development
bun link
bun install
bun run lint
bun run typecheck
bun test
bun run fallow
bun run buildDocumentation development runs independently from website/ with bun install and bun run dev.
License
MIT © Mike Willbanks
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA comprehensive ElysiaJS plugin for building Model Context Protocol (MCP) servers with HTTP transport, session management, and support for tools, resources, and prompts.6,35447MIT
- AlicenseNot gradedqualityDmaintenanceExposes Hono API endpoints as Model Context Protocol tools, allowing LLMs to interact with your API routes through a dedicated MCP endpoint. It provides helpers to describe routes and includes a codemode for dynamic API interaction via search and execute tools.3286MIT
- AlicenseNot gradedqualityDmaintenanceEnables creating high-performance MCP servers using Bun and Elysia, exposing resources, tools, and prompts to LLMs via SSE transport.38124MIT
- AlicenseNot gradedqualityDmaintenanceA minimal, general-purpose implementation of the Model Context Protocol (MCP) for Node.js and Bare runtime, enabling creation of AI-interactive servers with tools, resources, and multiple transport options.72MIT
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
A Model Context Protocol server for Wix AI tools
Hosted AgentLux MCP server for marketplace, identity, creator, services, and social flows.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/mwillbanks/elysia-mcp-adapter'
If you have feedback or need assistance with the MCP directory API, please join our Discord server