Streamable MCP Server Template

v1.0.0Developer Toolsstable

Production-ready MCP server template with Streamable HTTP transport. Supports Node.js (Hono) and Cloudflare Workers. Includes OAuth 2.1, multi-tenant sessions, tool/resource/prompt registration, and AES-256-GCM token encryption.

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

What is Streamable MCP Server Template?

Streamable MCP Server Template is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to production-ready mcp server template with streamable http transport. supports node.js (hono) and cloudflare workers. includes oauth 2.1, multi-tenant sessions, tool/resource/prompt registration, and a...

Production-ready MCP server template with Streamable HTTP transport. Supports Node.js (Hono) and Cloudflare Workers. Includes OAuth 2.1, multi-tenant sessions, tool/resource/prompt registration, and AES-256-GCM token encryption.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Production-ready MCP server template with Streamable HTTP tr

Use Cases

Create production MCP servers with OAuth 2.1 and multi-tenant support.
Implement secure token encryption and tool registration patterns.
iceener

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 28, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx streamable-mcp-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 Streamable MCP Server Template

The Streamable MCP Server Template is a production-ready starting point for building MCP servers that use the Streamable HTTP transport. It supports two deployment targets—Node.js with Hono and Cloudflare Workers—and comes pre-configured with OAuth 2.1 authentication, multi-tenant session management, AES-256-GCM token encryption, and full MCP capability registration (tools, resources, prompts). It is designed to reduce the boilerplate required to ship a secure, scalable MCP server to production.

Prerequisites

  • Node.js 18+ and Bun package manager installed
  • For Cloudflare Workers deployment: a Cloudflare account with Wrangler CLI configured
  • An OAuth 2.1 provider (or use the bearer/API key auth strategies for simpler setups)
  • OpenSSL available for generating the AES-256-GCM encryption key
  • An MCP-compatible client such as Claude Desktop for testing
1

Clone the template repository

Clone the streamable-mcp-server-template repository from GitHub to start your project.

git clone https://github.com/iceener/streamable-mcp-server-template.git
cd streamable-mcp-server-template
bun install
2

Generate an encryption key

Generate a secure AES-256-GCM token encryption key. This is required for RS_TOKENS_ENC_KEY.

openssl rand -base64 32 | tr -d '=' | tr '+/' '-_'
3

Configure environment variables

Copy the example env file and fill in your OAuth provider credentials and encryption key. For simpler setups, set AUTH_STRATEGY=bearer or AUTH_STRATEGY=api_key instead of OAuth.

cp .env.example .env
4

Set required variables in .env

Configure authentication and provider settings. AUTH_STRATEGY can be oauth, bearer, api_key, custom, or none. For bearer auth, set BEARER_TOKEN. For OAuth, set PROVIDER_CLIENT_ID, PROVIDER_CLIENT_SECRET, PROVIDER_ACCOUNTS_URL, and PROVIDER_API_URL.

PROVIDER_CLIENT_ID=your_oauth_client_id
PROVIDER_CLIENT_SECRET=your_oauth_client_secret
PROVIDER_ACCOUNTS_URL=https://your-provider.com/oauth
PROVIDER_API_URL=https://your-provider.com/api
AUTH_STRATEGY=oauth
RS_TOKENS_ENC_KEY=your_generated_key
5

Start the development server

Run the Node.js development server. It starts on localhost:3000/mcp by default.

bun dev
6

Add your custom tools

Create tool files in src/shared/tools/ using the defineTool() helper with a Zod schema, then register them in src/shared/tools/registry.ts. The template includes health check and echo example tools.

7

Deploy to Cloudflare Workers (optional)

For Cloudflare Workers deployment, create the KV namespace and set secrets via Wrangler, then 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

Streamable MCP Server Template Examples

Client configuration

Connect Claude Desktop to your running Streamable MCP server using the mcp-remote adapter.

{
  "mcpServers": {
    "streamable-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:3000/mcp"]
    }
  }
}

Prompts to try

Test the built-in example tools and your custom tools with these prompts after connecting.

- "Check the health status of the MCP server"
- "Echo back the message 'Hello from Claude'"
- "List all available tools on this MCP server"
- "Call the [your-custom-tool] with parameter X"
- "What resources and prompts are available on this server?"

Troubleshooting Streamable MCP Server Template

OAuth callback fails or token encryption errors on startup

Ensure RS_TOKENS_ENC_KEY is set and was generated with the provided openssl command (base64 URL-safe, no padding). The key must be exactly 32 bytes when decoded. For testing, switch to AUTH_STRATEGY=none or AUTH_STRATEGY=bearer to bypass OAuth.

Cloudflare Workers deployment fails with KV namespace errors

Run 'wrangler kv:namespace create TOKENS' and copy the namespace ID it outputs into wrangler.toml under [[kv_namespaces]]. The TOKENS KV namespace must exist before deploying.

Custom tools not being discovered by MCP clients

After creating a tool file in src/shared/tools/, you must register it in src/shared/tools/registry.ts by adding it to the sharedTools array. The server only exposes tools that are explicitly registered.

Frequently Asked Questions about Streamable MCP Server Template

What is Streamable MCP Server Template?

Streamable MCP Server Template is a Model Context Protocol (MCP) server that production-ready mcp server template with streamable http transport. supports node.js (hono) and cloudflare workers. includes oauth 2.1, multi-tenant sessions, tool/resource/prompt registration, and aes-256-gcm token encryption. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Streamable MCP Server Template?

Follow the installation instructions on the Streamable MCP Server Template GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Streamable MCP Server Template?

Streamable MCP Server Template works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Streamable MCP Server Template free to use?

Yes, Streamable MCP Server Template is open source and available under the MIT 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": { "streamable-mcp-server-template": { "command": "npx", "args": ["-y", "streamable-mcp-server-template"] } } }

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

Read the full setup guide →

Ready to use Streamable MCP Server Template?

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