Streamable MCP Server Template

Cloud and DevOps

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.

Your AI app calls Streamable MCP Server Template, which does the cloud and DevOps work and sends the result back to the chat.

About Streamable MCP Server Template

Streamable MCP Server Template is a community MCP server from iceener, filed in our directory under cloud and devops. 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.

At a glance

Publisher
iceener (community)
Runs
See the README for setup
Written in
TypeScript
License
MIT
GitHub stars
162

How to set up Streamable MCP Server Template

  1. Follow the install steps in the Streamable MCP Server Template README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Streamable MCP Server Template README for keys or settings; the registry lists none that Streamable MCP Server Template requires.
  3. Add Streamable MCP Server Template to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Streamable MCP Server Template tools to confirm the connection.
  5. Run one read-only task with Streamable MCP Server Template first, and keep your app asking before each tool call until the results look right.

Streamable MCP Server Template compared with similar servers

  • Hayhooks by deepset-ai has fewer GitHub stars than Streamable MCP Server Template (158 against 162); both are community servers, and both run locally.
  • Sample AWS Pricing Calculator by aws-samples has more GitHub stars than Streamable MCP Server Template (163 against 162); both are community servers, and both run locally.
  • Aldine by trahloff has fewer GitHub stars than Streamable MCP Server Template (155 against 162); both are community servers, and Aldine runs as a remote server and Streamable MCP Server Template runs on your own machine.

Before you connect Streamable MCP Server Template

  • Give Streamable MCP Server Template its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Streamable MCP Server Template tool call until you trust what it does with them.
  • Treat text that Streamable MCP Server Template fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Streamable MCP Server Template on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Streamable MCP Server Template

How marketing and sales teams put Streamable MCP Server Template to work, by company size. Pick the size closest to yours and start Streamable MCP Server Template on one use case.

Small business

  • A small business can ask Streamable MCP Server Template why the site is slow or down and get the likely cause in plain words.
  • Owners can use Streamable MCP Server Template to check hosting costs and spot services they pay for but no longer use.
  • Streamable MCP Server Template runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Web teams can connect Streamable MCP Server Template to watch deploys during a launch and roll back fast if a campaign page breaks.
  • Marketing engineering can use Streamable MCP Server Template to spin up preview environments for every landing page review.
  • Start Streamable MCP Server Template on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should give Streamable MCP Server Template read access first, with changes gated by the same approvals as any infrastructure change.
  • Large orgs can use Streamable MCP Server Template to answer cost and reliability questions across accounts, so marketing launches are planned with real capacity.
  • Streamable MCP Server Template is a community server, so have security review the code and pin a version before Streamable MCP Server Template touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Streamable MCP Server Template README

From iceener/streamable-mcp-server-template on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

MCP Server Template

This template is a remote Model Context Protocol (MCP) server. It runs on Bun and on Cloudflare Workers. It uses the official MCP TypeScript SDK.

The server uses protocol version 2026-07-28. It also accepts clients that use the 2025 protocol versions.

The template includes these functions:

  • Checks of the Host and Origin headers.
  • OAuth token checks. The server is an OAuth resource server. Your code does not receive the token.
  • An error policy. The server does not send internal error data to clients.
  • Tests that run on Bun and on Cloudflare Workers.

The sample server gives weather data from Open-Meteo. Open-Meteo does not require an API key. Replace the samples with your tools. Keep the other parts of the template.

Requirements

  • Bun 1.4 or later.
  • Node.js 22.18 or later. The Wrangler commands and the smoke tests use Node.js.

Start the server

  1. Install the dependencies:

    bun install
    
  2. Start the server:

    bun run dev
    

The server URL is http://127.0.0.1:3000/mcp.

To use the Cloudflare local runtime, run bun run dev:worker. The server URL is then http://127.0.0.1:8787/mcp.

Connect a client

Use the server URL and the Streamable HTTP transport.

Client Procedure
MCP Inspector Run bun run inspector. Select Streamable HTTP. Enter the server URL.
Claude Code Run claude mcp add --transport http weather http://127.0.0.1:3000/mcp.
VS Code Add { "servers": { "weather": { "type": "http", "url": "http://127.0.0.1:3000/mcp" } } } to .vscode/mcp.json.
Cursor Add { "mcpServers": { "weather": { "url": "http://127.0.0.1:3000/mcp" } } } to ~/.cursor/mcp.json.

To test the connection, send a request. For example: "What is the weather in Kraków this week?"

Samples

Each sample shows one procedure.

Sample Type Shows
get-forecast Tool A call to an external API through a service. It shows cancellation, progress, and errors that the model can correct.
echo Tool The smallest complete tool: an input schema, an output schema, and annotations.
whoami Tool How to read the identity of the verified caller.
confirm-action Tool How to ask the user for approval during a call (input_required). The tool also requires an OAuth scope.
docs://server/guide Resource A static resource.
weather://codes/{code} Resource template How to list, read, and complete URIs from a template.
weather-briefing Prompt Prompt arguments and argument completion.

Project structure

src/
  server.ts       Server identity, dependencies, token verification, extra routes, McpServer factory
  settings.ts     Settings for your code, for example API keys
  tools/          ┐
  resources/      │ Your code. Each tool, resource, or prompt has one file.
  prompts/        │ The index.ts file in each folder lists them.
  services/       ┘ Clients for the external APIs that your tools use
  platform/       Template code: configuration, HTTP pipeline, authentication, logs, defineTool
  bun.ts          Entry point for Bun
  worker.ts       Entry point for Cloudflare Workers
tests/            Tests for each tool and service, and tests for the platform code
scripts/          Smoke tests on real network sockets, and a local token issuer

You change server.ts, settings.ts, and the four folders. The platform/ folder is template code. Do not change it unless it is necessary.

platform/ uses only a fixed set of names from server.ts and settings.ts. This lets you replace platform/ with the version from a newer template. server.ts has hooks for settings, runtime resources (for example Workers KV), token verification, authorization server metadata, and extra HTTP routes.

Add a tool

  1. Create a file in src/tools/. For example:

    // src/tools/add.ts
    import * as z from 'zod/v4';
    import { defineTool } from '../platform/primitives';
    
    export const add = defineTool(
      'add',
      {
        description: 'Add two numbers.',
        inputSchema: z.object({ a: z.number(), b: z.number() }),
        outputSchema: z.object({ sum: z.number() }),
        annotations: { readOnlyHint: true, openWorldHint: false },
      },
      ({ a, b }) => ({
        content: [{ type: 'text', text: String(a + b) }],
        structuredContent: { sum: a + b },
      }),
    );
    
  2. Add the tool to the list in src/tools/index.ts.

  3. Create the test file tests/tools/add.test.ts. Use tests/tools/echo.test.ts as an example.

defineTool has the same arguments as server.registerTool in the SDK. It also does these tasks:

  • It gives your dependencies (deps) to the handler as the last argument.
  • It makes sure that structuredContent agrees with outputSchema when you compile the code.
  • It records unexpected errors in the log. The model does not see these errors.

For errors, progress, cancellation, user input, scopes, and tests, refer to docs/tools.md.

Runtimes

Bun Cloudflare Workers
Start locally bun run dev bun run dev:worker
Configuration .env (refer to .env.example) vars in wrangler.jsonc. Put local secrets in .dev.vars.
Deployment A host that runs Bun, behind HTTPS bun run deploy
Use it for Long tasks, local processes, your own servers Global hosting without server maintenance

The two runtimes use the same application. Only the entry point is different. For more data, refer to docs/deploy.md.

Configuration

The server identity (name, version, and instructions) is in src/server.ts. The deployment settings are environment variables:

Variable Default Function
MCP_PUBLIC_URL http://127.0.0.1:$PORT/mcp The public URL of the endpoint. Production requires it.
MCP_ALLOWED_HOSTS The host of the public URL, and the loopback hosts outside production The Host headers that the server accepts
MCP_ALLOWED_ORIGIN_HOSTNAMES The host of the public URL, and the loopback hosts outside production The browser Origin headers that the server accepts
AUTH_MODE none none, bearer, or oauth. Production requires it.
BEARER_TOKEN The shared token when AUTH_MODE=bearer. Store it as a secret.
OAUTH_* The settings of your authorization server. Refer to docs/auth.md.
MCP_LEGACY_MODE stateless Set reject to accept only 2026-07-28 clients.
LOG_LEVEL info debug, info, warning, or error

Put your own settings, for example API keys, in src/settings.ts. The server validates them together with the other settings. The file .env.example describes all variables.

If the configuration is not valid, the server shows all problems at the same time:

  • Bun does not start.
  • A Worker records the problems in the log. It sends a 500 response to all requests until you correct the configuration.

Authentication

The server has three authentication modes:

  • none: The server accepts all requests.
  • bearer: All clients send the same secret token (BEARER_TOKEN) in the Authorization header.
  • oauth: The server is an OAuth resource server. The server publishes metadata that tells clients where your authorization server is. The server accepts only the tokens that your authorization server issued for this server URL.

The server can also be its own authorization server, for example in front of the OAuth of an external provider. For this procedure, refer to docs/auth.md.

To test OAuth without an authorization server, run bun run token. This command starts a local key server. It shows a token and the settings to use. For real providers and scopes for each tool, refer to docs/auth.md.

Scripts

Script Function
bun run dev Starts the server on Bun.
bun run dev:worker Starts the server in the Cloudflare local runtime.
bun run check Does the type check, the lint check, and the tests. It also checks the generated Worker types. CI runs this script.
bun run test:smoke Starts the real server on Bun and on workerd, and sends requests through network sockets. It requires Node.js 22.18 or later.
bun run inspector Starts MCP Inspector.
bun run token Starts a local authorization server and shows a test token.
bun run deploy Deploys to Cloudflare with the production settings in wrangler.jsonc.
bun run types:worker Makes the Worker types again. Run it after you change wrangler.jsonc.

Documentation

License

MIT

Questions about Streamable MCP Server Template

What is the Streamable MCP Server Template MCP server?

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 Template is maintained by iceener on GitHub at iceener/streamable-mcp-server-template, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Streamable MCP Server Template MCP server?

Streamable MCP Server Template doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (iceener/streamable-mcp-server-template). Like most servers, Streamable MCP Server Template ends with a command or URL you paste into your AI app's MCP config.

Does Streamable MCP Server Template need an API key?

The registry lists no required keys for Streamable MCP Server Template. Check the Streamable MCP Server Template README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Streamable MCP Server Template an official MCP server?

No. Streamable MCP Server Template is a community server maintained by iceener. Community servers can be excellent; read the code and the open issues before you give Streamable MCP Server Template access to company data.

What license is Streamable MCP Server Template under?

Streamable MCP Server Template is released under the MIT license, according to its GitHub repository. The license covers the code of Streamable MCP Server Template; the service it connects to has its own terms.