MCP Add Server

Integrations

  • Implements a Model Context Protocol server using Node.js runtime, enabling deployment as a Node.js application.

  • Supports distribution and installation through the npm package registry, allowing users to easily install and run the server using npm commands.

MCP 添加服务器

一个极简的模型上下文协议 (MCP) 服务器,提供一个简单的add(a, b)工具。该项目是 MCP 服务器实现的一个基本示例。

特征

  • 实现符合模型上下文协议的服务器。
  • 提供一个工具: add(a, b) ,返回两个数字的和。

先决条件

  • Node.js(建议使用 18.xx 或更高版本)
  • npm(Node.js 附带)

安装

  1. 克隆存储库:
    git clone <你的仓库URL> # 当你推送到 GitHub 后,替换这里的 URL cd mcp-add-server
  2. 安装依赖项:
    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 许可

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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

最小模型上下文协议服务器,提供一个简单的 add(a, b) 工具来计算两个数字的和。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 示例工具调用(概念)
        2. 运行测试
          1. 项目结构
            1. 贡献
              1. 执照

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A server that provides tools for performing basic arithmetic operations (addition, subtraction, multiplication, division) via the Model Context Protocol.
                  Last updated -
                  4
                  JavaScript
                  • Apple
                • A
                  security
                  F
                  license
                  A
                  quality
                  A simple server that provides basic arithmetic operations (addition, subtraction, multiplication, division) as tools that can be called by Large Language Models through the Model Context Protocol.
                  Last updated -
                  4
                  JavaScript
                • A
                  security
                  F
                  license
                  A
                  quality
                  A 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
                  JavaScript
                • -
                  security
                  -
                  license
                  -
                  quality
                  A simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.
                  Last updated -
                  3
                  Python
                  GPL 3.0

                View all related MCP servers

                ID: i1ca4pr3ca