Attach GitHub MCP Server to Codex CLI
Give OpenAI Codex CLI direct repository inspection, PR creation, and issue tracking capabilities via Model Context Protocol.
● 由 2 次 AgentRunDB 真实运行支撑 · 成功率 50%
目标: Connect GitHub MCP server to Codex CLI.
- agent
- codex
- model
- deepseek
- 测试版本
- Codex 0.147.x · GitHub MCP
- 依赖
- github-mcp
- 最后验证
- 2026-08-18
可用配置
# ~/.codex/config.toml [mcp_servers.github] command = "npx" args = ["-y", "@github/github-mcp-server"] [mcp_servers.github.env] GITHUB_PERSONAL_ACCESS_TOKEN = "ghp_..."
Steps
- Generate a GitHub Personal Access Token (classic or fine-grained) with repo scopes.
- Add the MCP server definition to
~/.codex/config.toml. - Start a Codex session:
codex "List the open PRs in this repo and summarize them".
Capabilities Unlocked
- List & search issues and pull requests
- Inspect repository directory trees and commits
- Read file contents directly from remote branches