MCP Add Server
MCP 添加服务器
一个极简的模型上下文协议 (MCP) 服务器,提供一个简单的add(a, b)工具。该项目是 MCP 服务器实现的一个基本示例。
特征
实现符合模型上下文协议的服务器。
提供一个工具:
add(a, b),返回两个数字的和。
Related MCP server: Basic Math MCP Server
先决条件
Node.js(建议使用 18.xx 或更高版本)
npm(Node.js 附带)
安装
克隆存储库:
git clone <你的仓库URL> # 当你推送到 GitHub 后,替换这里的 URL cd mcp-add-server安装依赖项:
npm install
用法
有几种方法可以运行mcp-add-server :
1.使用npx (推荐大多数用户使用):
如果您已经安装了 Node.js 和 npm,则可以直接运行服务器,而无需克隆或全局安装:
npx mcp-add-server此命令将下载最新版本的mcp-add-server (如果尚未缓存)并执行它。
2. 从克隆的存储库运行:
克隆存储库并安装依赖项后(请参阅安装):
npm start这使用package.json中定义的start脚本。
3.全局安装(适合频繁使用或者开发):
您可以全局安装该包:
npm install -g . # From the cloned repository directory
# or once published to npm:
# npm install -g mcp-add-server然后您可以从任何目录运行它:
mcp-add-server**4. 本地链接用于开发:**在项目根目录下,运行npm link 。这将使mcp-add-server命令全局可用,并指向本地项目文件。
# In project directory
npm link
# Then, in any directory:
mcp-add-server一旦服务器运行(无论使用何种方法),它将可供 MCP 客户端使用。
示例工具调用(概念)
MCP 客户端可以像这样调用add工具(具体情况取决于客户端实现):
{
"tool_name": "add",
"arguments": {
"a": 5,
"b": 3
}
}服务器将响应:
{
"result": 8
}运行测试
(添加测试时,请在此处描述如何运行它们)
npm test(目前, npm test将输出“错误:未指定测试”。添加测试时,请更新package.json中的test脚本。)
项目结构
mcp-add-server/
├── .git/ # Git directory
├── .gitignore # Specifies intentionally untracked files that Git should ignore
├── .cursor/ # Cursor specific files (if any)
├── node_modules/ # Project dependencies
├── src/ # Source code
│ └── server.js # Main server logic
├── bin.js # Executable for the server
├── LICENSE # Project license
├── package-lock.json # Records exact versions of dependencies
├── package.json # Project metadata and dependencies
└── README.md # This file贡献
欢迎贡献代码!欢迎提交 Pull 请求或创建 issue。
执照
该项目已获得MIT 许可。
Maintenance
Tools
- addD
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA minimal example server implementing the Model Context Protocol, providing addition and multiplication tools for learning and experimentation with MCP clients.1
- FlicenseBqualityDmaintenanceA simple server that provides basic mathematical operations (sum and subtraction) through the Model Context Protocol.21
- AlicenseNot gradedqualityDmaintenanceA minimal, production-ready MCP server with a simple addition calculator tool that demonstrates integration with the Model Context Protocol.101MIT
- FlicenseBqualityNot gradedmaintenanceA minimal Model Context Protocol server that provides a simple tool for adding two integers. It serves as a demonstration of the official Python MCP SDK and is designed for local execution via stdio.1
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhangzhefang-github/mcp-add-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server