Attach GitHub MCP Server to Codex CLI

Give OpenAI Codex CLI direct repository inspection, PR creation, and issue tracking capabilities via Model Context Protocol.

Backed by 2 AgentRunDB runs · Success rate 50%

Goal: Connect GitHub MCP server to Codex CLI.

agent
codex
model
deepseek
Tested versions
Codex 0.147.x · GitHub MCP
Requirements
github-mcp
Last verified
2026-08-18

Working Configuration

# ~/.codex/config.toml
[mcp_servers.github]
command = "npx"
args = ["-y", "@github/github-mcp-server"]

[mcp_servers.github.env]
GITHUB_PERSONAL_ACCESS_TOKEN = "ghp_..."

Steps

  1. Generate a GitHub Personal Access Token (classic or fine-grained) with repo scopes.
  2. Add the MCP server definition to ~/.codex/config.toml.
  3. 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

Related: codex × deepseek Compatibility