MCP 入门服务器
用于构建 AI 助手工具的极简ModelContextProtocol服务器模板。此入门模板提供了创建可与 Claude 等 AI 助手配合使用的 MCP 工具的基本结构。
特征
- 简单的“hello world”工具示例
- TypeScript + esbuild 设置
- 预配置的开发工具
设置以使用 Claude 进行构建和运行
- 从claude.ai/download下载并安装 Claude 桌面应用程序
- 克隆 repo、安装依赖项并构建:
- 配置 Claude 使用此 MCP 服务器。如果这是您的第一个 MCP 服务器,请在项目的根目录中运行:
这应该会导致您的claude_desktop_config.json
中出现如下条目:
如果您已有 MCP 服务器,请将mcp-starter
块添加到现有配置中��需要注意的是, args
是<path_to_repo_on_your_machine>/mcp-starter/dist/index.cjs
的路径。
- 重新启动 Claude Desktop。
- 在 Claude 的界面中查找带有可用工具数量的锤子图标,以确认服务器正在运行。
- 如果一切顺利,您应该能够使用
npm run dev
开发您的 MCP 服务器,并在 Claude 中测试它。每次重启 Claude 时,您都需要重启 MCP 服务器。
使用 Inspector 进行开发
您可以使用 MCP Inspector 工具进行开发和调试。该工具提供了一个可视化界面,用于测试和监控 MCP 服务器的交互。
请访问Inspector 文档以获取详细的设置说明。
使用 Inspector 进行本地测试:
要基于文件更改进行构建,请运行:
或者同时运行观察者和检查者:
出版
一旦您准备好分发服务器,一切都很简单!
- 设置NPM帐户。
- 运行
npm publish
。这将使用package.json
中的项目名称发布一个包 - 一旦发布,其他人就可以使用如下配置条目安装服务器:
可用工具
服务器提供:
hello_tool
:一个简单的示例工具,它接受一个名称参数并返回问候语
创建新工具
要添加新工具:
- 在
index.ts
中定义工具架构 - 将其添加到
ListToolsRequestSchema
处理程序中的工具数组中 - 在
CallToolRequestSchema
处理程序中添加实现
请参阅hello_tool
实现作为示例。
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
该服务器提供了一个使用 ModelContextProtocol 创建 AI 助手工具的最小模板,其中包含一个简单的“hello world”工具示例和用于构建自定义 MCP 工具的开发设置。
Related Resources
Related MCP Servers
- -securityFlicense-qualityA TypeScript-based starter template for building Model Context Protocol servers that enables AI assistants to dynamically call tools, interpret prompts, and manage resources through modular architecture with support for multiple transport methods.Last updated -TypeScript
- -securityAlicense-qualityA template for building Model Context Protocol servers that allow AI assistants to interact with custom data and services through queryable resources and specialized tools.Last updated -TypeScriptMIT License
- AsecurityFlicenseAqualityA demonstration server based on Model Context Protocol (MCP) that showcases how to build custom tools for AI assistants, providing mathematical calculation and multilingual greeting capabilities.Last updated -3TypeScript
- -securityFlicense-qualityA starter template for building Model Context Protocol servers that can integrate AI assistants with custom tools, resource providers, and prompt templates.Last updated -JavaScript
Appeared in Searches
- Proof-of-Concept Examples for Multi-Component Processes (Model Context Protocol)
- List of This Week's 15 Most Popular Free Minecraft Servers
- A customizable and widely supported Minecraft server
- Setting Up AI Employee Tools on Docker Containers with MCP Servers
- Free and easy-to-setup Minecraft server hosting for solo web developers