MCP Streamable HTTP Server

v1.0.0Developer Toolsstable

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

mcp-streamable-http-server-templatemcpai-integration
Share:
129
Stars
0
Downloads
0
Weekly
0/5

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

Build MCP servers with dual Node.js and Cloudflare Workers runtime.
Implement OAuth authentication with encrypted token storage.
iceener

Maintainer

LicenseISC License
Languagetypescript
Versionv1.0.0
UpdatedApr 28, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-streamable-http-server-template

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 install
2

Set 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 '+/' '-_'
3

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-key
4

Run 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 dev
5

Deploy 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 deploy
6

Add 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.

7

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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-streamable-http-server-template": { "command": "npx", "args": ["-y", "mcp-streamable-http-server-template"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides