MCP Add Server
A minimal Model Context Protocol (MCP) server that provides a simple add(a, b)
tool. This project serves as a basic example of an MCP server implementation.
Features
- Implements a Model Context Protocol compliant server.
- Provides a single tool:
add(a, b)
which returns the sum of two numbers. - Available on npm for easy installation and use.
实际运行效果 (Showcase)
下图展示了 mcp-add-server
在 mcp.so
服务发现平台上的配置信息,以及一个兼容 MCP 的聊天机器人 (例如 Cherry Studio) 成功调用本服务器的 add
工具来执行加法运算的场景:
- 左侧:
mcp-add-server
在mcp.so
上的信息,展示了其概述和启动配置。 - 右侧: 一个 MCP 客户端 (例如 Cherry Studio 这样的聊天机器人) 接收到用户关于加法的请求后,调用了
@zhefang/mcp-add-server
提供的add
工具,并正确返回了计算结果。
这清晰地演示了遵循 Model Context Protocol 的服务器和客户端之间如何无缝集成和协作。
Prerequisites
- Node.js (version 18.x.x or higher recommended)
- npm (comes with Node.js)
Installation
Quick Start (Recommended)
The easiest way to use this MCP server is with npx
:
Global Installation
For frequent use, install globally:
Then run:
Development Setup
- Clone the repository:
- Install dependencies:
- Run locally:
Usage
There are several ways to run the mcp-add-server
:
1. Using npx
(Recommended for most users):
This command will download the latest version of @zhefang/mcp-add-server
and execute it.
2. Global installation (for frequent use):
3. Running from a cloned repository:
After cloning the repository and installing dependencies:
4. Local linking for development: In the project's root directory:
Once the server is running, it will be available to MCP clients via stdio transport.
Client Example
The src/client.js
file demonstrates how to connect to the server:
Example Tool Call (JSON)
The server responds with:
Running Tests
(When tests are added, describe how to run them here)
(Currently, npm test
will output "Error: no test specified". Update the test
script in package.json
when tests are added.)
Project Structure
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.
License
This project is licensed under the MIT License.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Ein minimaler Model Context Protocol-Server, der ein einfaches Add(a, b)-Tool zum Berechnen der Summe zweier Zahlen bereitstellt.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA simple Model Context Protocol server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models.Last updated -4
- -securityAlicense-qualityA simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.Last updated -69GPL 3.0
- AsecurityFlicenseAqualityA simple Model Context Protocol server that provides standardized tool functionality, currently implementing a basic calculator for adding two numbers together.Last updated -2598
- AsecurityFlicenseAqualityA simple server that provides basic mathematical operations (sum and subtraction) through the Model Context Protocol.Last updated -21