A Model Context Protocol (MCP) server implementation, enabling server-sent events (SSE) based communication.
Example MCP SSE Server provides a Model Context Protocol implementation that allows for real-time communication using Server-Sent Events (SSE). It's designed to work with applications and provides a standardized way of managing and communicating with models and resources.
- Model Context Protocol (MCP) implementation
- Server-Sent Events (SSE) for real-time communication
- Resource templating and management
- Node.js (v14 or higher recommended)
- Yarn package manager (can be changed easily)
Clone the repository and install dependencies:
git clone git@github.com:yunusemredilber/express-mcp-sse-server.git
cd express-mcp-sse-server
yarn installTo start the server in development mode:
yarn devThis will run the server with the MCP inspector for debugging.
To start the server in production mode:
yarn startBy default, the server runs on port 3001. You can override this by setting the PORT environment variable:
PORT=5000 yarn start/sse- SSE endpoint for establishing persistent connections/messages- Endpoint for sending messages to the MCP server
src/index.ts- Main entry point of the applicationsrc/mcp-server.ts- Implementation of the MCP server and resource definitionssrc/sse-server.ts- SSE server implementation using Express
- @modelcontextprotocol/sdk - SDK for Model Context Protocol
- Express - Web framework for Node.js
