DevOps研发效能
媒体矩阵
开源中国APP
授权协议 MIT license
开发语言 JavaScript TypeScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 不详
适用人群 未知
收录时间 2025-03-28

软件简介

@mcpdotdirect/template-mcp-server 是一个 CLI 工具,可快速开始构建 MCP(模型上下文协议)服务器。

主要特性

  • 双传输支持:支持通过stdio或HTTP运行MCP服务器
  • TypeScript支持:提供完整的TypeScript支持,确保类型安全
  • MCP SDK:基于官方Model Context Protocol SDK构建
  • 可扩展性:易于添加自定义工具、资源和提示

快速开始

# with npx
npx @mcpdotdirect/create-mcp-server

# Or with npm
npm init @mcpdotdirect/create-mcp-server

添加自定义工具和资源

  • 使用下划线(_)而不是连字符(-)命名所有资源、工具和提示名称
  • 这种命名约定确保与Cursor和其他与您的MCP服务器交互的AI工具兼容
// Good: Uses underscores
server.tool(
  "my_custom_tool",
  "Description of my custom tool",
  {
    param_name: z.string().describe("Parameter description")
  },
  async (params) => {
    // Tool implementation
  }
);

// Bad: Uses hyphens, may cause issues with Cursor
server.tool(
  "my-custom-tool",
  "Description of my custom tool",
  {
    param-name: z.string().describe("Parameter description")
  },
  async (params) => {
    // Tool implementation
  }
);

 

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
0 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部