Token导航 LogoToken导航TokenDH.com
Reasoning Boilerplate MCP logo
AI代理未说明官方级别未说明来源级核验

Reasoning Boilerplate MCP

MCP Server

一个用于构建MCP(Model Context Protocol)服务器的启动模板,提供与Claude、Cursor或其他MCP兼容AI助手集成的干净基础。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
服务器模板JavaScriptClaudeClaude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ricleedo

提供方

ricleedo

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP服务器模板

一个用于构建MCP(模型上下文协议)服务器的起始模板。这个模板提供了一个干净的基础,用于创建您自己的MCP服务器,该服务器可以与Claude、Cursor或其他兼容MCP的AI助手集成。

目的

这个模板能帮助你快速开始构建:

  • 为AI助手定制的工具
  • 动态内容的资源提供商
  • 常见操作的提示模板
  • 外部API和服务的集成点

特点/特性

  • 简单的“hello-world”工具示例
  • 带有适当类型定义的 TypeScript 支持
  • 适用于不同MCP客户端的简易安装脚本
  • 清晰的项目结构,随时准备进行定制化

它是如何工作的

这个MCP服务器模板提供:

  1. 使用MCP SDK进行基本服务器设置
  2. 示例工具实现
  3. 构建和安装脚本
  4. 用于开发的TypeScript配置

附带的示例展示了如何创建一个简单的工具,该工具接受一个名称参数并返回一条问候语。

入门指南/开始使用

# Clone the boilerplate
git clone 
cd mcp-server-boilerplate

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Start the server
pnpm start

安装脚本

这个模板包含了针对不同MCP客户端的便捷安装脚本:

# For Claude Desktop
pnpm run install-desktop

# For Cursor
pnpm run install-cursor

# For Claude Code
pnpm run install-code

# Generic installation
pnpm run install-server

这些脚本将构建项目并自动更新相应的配置文件。

与Claude Desktop的配合使用

安装脚本会自动添加配置,但您也可以手动将其添加到您的 claude_desktop_config.json 文件:

{
  "mcpServers": {
    "your-server-name": {
      "command": "node",
      "args": ["/path/to/your/dist/index.js"]
    }
  }
}

然后重启Claude Desktop以连接到服务器。

定制您的服务器

添加工具

工具是AI助手可以调用的功能。以下是基本结构:

server.tool(
  "tool-name",
  "Description of what the tool does",
  {
    // Zod schema for parameters
    param1: z.string().describe("Description of parameter"),
    param2: z.number().optional().describe("Optional parameter"),
  },
  async ({ param1, param2 }) => {
    // Your tool logic here
    return {
      content: [
        {
          type: "text",
          text: "Your response",
        },
      ],
    };
  }
);

添加资源

资源为人工智能提供了可访问的动态内容:

server.resource(
  "resource://example/{id}",
  "Description of the resource",
  async (uri) => {
    // Extract parameters from URI
    const id = uri.path.split("/").pop();

    return {
      contents: [
        {
          uri,
          mimeType: "text/plain",
          text: `Content for ${id}`,
        },
      ],
    };
  }
);

添加提示

提示是可重用的模板:

server.prompt(
  "prompt-name",
  "Description of the prompt",
  {
    // Parameters for the prompt
    topic: z.string().describe("The topic to discuss"),
  },
  async ({ topic }) => {
    return {
      description: `A prompt about ${topic}`,
      messages: [
        {
          role: "user",
          content: {
            type: "text",
            text: `Please help me with ${topic}`,
          },
        },
      ],
    };
  }
);

项目结构

├── src/
│   └── index.ts          # Main server implementation
├── scripts/              # Installation and utility scripts
├── dist/                 # Compiled JavaScript (generated)
├── package.json          # Project configuration
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

发展

  1. 做出更改至 src/index.ts
  2. pnpm run build 编译
  3. 用(工具/方法)测试你的服务器 pnpm start
  4. 使用安装脚本来更新您的MCP客户端配置

下一步行动

  1. 更新 package.json 附上您的项目详情
  2. 自定义服务器名称和工具 src/index.ts
  3. 添加您自己的工具、资源和提示
  4. 根据需要与外部API或数据库集成

许可证

麻省理工学院(MIT)

目录标签

目录标签

服务器模板JavaScriptClaudeAI工具开发本地部署TypeScript支持MCP协议AI集成

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP