mcp-ts-core
by cyanheads·★ 138·综合分 48
构建 MCP 服务器的 TypeScript 框架,支持认证、存储、遥测和多平台部署。
概述
@cyanheads/mcp-ts-core 是一个用于构建 MCP 服务器的全面 TypeScript 框架。它提供了声明式的工具、资源和提示定义,内置支持认证、多后端存储和可观测性。框架处理基础设施管道,如传输、配置、日志记录和遥测,使开发人员能够专注于特定领域的逻辑。它支持多种运行时,包括 Bun、Node.js 和 Cloudflare Workers,并具有可选的分析工作区 DataCanvas 功能。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
当使用 TypeScript 构建生产级 MCP 服务器时选择此框架,特别是如果您需要开箱即用的多后端存储、认证和可观测性功能。
什么时候不要选它
如果您需要更简单的解决方案且依赖更少,或者您的服务器需要在 Bun/Node/Cloudflare Workers 之外的环境中运行,请避免使用此框架。
此 server 暴露的工具
从 README 抽取出 9 个工具greetGreet someone by name and return a personalized message.
searchSearch for items by query.
template_echo_messageBasic tool with format and auth options.
template_cat_factGet external API call results with error handling.
template_madlibs_elicitationInteractive tool that asks for user input.
template_code_review_samplingTool that uses LLM completion for code review.
template_image_testTool that handles image content blocks.
template_async_countdownLong-running task with progress reporting.
template_data_explorerMCP Apps tool with linked UI resource.
说明:Extracted from example code snippets in the documentation showing actual tool implementations.
可对比工具
安装
bunx @cyanheads/mcp-ts-core init my-mcp-server
cd my-mcp-server
bun install对于 Claude Desktop:
{
"mcpServers": {
"my-mcp-server": {
"command": "node",
"args": ["dist/index.ts"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio"
}
}
}
}FAQ
- 这个框架支持哪些平台?
- 该框架支持 Bun、Node.js 和 Cloudflare Workers,允许在各种环境中部署。
- 框架中的认证是如何工作的?
- 框架支持认证模式:'none'(无认证)、'jwt'(JWT 令牌)或 'oauth'(本地密钥或 JWKS)。可以在工具和资源上定义认证范围。
mcp-ts-core 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。