mcp-sse
2
The project is an MCP Server implementation using TypeScript and Server-Sent Events for real-time communication. It features bearer token authentication to ensure secure interactions. The server supports modular tool registration and execution, demonstrated through simple mathematical operations.
Overview
This project is an implementation of an MCP Server (Model Context Protocol) built in TypeScript, utilizing Server-Sent Events (SSE) for real-time message transport and authentication via Bearer Token.
Key Features
- SSE Transport: Real-time remote connection using Server-Sent Events.
- Bearer Authentication: Security verification through a token provided in the
Authorization
header. - Example Tools: Four simple tools performing basic mathematical operations, showcasing the tool registration and execution structure within the MCP Server.
- Modular Structure: Separation of responsibilities according to SOLID and Clean Code principles.
- Development with ts-node: Direct execution of TypeScript files without pre-compilation, ideal for development and debugging.
Requirements
- Node.js (version 20 or greater)
- npm
- TypeScript
- ts-node (for development)
Installation and Configuration
- Clone the repository and navigate to the directory.
- Install dependencies using npm.
- Configure authentication token using a
.env
file.
Execution
- Development: Use
npm run dev
to execute without pre-compilation. - Production: Compile with
npm run build
and execute withnode dist/index.js
.