github-mcp-adapter

説明なし

GitHubスター

0

ユーザー評価

未評価

フォーク

0

イシュー

0

閲覧数

1

お気に入り

0

README
GitHub MCP Adapter

This Node.js server dynamically exposes GitHub MCP tools as REST endpoints. It launches the MCP server as a subprocess over stdio and serves a Swagger/OpenAPI interface for calling tools like create-issue, get-repo, etc.

Features
  • 🧰 Dynamically registers routes for all MCP tools (e.g., /tools/create-issue)
  • 📜 Auto-generates OpenAPI spec (/openapi.json)
  • 🧪 Swagger UI at /docs for quick testing
  • 🔁 Pipes all requests through the MCP server over stdio

Prerequisites
  • Node.js 18+

  • Docker (optional but recommended)

  • A GitHub Personal Access Token

  • Python with MCP installed (if running without Docker):

    pip install github-mcp
    

Setup
git clone https://github.com/your-org/mcp-node-adapter.git
cd mcp-node-adapter
npm install
cp .env.example .env
# Edit .env to include your GitHub token

Option A: Run With Docker MCP Backend (Recommended)

Build the MCP server:

git clone https://github.com/github/github-mcp-server.git
cd github-mcp-server
docker build -t github-mcp-server .

Start the adapter and pipe output from Docker:

docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_yYV9IiFqm0RCbr61EFh63Wmoyg4RvIzv \
  github-mcp-server stdio | node index.js

Option B: Run With Local MCP (Python)

Make sure MCP is installed:

pip install github-mcp

Then simply run:

npm start

This will spawn python3 -m mcp.__main__ as a subprocess.


Endpoints
Method Path Description
POST /tools/<tool-name> Call a specific MCP tool
GET /openapi.json OpenAPI 3.0 spec for all tools
GET /docs Swagger UI for testing

Example:

curl -X POST http://localhost:3000/tools/create-issue \
  -H "Content-Type: application/json" \
  -d '{"title": "Bug report", "repository": "octocat/hello-world"}'

Use with Kong AI Gateway

This adapter supports /openapi.json and REST POST calls, which can be integrated into Kong AI Gateway’s ai-proxy plugin by referencing the spec and enabling route_type: llm/v1/chat.

作者情報

0

フォロワー

16

リポジトリ

0

Gist

3

貢献数

トップ貢献者

スレッド