Skip to main content
Glama
slackwarecps

MCP Simple Server

by slackwarecps

MCP Simple Server (HTTPブリッジ)

これは、HTTP POSTインターフェースを通じてツールを公開する簡略化されたMCP (Model Context Protocol) サーバーです。トンネルや直接アクセスを通じて、リモートのLLMやエージェントがローカルまたは特定の機能に安全にアクセスできるようにします。

🚀 技術設定

  • ポート: 3030

  • エンドポイント: /mcp

  • メソッド: POST

  • 認証: Authorization: Bearer senha-facil-123

  • プロトコル: JSON-RPC 2.0 (HTTP用に調整)


Related MCP server: local-env-mcp

🧪 CURLによるリモートテスト

以下のコマンドを使用して、ネットワークアクセス(またはWireguard VPN経由)がある任意のマシンからサーバーの動作を確認できます。

1. 利用可能なツールを一覧表示

curl -X POST http://10.7.0.1:3030/mcp \
  -H "Authorization: Bearer senha-facil-123" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

2. 'hello'ツールを呼び出す

curl -X POST http://10.7.0.1:3030/mcp \
  -H "Authorization: Bearer senha-facil-123" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"hello","arguments":{"name":"Fabão"}},"id":2}'

♊ Gemini-CLIの設定 (リモート)

ローカルマシンや他のVPS上の gemini-cli がこのサーバーにアクセスできるようにするには、Gemini CLIの設定ファイル(通常は ~/.gemini/config.yaml またはコマンド経由)で設定する必要があります。

このサーバーは直接HTTPを使用するため(stdio標準ではありません)、ラッパーを使用するか、サーバーが拡張されている場合はSSE経由のアクセスを設定するか、利用可能な場合はfetchプラグインを使用できます。

設定例 (stdio-to-httpプロキシを使用する場合):

# No gemini-cli


gemini mcp add remote-server --command "npx @modelcontextprotocol/inspector http://10.7.0.1:3030/mcp"

~/.gemini/settings.json ファイル内

"mcpServers": {                                                                                                                      
    "local-mcp": {                                                                                                                                     
      "url": "http://192.168.1.100:3030/mcp",                                                                                                          
      "headers": {                                                                                                                                     
        "Authorization": "Bearer senha-facil-123"                                                                                                      
      }                                                                                                                                                
    }             
  }

注: IPアドレスを正しいもの(例: VPNの10.7.0.1)に置き換えてください。


🤖 Claude Codeの設定

Claude Code (およびClaude Desktop) は通常、ローカルコマンドを想定しています。このリモートサーバーにアクセスするには:

  1. claude_desktop_config.json ファイルを編集します:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Linux: ~/.config/Claude/claude_desktop_config.json

  2. 設定を追加します:

{
  "mcpServers": {
    "mcp-simple-server": {
      "command": "curl",
      "args": [
        "-s",
        "-X", "POST",
        "http://10.7.0.1:3030/mcp",
        "-H", "Authorization: Bearer senha-facil-123",
        "-H", "Content-Type: application/json",
        "-d", "{\"jsonrpc\":\"2.0\",\"method\":\"tools/call\",\"params\":<params>}"
      ]
    }
  }
}

ヒント: より堅牢な統合のために、stdioをサーバーのHTTP APIに変換する mcp-proxy を使用することをお勧めします。


💬 ChatGPTの設定 (GPT Codex / Actions)

このサーバーをChatGPTの Action として使用するには:

  1. Custom GPTs -> Create a GPT -> Configure -> Create new action に移動します。

  2. Authentication フィールドで API Key を選択し、Bearer を選択して senha-facil-123 を入力します。

  3. Schema フィールドに、OpenAPI仕様(以下の簡略化された例)を使用します:

openapi: 3.0.0
info:
  title: MCP Simple Server
  version: 1.0.0
servers:
  - url: http://195.35.42.89:3030 # IP Público ou DNS
paths:
  /mcp:
    post:
      operationId: callMcpTool
      summary: Chama uma ferramenta do MCP
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method: {type: string, example: "tools/call"}
                params: {type: object}
                id: {type: integer, example: 1}
      responses:
        '200':
          description: Sucesso

🐳 Docker

このプロジェクトはコンテナで実行する準備ができています。

1. イメージのビルド

Dockerイメージをローカルで生成するには:

docker build -t mcp-simple-server .

2. コンテナの起動 (Docker Compose)

推奨される実行方法は、ネットワークと環境変数を設定する付属の docker-compose.yml を使用することです:

docker compose up -d

コンテナは mcp-simple-server という名前で作成され、ポート 3030 で利用可能になります。

3. ステータスとログの確認

# Ver se o container está rodando
docker ps | grep mcp-simple-server

# Ver logs do servidor
docker compose logs -f

🛠️ 開発

サーバーをローカルで実行するには:

cd ~/apps/mcp-simple-server
npm install
node server.js

サーバーは http://localhost:3030 でリッスンします。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables remote access to the MemPalace MCP server via HTTP, supporting bearer token authentication and concurrent clients while exposing all mempalace tools.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Lifts local stdio MCP servers into remote Streamable HTTP endpoints for cloud-hosted AI clients, with bearer-token auth and tool policy filtering.
    9 npm
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Converts any MCP server into simple HTTP endpoints, enabling AI agents that only support HTTP (like ChatGPT Custom GPT or web_fetch) to use MCP tools.
    -