Skip to main content
Glama

MCP サーバーの追加

シンプルなadd(a, b)ツールを提供する、最小限のモデルコンテキストプロトコル(MCP)サーバー。このプロジェクトは、MCPサーバーの実装の基本的な例として機能します。

特徴

  • モデルコンテキストプロトコルに準拠したサーバーを実装します。

  • 2 つの数値の合計を返す単一のツールadd(a, b)を提供します。

Related MCP server: MCP Server Basic Example

前提条件

  • Node.js(バージョン18.xx以上を推奨)

  • npm (Node.js に付属)

インストール

  1. リポジトリをクローンします。

    git clone <你的仓库URL> # 当你推送到 GitHub 后,替换这里的 URL cd mcp-add-server
  2. 依存関係をインストールします:

    npm install

使用法

mcp-add-serverを実行するにはいくつかの方法があります。

1.

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

(現在、

プロジェクト構造

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

貢献

貢献を歓迎します!お気軽にプルリクエストを送信したり、問題を報告してください。

ライセンス

このプロジェクトはMIT ライセンスに基づいてライセンスされています。

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

Tools

Latest Blog Posts

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