MCP Streamable HTTP Server
A dual-runtime template for building Model Context Protocol servers compatible with Node.js and Cloudflare Workers. It features integrated OAuth, encrypted token storage, and multi-tenant session management to simplify the creation of secure tool, re
What is MCP Streamable HTTP Server?
MCP Streamable HTTP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to dual-runtime template for building model context protocol servers compatible with node.js and cloudflare workers. it features integrated oauth, encrypted token storage, and multi-tenant session manage...
A dual-runtime template for building Model Context Protocol servers compatible with Node.js and Cloudflare Workers. It features integrated OAuth, encrypted token storage, and multi-tenant session management to simplify the creation of secure tool, re
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A dual-runtime template for building Model Context Protocol
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-streamable-http-server-templateConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Streamable HTTP Server
MCP Streamable HTTP Server Template is a production-ready boilerplate for building Model Context Protocol servers that run on both Node.js and Cloudflare Workers. It comes with integrated OAuth 2.1 PKCE authentication, AES-256-GCM encrypted token storage, multi-tenant session management, and five configurable auth strategies out of the box. Developers building MCP tools for distribution or enterprise use can use this template to skip the infrastructure boilerplate and focus on implementing their actual tool logic.
Prerequisites
- Node.js 18+ and Bun runtime installed (for Node.js deployment)
- Wrangler CLI installed for Cloudflare Workers deployment ('npm install -g wrangler')
- A Cloudflare account (for Workers deployment)
- An OAuth provider or API key for your chosen auth strategy
- An MCP-compatible client such as Claude Desktop or Cursor
Clone the template repository
Clone the template and install dependencies with Bun. The template supports both Node.js and Cloudflare Workers from the same codebase.
git clone https://github.com/iceener/streamable-mcp-server-template
cd streamable-mcp-server-template
bun installSet up environment variables
Copy the example env file and configure your auth strategy. Generate an encryption key for token storage.
cp .env.example .env
# Generate encryption key:
openssl rand -base64 32 | tr -d '=' | tr '+/' '-_'Configure your auth strategy in .env
Set AUTH_STRATEGY to one of: oauth, bearer, api_key, custom, or none. Add the corresponding credentials. For bearer auth, just set BEARER_TOKEN. For OAuth, set PROVIDER_CLIENT_ID, PROVIDER_CLIENT_SECRET, and PROVIDER_ACCOUNTS_URL.
AUTH_STRATEGY=bearer
BEARER_TOKEN=your-static-token
RS_TOKENS_ENC_KEY=your-generated-encryption-keyRun the development server locally
Start the Node.js development server. It will be available at localhost:3000/mcp and a health check endpoint at localhost:3001.
bun devDeploy to Cloudflare Workers (optional)
For Workers deployment, create a KV namespace for session storage, then set secrets and deploy.
wrangler kv:namespace create TOKENS
wrangler secret put PROVIDER_CLIENT_ID
wrangler secret put PROVIDER_CLIENT_SECRET
wrangler secret put RS_TOKENS_ENC_KEY
wrangler deployAdd your custom tools
Define tools using the defineTool() function with a Zod schema for inputs. Register them in the sharedTools array. The template includes health check and echo tools as examples to follow.
Connect your MCP client to the server
Configure your MCP client to connect to the local or deployed server endpoint at /mcp. For local development, use http://localhost:3000/mcp.
MCP Streamable HTTP Server Examples
Client configuration
MCP client configuration connecting to a locally running streamable HTTP server. For a deployed Cloudflare Worker, replace the URL with your worker's domain.
{
"mcpServers": {
"my-mcp-server": {
"type": "http",
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer your-static-token"
}
}
}
}Prompts to try
Example prompts once your custom tools are built and the server is running.
- "Check the health of the MCP server and show me the status."
- "Echo back the message 'hello from Claude' using the echo tool."
- "List all available tools on this server and describe what each one does."Troubleshooting MCP Streamable HTTP Server
Wrangler deploy fails with 'KV namespace not found'
Run 'wrangler kv:namespace create TOKENS' first and update your wrangler.toml with the returned namespace ID before deploying.
Token encryption fails at startup with an error about RS_TOKENS_ENC_KEY
The encryption key must be a URL-safe base64 string. Generate it correctly with: openssl rand -base64 32 | tr -d '=' | tr '+/' '-_'. Ensure no trailing newlines are included when setting the value.
MCP client cannot connect to the server with 'Connection refused'
Verify the server is running with 'bun dev' and that the port (3000) is not in use. For Cloudflare Workers in local mode, use 'wrangler dev' instead and connect to localhost:8787/mcp.
Frequently Asked Questions about MCP Streamable HTTP Server
What is MCP Streamable HTTP Server?
MCP Streamable HTTP Server is a Model Context Protocol (MCP) server that dual-runtime template for building model context protocol servers compatible with node.js and cloudflare workers. it features integrated oauth, encrypted token storage, and multi-tenant session management to simplify the creation of secure tool, re It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Streamable HTTP Server?
Follow the installation instructions on the MCP Streamable HTTP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Streamable HTTP Server?
MCP Streamable HTTP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Streamable HTTP Server free to use?
Yes, MCP Streamable HTTP Server is open source and available under the ISC License license. You can use it freely in both personal and commercial projects.
MCP Streamable HTTP Server Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCP Streamable HTTP Server? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Streamable HTTP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Streamable HTTP Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.