demo-github

demo-github

MCP server that connects to the GitHub API to list and create issues, comment on issues, and list pull requests with diff summaries. It enables natural language management of GitHub repositories from MCP-compatible clients.

Category
访问服务器

README

@mcpforge/demo-github

Public demo of the MCP Connector Starter Kit: connects the GitHub API (issues and pull requests) as a real MCP server, callable from Claude Desktop, Claude.ai, or any host compatible with Model Context Protocol.

This demo isn't a mock — it talks directly to https://api.github.com using your own token. It's proof that the starter kit works against a real external API, not just sample data.

Note: this repo shows real, tested source for the demo connector. The underlying @mcpforge/starter-kit engine it's built on (auth, auditing, transport, redaction, validation) is the paid product — this repo won't build standalone without it. Want the full kit or a connector built for your own SaaS? Get in touch.

Exposed tools

Tool Scope What it does
github_list_issues read Lists issues (open/closed/all) for a repo
github_create_issue write Creates a new issue
github_comment_on_issue write Comments on an existing issue
github_list_pull_requests read Lists pull requests (open/closed/all) for a repo
github_get_pull_request_diff_summary read Summarizes a PR: files changed, +/- lines (no full diff)

1. Generate a GitHub token

Go to GitHub → Settings → Developer settings → Personal access tokens.

Recommended: Fine-grained tokens → "Generate new token":

  • Repository access: select only the repo(s) you want to test the connector against (don't grant access to all your repos unless you need to).
  • Permissions → Repository permissions:
    • Issues: Read and write (needed for github_create_issue and github_comment_on_issue)
    • Pull requests: Read-only (this demo only reads PRs, never modifies them)

Simpler but broader alternative: a classic token with the repo scope (or public_repo if you'll only use it against public repositories).

Copy the generated token — GitHub only shows it once.

2. Install

cd demo
cp .env.example .env
# edit .env and paste your token into GITHUB_TOKEN
npm install

npm install resolves @mcpforge/starter-kit as a local dependency (file:../product). Make sure product/ is built (cd ../product && npm run build) before installing here.

3. Run locally (stdio)

npm run dev

This starts the MCP server over stdio (the same transport Claude Desktop uses for local servers). It needs GITHUB_TOKEN in the environment — npm run dev picks it up from .env if your shell loads it, or export it manually:

export GITHUB_TOKEN=ghp_xxxxxxxxxxxx
npm run dev

To run it in HTTP mode (Streamable HTTP, for remote deployment):

npm run dev -- --transport=http --port=8080

4. Test it with the MCP Inspector

Before wiring up a real LLM, verify the server responds correctly with the official Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

(or, to test straight from TypeScript without building: npx @modelcontextprotocol/inspector npx tsx src/index.ts)

The Inspector opens a browser UI where you can list tools, inspect their schemas, and invoke them manually with test parameters (e.g. github_list_issues with owner: "anthropics", repo: "claude-code", state: "open").

5. Connect to Claude Desktop

Build first:

npm run build

Then edit your Claude Desktop config (Settings → Developer → Edit Config) and add:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["/absolute/path/to/mcpforge/demo/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    }
  }
}

Restart Claude Desktop. You should see all 5 github_* tools available in the tool picker.

Design notes

  • Every tool normalizes GitHub's response before returning it — the API's raw JSON or an uninterpreted error never reaches the model (see src/lib/github-client.ts).
  • github_get_pull_request_diff_summary deliberately does not return the line-by-line diff — only the file summary + line totals, so a large PR doesn't flood the model's context.
  • github_list_issues filters out the pull requests GitHub's API mixes into the /issues endpoint (native GitHub behavior, not a bug in this tool).
  • Auth headers come from ctx.authHeaders (built by the starter kit's engine from the connector's AuthConfig) — this demo doesn't re-derive Authorization: Bearer by hand, it uses the kit's own abstraction, same as any connector built with it would.

Verified working

Built and tested end-to-end against the real @mcpforge/starter-kit engine and the real GitHub API: npm install && npm run build passes clean from a fresh install, and a real MCP client (list_tools / call_tool) confirms all 5 tools register with correct schemas and normalized error handling.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选