MCP Configs2026年5月12日·1 分钟阅读

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 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Asset
安全暂存命令
npx -y tokrepo@latest install 2fcfe3c0-5964-504b-b116-7c3abd01c2b0 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

简介

mcp-ts-core 是可作为依赖安装的 MCP server 基础设施层:你专注于领域工具,框架负责传输、鉴权、遥测与生命周期管理。

最适合: 需要统一鉴权/可观测性的多 MCP server 团队

适配: Bun 或 Node;TypeScript;MCP 客户端;支持 OpenTelemetry

配置时间: 15–30 分钟

关键事实(已验证)

  • README Badge 显示版本 0.9.0 与 TypeScript ^6.0.3。
  • 快速开始是一条脚手架命令:bunx ... init(README)。
  • GitHub:138 stars · 24 forks;最近更新 2026-05-11(GitHub API 验证)。

正文

用它来把“工具怎么失败”标准化:

  • schema 严格一些(Zod),为可预期失败定义清晰的恢复提示。
  • 默认开启遥测,才能回答:哪些工具慢、输入/输出多大、错误集中在哪些场景。
  • 把脚手架生成的 CLAUDE.md / agent skills 当作协作的共同操作系统来维护。

README 原文节选(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

需要 fork 吗? 答:README 建议直接作为依赖安装,不要 fork。

推荐用什么运行时? 答:README 强调对 Bun 的一等支持;也支持 Node。

核心收益是什么? 答:框架处理传输/鉴权/遥测,让你的代码更聚焦业务工具。

🙏

来源与感谢

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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产