MCP Ts Template logo

MCP Ts Template

TypeScript framework and scaffold for building MCP servers with typed definitions, auth, storage, transports, and observability.

Install MCP Ts Template

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-ts-template": {
      "command": "bunx",
      "args": [
        "@cyanheads/mcp-ts-core"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

mcp-ts-template provides an agent-native TypeScript foundation for building MCP servers that connect APIs, datasets, and workflows to AI agents. Its `@cyanheads/mcp-ts-core` package supplies typed builders for tools, resources, prompts, and MCP Apps, along with authentication, tenant-scoped storage, logging, testing, and transport support. Scaffolds run over stdio or Streamable HTTP on Bun and Node.js, with a separate Cloudflare Workers entry point. Reach for it when you want a structured starting point for a production MCP server rather than wiring the protocol and operational infrastructure yourself.

Use cases

  • Scaffold an MCP server for an internal API
  • Expose dataset queries as typed agent tools
  • Publish workflow actions over stdio or HTTP
  • Add authentication and tenant-scoped state
  • Test MCP definitions before deployment

Key features

  • Typed tools, resources, prompts, and MCP Apps
  • JWT/OAuth scopes and tenant-scoped storage
  • stdio, Streamable HTTP, and Cloudflare Workers support
  • Structured logging and optional OpenTelemetry
  • Definition linting, contract tests, and fuzz testing

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

14/14 checks healthy over the last 50d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · @cyanheads/mcp-ts-core (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars153Stargazers on the source repository.
npm downloads75kPackage downloads in the last 30 days.
Last commitTodayMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Ts Template works

What mcp-ts-template does

mcp-ts-template is a TypeScript scaffold built around @cyanheads/mcp-ts-core, an agent-focused framework for creating MCP servers. The project is intended to connect an AI agent to an API, dataset, or workflow through MCP while leaving domain-specific behavior in the application code.

The framework supports typed definitions for tools, resources, prompts, and interactive MCP Apps. Tool definitions can include input and output schemas, read-only annotations, enriched results, declared failure modes, recovery guidance, and custom text formatting. Resources expose application data through URI templates, while server instructions and optional skills help clients understand how to use the available capabilities.

How it works

A generated project registers its definitions with createApp(). A tool combines a name, description, Zod-based schema, and handler; the handler can use the request context to add result enrichment, return structured failures, request additional user or client input, and access tenant-scoped state. The framework advertises tool contracts through tools/list and can lint definitions against their declared behavior.

Results are emitted as both structured JSON and text content so clients that prefer either MCP surface receive equivalent data. A custom format() function controls the text representation, and the format-parity lint rule checks that output fields are represented there. Declared errors carry recovery information, and tool failures include the request ID associated with server logs.

Servers can use stdio for local client launches or Streamable HTTP at an MCP endpoint. Bun and Node.js deployments use the normal application entry point; Cloudflare Workers use createWorkerHandler() with the same definitions from a separate entry point.

Setup and configuration

Create a scaffold with:

bash
bunx @cyanheads/mcp-ts-core init my-mcp-server
cd my-mcp-server
bun install

For an existing TypeScript project, install the core package with bun add @cyanheads/mcp-ts-core and register definitions through createApp(). The generated project includes source, build, and test configuration, agent guidance files, Agent Skills, and plugin metadata for Claude Code and Codex.

Run bun run rebuild followed by bun run start:http to serve over HTTP. Clients can connect to http://127.0.0.1:3010/mcp, or launch the compiled application over stdio with bun /absolute/path/to/dist/index.js. The supported runtimes are Bun, Node.js 24 or newer, and Cloudflare Workers.

Authentication is configured per definition with scopes under JWT or OAuth. State is tenant-scoped and can use in-memory or filesystem storage, Supabase, or Cloudflare D1, KV, and R2. DuckDB, Supabase, and the OpenTelemetry SDK are optional peer dependencies.

Tools and capabilities

  • Build typed tools with Zod input and output schemas.
  • Register URI-based resources and reusable prompts.
  • Add interactive MCP Apps and server instructions.
  • Declare errors with retry and recovery guidance.
  • Enrich results without mixing metadata into domain return values.
  • Emit matching structured and text result surfaces.
  • Use stdio, Streamable HTTP, or Cloudflare Workers transports.
  • Add structured logging and optional OpenTelemetry.
  • Run definition linting, contract tests, and fuzz tests.
  • Serve root skills through the SEP-2640 Skills extension.

Limitations and notes

The scaffold supplies runtime infrastructure, but application-specific tools and handlers remain the developer’s responsibility. Optional integrations require separate installation. The framework’s package-upgrade workflow can update the core dependency and synchronize its Agent Skills through the maintenance skill.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Ts Template

mcp-ts-template is an MCP server that provides a TypeScript framework for connecting APIs, datasets, and workflows to AI agents. Its main tools are typed builders for MCP tools, resources, prompts, and interactive MCP Apps, with support for authentication, storage, logging, testing, and stdio or HTTP transports.

Install it by running `bunx @cyanheads/mcp-ts-core init my-mcp-server`, then enter the directory and run `bun install`. Existing TypeScript projects can add the package with `bun add @cyanheads/mcp-ts-core` and register definitions through `createApp()`.

Run `bun run rebuild` and then `bun run start:http`. The Streamable HTTP endpoint is `http://127.0.0.1:3010/mcp`; local clients can alternatively launch the compiled application over stdio with Bun.

Yes, mcp-ts-template supports Cloudflare Workers through a separate entry point that calls `createWorkerHandler()`. It accepts the same tool, resource, and prompt definitions used by `createApp()`, and storage can use Cloudflare D1, KV, or R2.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Ts Template AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-ts-template?style=directory)](https://allmcps.com/mcp/mcp-ts-template)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-ts-template"><img src="https://allmcps.com/api/badge/mcp-ts-template?style=directory" alt="MCP Ts Template on AllMCPs" /></a>