Runs the MCP server and tests with Bun runtime, with specific requirements for Bun version 1.0.0 or higher
Provides Git commit message generation with conventional commits support through prompt templates
Built with TypeScript for type safety, requiring TypeScript 5.0.0 or higher
Uses Zod for schema validation in tools, resources, and prompts, enabling type-safe parameter validation
Elysia MCP Plugin
A comprehensive ElysiaJS plugin for implementing Model Context Protocol (MCP) servers with HTTP transport support.
Features
- HTTP Transport: Full HTTP-based MCP transport with Streamable HTTP
- Session Management: Stateful session handling via headers
- Type-Safe: Built with TypeScript and Zod validation
- Easy Integration: Simple plugin architecture for Elysia apps
- Comprehensive Support: Tools, Resources, Prompts, and Logging
- Error Handling: Proper JSON-RPC 2.0 error responses
- Testing: Full unit test coverage with Bun test runner
Installation
Starter Template
To quickly get started with a pre-configured Elysia MCP project, you can use our starter template:
The elysia-mcp-starter template includes:
- Pre-configured Elysia setup with MCP plugin
- TypeScript configuration
- Development scripts
- Basic project structure
- Example MCP server implementation
Quick Start
Usage
Running the Examples
Basic Example:
Multiple Servers Example:
This example demonstrates how to create multiple MCP plugins in a single Elysia application:
- Math Operations Plugin (
/math
) - Basic arithmetic tools:add
- Add two numbersmultiply
- Multiply two numberspower
- Calculate base to the power of exponent
- Text Utilities Plugin (
/text
) - Text processing tools:uppercase
- Convert text to uppercaseword_count
- Count words in textreverse
- Reverse text charactersreplace
- Replace text with global matching
Testing with MCP Inspector
- Install MCP Inspector:
- Connect to your server:
- Basic Example:
http://localhost:3000/mcp
- Multiple Servers Example:
- Math Plugin:
http://localhost:3000/math
- Text Plugin:
http://localhost:3000/text
- Math Plugin:
- Basic Example:
Configuration Options
serverInfo
: Server informationcapabilities
: MCP capabilities to advertiseenableLogging
: Enable debug logging (default: false)setupServer
: Callback to register tools, resources, and prompts
Session Management
The plugin automatically handles session management via the Mcp-Session-Id
header. Each session maintains its own state and can be terminated cleanly.
Modular Handler Architecture
The plugin supports a modular handler architecture that allows you to create specialized endpoints for different MCP capabilities:
API Reference
Tools
Register tools using the MCP Server instance:
Resources
Register resources for file or data access:
Prompts
Register reusable prompt templates following MCP best practices:
Testing
Run the comprehensive test suite:
License
MIT - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Related
Plugin Configuration
Plugin Options
Architecture
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A comprehensive ElysiaJS plugin for building Model Context Protocol (MCP) servers with HTTP transport, session management, and support for tools, resources, and prompts.
Related MCP Servers
- -securityFlicense-qualityThis server provides a standardized framework using the Model Context Protocol (MCP) to seamlessly integrate and manage diverse tools, enabling features like Twitter automation, cryptocurrency updates, and ElizaOS interaction.Last updated -2Python
- -securityFlicense-qualityA TypeScript framework for building Model Context Protocol (MCP) servers with automatic discovery and loading of tools, resources, and prompts.Last updated -67TypeScript
- -securityFlicense-qualityA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated -1TypeScriptMIT License
- -securityAlicense-qualityA TypeScript framework for building MCP servers with client session management capabilities, supporting tools definition, authentication, image content, logging, and error handling.Last updated -6,371TypeScriptMIT License