Skip to main content
Glama
appare45

github-token-mcp

by appare45

github-token-mcp

spec.md 的实现。一个专用的主机端 MCP 服务器,用于按需为 devcontainer 内的代理颁发 GitHub App 安装访问令牌。

技术构成

  • MCP server: 使用 @modelcontextprotocol/server v2(createMcpHandler + McpServer)通过 Streamable HTTP 提供服务

  • GitHub App 认证: 使用 @octokit/auth-appcreateAppAuth(不自行实现 JWT 生成和令牌交换)

  • 私钥获取: 使用 @1password/sdkDesktopAuth — 每次请求时通过 1Password 桌面应用触发生物认证/系统认证提示,而非 CLI 子进程调用

  • Bearer 认证: 使用 @modelcontextprotocol/expressrequireBearerAuth。devcontainer 端使用固定的共享令牌进行认证

Related MCP server: GitHub MCP Server

设置

npm install
cp .env.example .env  # 値を埋める
  • GITHUB_APP_ID / GITHUB_APP_INSTALLATION_ID: 目标 GitHub App / 安装

  • GITHUB_APP_PRIVATE_KEY_OP_REF: 私钥的 1Password 密钥引用(op://vault/item/field

  • OP_ACCOUNT_NAME: 1Password 桌面应用侧边栏中显示的账户名(用于 DesktopAuth

  • MCP_BEARER_TOKEN: devcontainer 端通过 Authorization: Bearer <token> 提供的共享密钥

需要在 1Password 桌面应用端启用 Settings > Developer > Integrate with other apps

npm run dev    # tsx watch で起動
npm run build && npm start

实现状态(概要)

  • get_installation_token 工具的类型定义与输入验证

  • 仓库覆盖范围验证 → repo_not_installed

  • 权限子集验证 → permission_escalation_denied

  • 通过 1Password 获取私钥 → key_unavailable

  • 将令牌颁发委托给 @octokit/auth-appgithub_api_error

  • 通过 Streamable HTTP + Bearer 认证提供服务

  • 针对真实 GitHub App / 1Password 保管库的集成测试(需要人工准备认证信息)

  • devcontainer 端的使用模式(spec.md 中明确推迟处理)

目录结构

src/
  config.ts                       環境変数ロード
  errors.ts                       spec.md の4種類のエラーコードに対応するTokenError
  op-secret.ts                    1Password DesktopAuth 経由の秘密鍵取得
  github-auth.ts                  installation repos/permissions 検証 + createAppAuth 呼び出し
  tools/get-installation-token.ts get_installation_token ツール本体
  server.ts                       McpServer ファクトリ(ツール登録)
  index.ts                        HTTPエントリポイント(bearer認証 + createMcpHandler配信)
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
<1hResponse time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    Enables access to GitHub repositories and data through the GitHub API. Supports retrieving repositories, issues, pull requests, and searching code across GitHub with authentication via personal access tokens.
  • F
    license
    -
    quality
    D
    maintenance
    Mints short-lived, scoped GitHub App installation tokens on demand for AI agents to access git repositories or the GitHub API.
  • F
    license
    -
    quality
    D
    maintenance
    Provides GitHub App authentication for Git and API operations, enabling temporary token generation for private repository access.

View all related MCP servers

Related MCP Connectors

  • Issue, rotate and revoke scoped API-key passes for 25+ providers — the agent never sees a real key

  • Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

View all MCP Connectors

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/appare45/github-token-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server