local-mcp-server-sample

qwerty0121/local-mcp-server-sample

3.1

If you are the rightful owner of local-mcp-server-sample and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This document provides a comprehensive guide to setting up and using a local MCP server.

local-mcp-server-sample

概要

以下のサイトをもとに作成した MCP サーバー。

Build an MCP server - Model Context Protocol

ビルド手順

MCP サーバーを起動する前に以下のコマンドでビルドする必要がある。

npm run build

VSCode への MCP サーバーの追加方法

.vscode/mcp.json に以下を追加する。

{
  "servers": {
    "local-mcp-server-sample": {
      "command": "node",
      "args": [`${本リポジトリの絶対パス}/build/index.js`]
    }
  }
}

{
  "servers": {
    "local-mcp-server-sample": {
      "command": "node",
      "args": [
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/local-mcp-server-sample/build/index.js"
      ]
    }
  }
}

MCP サーバーを試す際の質問例

  • サクラメントの天気は?
  • テキサスの現在のアラートは?

MCP Inspector の起動方法

npx @modelcontextprotocol/inspector node ${本リポジトリの絶対パス}/build/index.js

# 例
# npx @modelcontextprotocol/inspector node /ABSOLUTE/PATH/TO/PARENT/FOLDER/local-mcp-server-sample/build/index.js