Implements an MCP server using Express.js as the HTTP framework for handling MCP JSON-RPC requests and responses, with support for Streamable HTTP transport.
Built with TypeScript to provide type safety throughout the MCP server implementation, enhancing code quality and developer experience.
Express MCP Server
A stateless Model Context Protocol (MCP) server built with Express and TypeScript.
Features
Stateless MCP server implementation with modern Streamable HTTP transport
TypeScript for type safety
Express.js for HTTP handling
Related MCP server: OpenAPI MCP Server
Requirements
Node.js 18+
npm or yarn
Installation
Development
Server Structure
Available Functionality
This server implements a simple echo endpoint with three MCP components:
Resource:
echo://{message}- Returns the message as a resourceTool:
echo- Echoes the provided message back as a tool responsePrompt:
echo- Creates a user prompt with the provided message
MCP Protocol
This server implements the Model Context Protocol (MCP), a standardized way for LLMs to interact with external data and functionality. It exposes a stateless API endpoint that responds to JSON-RPC requests.
API Usage
Send a POST request to /mcp with a JSON-RPC payload: