github-token-mcp
github-token-mcp
spec.md 的实现。一个专用的主机端 MCP 服务器,用于按需为 devcontainer 内的代理颁发 GitHub App 安装访问令牌。
技术构成
MCP server: 使用
@modelcontextprotocol/serverv2(createMcpHandler+McpServer)通过 Streamable HTTP 提供服务GitHub App 认证: 使用
@octokit/auth-app的createAppAuth(不自行实现 JWT 生成和令牌交换)私钥获取: 使用
@1password/sdk的DesktopAuth— 每次请求时通过 1Password 桌面应用触发生物认证/系统认证提示,而非 CLI 子进程调用Bearer 认证: 使用
@modelcontextprotocol/express的requireBearerAuth。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-app→github_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配信)This server cannot be installed
Maintenance
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
- Alicense-qualityCmaintenanceA web application for securely managing GitHub tokens and providing centralized access to various development tools integrated with GitHub accounts.44MIT
- Flicense-qualityDmaintenanceEnables 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.
- Flicense-qualityDmaintenanceMints short-lived, scoped GitHub App installation tokens on demand for AI agents to access git repositories or the GitHub API.
- Flicense-qualityDmaintenanceProvides GitHub App authentication for Git and API operations, enabling temporary token generation for private repository access.
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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