Streamable MCP Server
A Model Context Protocol server exposing tools (echo, add, get-time) and a resource over the Streamable HTTP transport, with session management and Docker support.
README
Streamable MCP Server
A Model Context Protocol server written in TypeScript, exposed over the Streamable HTTP transport (the modern replacement for the older HTTP+SSE transport).
Features
- Streamable HTTP transport at
POST/GET/DELETE /mcp, with per-session state (via themcp-session-idheader) - Example tools:
echo,add,get-time - Example resource:
info://server GET /healthzfor container/orchestrator health checks- Multi-stage, non-root Dockerfile
Project layout
src/
server.ts # McpServer factory: tools & resources are registered here
index.ts # Express app wiring the Streamable HTTP transport + session management
Local development
npm install
npm run dev # tsx watch, restarts on change
Or build and run compiled JS:
npm run build
npm start
The server listens on http://localhost:3000/mcp by default (override with PORT).
Trying it with curl
Initialize a session (note the mcp-session-id response header, needed for follow-up requests):
curl -i -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl-test","version":"1.0"}}}'
Then, using the returned session id:
SESSION=<mcp-session-id from above>
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: $SESSION" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: $SESSION" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"add","arguments":{"a":21,"b":21}}}'
Docker
Build the image:
docker build -t streamable-mcp-server .
Run it:
docker run -d -p 3000:3000 --name mcp-server streamable-mcp-server
Check health:
curl http://localhost:3000/healthz
Adding your own tools
Add new server.registerTool(...) calls in src/server.ts. Each new session gets a freshly created McpServer, so any per-session state should live inside the factory function's closure or be looked up externally (e.g. a database) rather than stored in module-level globals.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.