Skip to main content
Glama
run.zero MCP server starter

run.zero MCP server starter

run.zero MCP server starter

A minimal, production-ready remote MCP server in TypeScript. It speaks Streamable HTTP, runs on Node 22 and deploys to run.zero without any changes.

  • Official MCP TypeScript SDK (v2), stateless: a fresh server instance per request, so it scales to more replicas as-is

  • Two example tools with title, description, input and output schema and readOnlyHint / destructiveHint annotations

  • GET /healthz for monitoring, a small info page at /

  • Optional bearer-token auth via one environment variable

  • Tests for the tools and the HTTP endpoint (initialize, tools/list, tools/call, auth)

Live demo: https://mcp-runzero-mcp-starter-d15c5da5.run-zero.app (endpoint https://mcp-runzero-mcp-starter-d15c5da5.run-zero.app/mcp, no auth)

Deploy on run.zero

One click. Open https://dashboard.run-zero.de/?template=runzero-mcp-starter-d15c5da5, sign in, and run.zero copies this template into a new app of yours, with its own repository, build and URL.

With your coding agent. If your agent has the run.zero MCP server connected, ask it:

Create a new app from the run.zero template runzero-mcp-starter-d15c5da5 and call it my-mcp-server.

It calls runzero_adopt_template and waits for the build.

From your own fork. Fork this repository, then create an app on run.zero linked to your fork and deploy it (dashboard, or runzero_create_app with repo and runzero_deploy). run-zero.yaml declares one service mcp on port 8080; the server is then live at https://mcp-<app-slug>.run-zero.app/mcp.

Node is pinned to 22.x in package.json. The buildpack runs npm run build at image-build time, so the build tools (typescript, the @types packages) are regular dependencies.

Related MCP server: MCP Server Starter (TypeScript)

Run locally

npm install
npm run dev            # http://localhost:8080/mcp, reloads on change
npm test               # tool and HTTP tests
npm run build && npm start

Try it with the MCP Inspector:

npm run inspect        # then connect to http://localhost:8080/mcp with transport "Streamable HTTP"

Or add it to Claude Code:

claude mcp add --transport http starter http://localhost:8080/mcp

Configuration

Variable

Default

Purpose

PORT

8080

Port the server listens on (run.zero sets it)

MCP_AUTH_TOKEN

unset

When set, /mcp requires Authorization: Bearer <token>. /healthz and / stay public

ALLOWED_HOSTS

unset

Comma-separated host names; when set, requests with any other Host header are refused (DNS rebinding protection)

On run.zero, set secrets in the dashboard or with runzero_set_secrets, never in run-zero.yaml:

runzero_set_secrets app=my-mcp-server service=mcp MCP_AUTH_TOKEN=<long random string>

Clients then send the token as a header, for example:

claude mcp add --transport http starter https://mcp-<app-slug>.run-zero.app/mcp \
  --header "Authorization: Bearer <token>"

Next step: OAuth

A static token suits personal and team use. For a public server where every user signs in with their own account, switch to OAuth 2.1 as described in the MCP authorization spec:

  1. Run an authorization server. On run.zero, add a keycloak addon in run-zero.yaml and attach it to the mcp service.

  2. Replace requireStaticBearer in src/app.ts with requireBearerAuth from @modelcontextprotocol/express and a verifier that checks the JWT against the issuer, audience and expiry.

  3. Serve the protected resource metadata at /.well-known/oauth-protected-resource so clients find the authorization server. The SDK's oauth example shows the full setup.

Add your own tools

Tools live in src/tools.ts. Each one gets a snake_case name with a prefix, a title, a description that says when to use it, a Zod input schema and annotations:

Annotation

Set to true when the tool

readOnlyHint

changes nothing

destructiveHint

may delete or overwrite data (clients ask before calling it)

idempotentHint

can be repeated with the same arguments without further effect

openWorldHint

talks to an external system

Keep shared clients (database pools, API clients) at module scope and register tools inside createServer() in src/server.ts. Errors thrown in a tool reach the model as the tool result, so write messages that say how to recover. Add a test in test/ for every tool.

List it in the official MCP Registry

The MCP Registry is where clients and directories discover servers. A remote server needs no package, only a server.json:

{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.<your-github-user>/<server-name>",
  "title": "My MCP server",
  "description": "What it does, in one sentence.",
  "version": "1.0.0",
  "remotes": [
    { "type": "streamable-http", "url": "https://mcp-<app-slug>.run-zero.app/mcp" }
  ]
}
  1. Install the publisher: brew install mcp-publisher (or download it from the registry releases).

  2. Sign in to prove the namespace. mcp-publisher login github covers io.github.<user>/*. For your own domain use mcp-publisher login dns --domain example.com --private-key <key> (TXT record) or login http (file under /.well-known/mcp-registry-auth), which gives you names like com.example/<server-name>.

  3. Publish from the folder that holds server.json: mcp-publisher publish. Raise version before every new publish.

Once it is in the registry, directories such as the run.zero MCP directory pick it up automatically.

License

MIT, see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      A production-ready TypeScript template for building MCP servers with dual transport support (stdio/HTTP), OAuth 2.1 foundations, SQLite caching, observability, and security features including PII sanitization and rate limiting.
      4
      29 npm
      -
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      A minimal, production-ready TypeScript template for building Model Context Protocol servers with auto-loading architecture for tools, resources, and prompts, supporting both stdio and HTTP transports.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A minimal, production-ready starter for building Model Context Protocol servers in TypeScript, supporting both stdio and streamable HTTP transports with optional bearer-token auth.
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      A production-shaped starter for building MCP servers in TypeScript, featuring stdio and streamable HTTP transport, bearer auth, and example tools including ping and http_get_json with SSRF guards.
      2
      MIT