MCP ConfigsMay 12, 2026·2 min read

mcp-ts-core — TypeScript Framework for MCP Servers

Build MCP servers in TypeScript with declarative tool/resource schemas, auth, storage backends, and OpenTelemetry. Includes a Bun-powered scaffold command.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 17/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
Mcp Config
Install
Stage only
Trust
Trust: Established
Entrypoint
Asset
Safe staging command
npx -y tokrepo@latest install 2fcfe3c0-5964-504b-b116-7c3abd01c2b0 --target codex

Stages files first; activation requires review of the staged README and plan.

Intro

mcp-ts-core is an infrastructure layer you install as a dependency to build MCP servers, so you focus on domain tools while the framework handles transports, auth, telemetry, and lifecycle.

Best for: Teams building multiple MCP servers with consistent auth/telemetry patterns

Works with: Bun or Node; TypeScript; MCP clients; OpenTelemetry integration

Setup time: 15–30 minutes

Key facts (verified)

  • README badges list version 0.9.0 and TypeScript ^6.0.3.
  • Quick start is a single scaffold command: bunx ... init (README).
  • GitHub: 138 stars · 24 forks; pushed 2026-05-11 (GitHub API verified).

Main

Use this framework to standardize “how tools fail”:

  • Keep tool schemas strict (Zod) and define recovery hints for expected failures.
  • Emit telemetry by default so you can answer: which tools are slow, which inputs are large, where errors cluster.
  • Treat the scaffolded CLAUDE.md / agent skills as the shared operating system for contributors.

README excerpt (verbatim)

@cyanheads/mcp-ts-core

Agent-native TypeScript framework for building MCP servers. Build tools, not infrastructure. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.

Version MCP Spec MCP SDK License

TypeScript Bun


What is this?

@cyanheads/mcp-ts-core is the infrastructure layer for TypeScript MCP servers. Install it as a dependency — don't fork it. Your agent collaborates with you to design and build the tools, resources, and prompts for your server.

The framework handles the plumbing: transports, auth, config, logging, telemetry, & more. Define your domain logic with the builders and let the framework take care of the rest.

import { createApp, tool, z } from '@cyanheads/mcp-ts-core';

const greet = tool('greet', {
  description: 'Greet someone by name and return a personalized message.',
  annotations: { readOnlyHint: true },
  input: z.object({
    name: z.string().describe('Name of the person to greet'),
  }),
  output: z.object({
    message: z.string().describe('The greeting message'),
  }),
  errors: [
    {
      reason: 'name_blocked',
      code: JsonRpcErrorCode.Forbidden,
      when: 'The provided name is on the configured block list.',
      recovery: 'Use a different name.',
    },
  ],
  handler: async (input, ctx) => {
    if (isBlocked(input.name)) throw ctx.fail('name_blocked', `"${input.name}" is blocked`);
    return { message: `Hello, ${input.name}!` };
  },
});

await createApp({ tools: [greet] });

FAQ

Q: Should I fork the repo? A: README suggests installing as a dependency rather than forking.

Q: What runtime is preferred? A: README highlights first-class Bun support; Node is also supported.

Q: What’s the main benefit? A: It handles transports/auth/telemetry so your server code stays domain-focused.

🙏

Source & Thanks

Source: https://github.com/cyanheads/mcp-ts-core > License: Apache-2.0 > GitHub stars: 138 · forks: 24

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets