Skip to content

docs(mcp): update GitHub MCP server guide to use official server#40

Open
dealako wants to merge 3 commits intomainfrom
feat/github-mcp-updates
Open

docs(mcp): update GitHub MCP server guide to use official server#40
dealako wants to merge 3 commits intomainfrom
feat/github-mcp-updates

Conversation

@dealako
Copy link
Copy Markdown
Collaborator

@dealako dealako commented Mar 30, 2026

Closes #41

Summary

  • Replaces the deprecated @modelcontextprotocol/server-github npm package (deprecated April 2025) with the official ghcr.io/github/github-mcp-server image
  • Adds three Claude Code setup options: remote HTTP endpoint (recommended for 2.1.1+), local Docker, and binary
  • Updates Cursor AI configuration to use the Docker image instead of the deprecated npm package
  • Adds a Troubleshooting section covering auth, remote server, Docker, and startup issues
  • Updates .markdownlint.json to exempt code blocks and tables from the line-length rule (MD013)

Related Issues

Test plan

  • Verify markdownlint mcp/github.md passes with no errors
  • Follow Option 1 (remote server) setup on Claude Code 2.1.1+ and confirm GitHub MCP connects
  • Confirm claude mcp list and claude mcp get github return expected output after setup
  • Validate Cursor AI Docker config loads GitHub MCP with a green dot in MCP settings

🤖 Generated with Claude Code

@dealako dealako added the ai-assisted A task or activity that was supported by AI, such as CoPilot, ChatGPT, or other AI technology. label Mar 30, 2026
Copilot AI review requested due to automatic review settings March 30, 2026 19:38
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Walkthrough

Reformatted .markdownlint.json rule entries (expanded MD013 to include code_blocks: false and tables: false) and replaced deprecated npm-based GitHub MCP instructions in mcp/github.md with official ghcr.io/github/github-mcp-server guidance, adding remote (HTTP), local Docker, and binary/stdio Claude Code setup, plus validation, troubleshooting, and references.

Changes

Cohort / File(s) Summary
Markdown Linting Configuration
​.markdownlint.json
Reformatted inline rule entries into multi-line JSON objects. Expanded MD013 from line_length: 120 to include code_blocks: false and tables: false. Rewrote MD003, MD007, and MD024 formatting without changing semantics. Added trailing newline.
GitHub MCP Documentation
mcp/github.md
Replaced deprecated npm-based @modelcontextprotocol/server-github/npx instructions with ghcr.io/github/github-mcp-server. Added three Claude Code setup options: remote HTTP (Authorization: Bearer), local Docker run, and binary/stdio. Updated validation commands (claude mcp list / claude mcp get github), switched Cursor AI example to Docker usage, and added troubleshooting and reference links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating the GitHub MCP server guide to use the official server instead of the deprecated npm package.
Description check ✅ Passed The description is directly related to the changeset, providing a clear summary of changes across both files and explaining the rationale for the updates.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #41: replaces deprecated npm package with official Docker image, documents three Claude Code setup options, updates Cursor AI config, adds troubleshooting section, and updates markdownlint.json formatting.
Out of Scope Changes check ✅ Passed All changes are in scope: the mcp/github.md documentation updates and .markdownlint.json formatting changes directly support the objective of replacing deprecated npm package with official server guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/github-mcp-updates

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub MCP setup documentation to migrate off the deprecated @modelcontextprotocol/server-github npm package and standardize on the official ghcr.io/github/github-mcp-server (plus a hosted remote HTTP option), while adjusting markdownlint settings to accommodate longer code blocks and tables.

Changes:

  • Replaces deprecated npm-based GitHub MCP setup with official server options (remote HTTP, local Docker, binary).
  • Updates Cursor AI MCP configuration to use the official Docker image.
  • Adds troubleshooting guidance and relaxes markdownlint MD013 for code blocks/tables.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
mcp/github.md Updates GitHub MCP installation/configuration guidance to use the official server, adds multiple setup paths and troubleshooting.
.markdownlint.json Adjusts MD013 to ignore line length for code blocks and tables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.markdownlint.json:
- Around line 9-13: The MD013 rule in .markdownlint.json currently disables
enforcement for code_blocks and tables, which lets Markdown lines exceed the
120-character limit; update the MD013 configuration (the "MD013" object) to
enforce line_length for code_blocks and tables (remove the "code_blocks" and
"tables" false entries or set them to true) so Markdown line-length remains
enforced to 120 characters across regular text, code blocks, and tables.

In `@mcp/github.md`:
- Around line 54-55: Wrap the long claude mcp add-json commands to respect the
Markdown line-length policy by breaking after the command and using a shell
line-continuation backslash, e.g., split the invocation for both occurrences of
the claude mcp add-json github and claude mcp add-json --scope user github
examples so the JSON payload starts on the next indented line; ensure you keep
the full JSON string intact, escape nothing further, and maintain the
surrounding triple-backtick bash fences.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a66c71fc-9a5f-4389-b1e6-30ee914e329e

📥 Commits

Reviewing files that changed from the base of the PR and between 95afe78 and a972d98.

📒 Files selected for processing (2)
  • .markdownlint.json
  • mcp/github.md

Replace deprecated @modelcontextprotocol/server-github (deprecated April 2025)
with the official GitHub MCP server. Add three setup options for Claude Code:
remote HTTP endpoint (recommended), local Docker, and binary. Update Cursor AI
config to use Docker image. Add troubleshooting section and exempt code blocks
and tables from markdownlint line-length checks.

Closes: #41

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: David Deal <ddeal@linuxfoundation.org>
@dealako dealako force-pushed the feat/github-mcp-updates branch from a972d98 to ae4aff3 Compare March 30, 2026 19:46
@dealako dealako requested review from bramwelt and jordane March 30, 2026 19:47
@dealako dealako self-assigned this Mar 30, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mcp/github.md`:
- Around line 5-12: Update the expected output in mcp/claude-context.md where
the list of available MCP servers includes "@modelcontextprotocol/server-github"
(the entry referenced around the current expected-output block, ~line 275): mark
that package as deprecated (add "deprecated as of April 2025") and replace or
augment the entry with the recommended official server reference
"ghcr.io/github/github-mcp-server" and/or the remote hosted endpoint guidance,
ensuring the expected output text matches the deprecation note in mcp/github.md.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3341ce53-e5dd-4a92-8e02-119cef0f6848

📥 Commits

Reviewing files that changed from the base of the PR and between a972d98 and ae4aff3.

📒 Files selected for processing (2)
  • .markdownlint.json
  • mcp/github.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .markdownlint.json

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
mcp/github.md (1)

54-55: ⚠️ Potential issue | 🟡 Minor

Wrap overlong claude mcp add-json command lines.

These lines still exceed the Markdown line-length policy and should be split for readability and lint compliance (Line 54, Line 66).

Proposed fix
 ```bash
-claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer $GITHUB_PERSONAL_ACCESS_TOKEN"}}'
+claude mcp add-json github \
+  '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'

@@

-claude mcp add-json --scope user github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'
+claude mcp add-json --scope user github \
+  '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'
</details>

As per coding guidelines, "Keep Markdown line length under 120 characters".


Also applies to: 66-67

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @mcp/github.md around lines 54 - 55, The long shell command usages of "claude
mcp add-json" exceed the Markdown line-length policy; split each overlong
command into two lines using a backslash continuation and place the JSON payload
on the next indented line (e.g., for both "claude mcp add-json github" and
"claude mcp add-json --scope user github") and replace the embedded token with a
placeholder like YOUR_GITHUB_PAT to keep lines <120 chars and improve
readability.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Inline comments:
In @mcp/github.md:

  • Around line 50-51: Replace the inconsistent token placeholder usage so Option
    1 examples use a single convention: change occurrences of
    $GITHUB_PERSONAL_ACCESS_TOKEN to YOUR_GITHUB_PAT (or vice versa if you prefer
    env var style) in the three command examples; update the command string that
    includes claude mcp add-json github and any adjacent instructive text so all
    examples consistently show the same placeholder (e.g., "YOUR_GITHUB_PAT") and
    match the explanatory sentence that tells users to replace it.

Duplicate comments:
In @mcp/github.md:

  • Around line 54-55: The long shell command usages of "claude mcp add-json"
    exceed the Markdown line-length policy; split each overlong command into two
    lines using a backslash continuation and place the JSON payload on the next
    indented line (e.g., for both "claude mcp add-json github" and "claude mcp
    add-json --scope user github") and replace the embedded token with a placeholder
    like YOUR_GITHUB_PAT to keep lines <120 chars and improve readability.

</details>

<details>
<summary>🪄 Autofix (Beta)</summary>

Fix all unresolved CodeRabbit comments on this PR:

- [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)
- [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Organization UI

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `c0ea05fe-c6c5-4c9f-92d4-79bf9b965435`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between ae4aff3dddcd0f107e73ddf73a22e132a22f2d67 and 5eadb4b035b54df727b4d2066b58a164b6db036e.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `mcp/github.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Signed-off-by: David Deal <ddeal@linuxfoundation.org>
@dealako dealako force-pushed the feat/github-mcp-updates branch from 5eadb4b to d6ef2ed Compare March 30, 2026 19:57
Signed-off-by: David Deal <ddeal@linuxfoundation.org>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
mcp/github.md (1)

48-67: ⚠️ Potential issue | 🟡 Minor

Inconsistent token placeholder naming in Option 1.

Line 50 instructs users to replace GITHUB_PERSONAL_ACCESS_TOKEN, but line 54 uses $GITHUB_PERSONAL_ACCESS_TOKEN (shell variable expansion syntax), while line 66 uses YOUR_GITHUB_PAT. This creates confusion:

  • If users don't export GITHUB_PERSONAL_ACCESS_TOKEN as an environment variable, line 54's command will pass an empty bearer token.
  • The text and examples should use the same placeholder convention.
🔧 Proposed fix for consistency
-Run the following command, replacing `GITHUB_PERSONAL_ACCESS_TOKEN` with your personal
+Run the following command, replacing `YOUR_GITHUB_PAT` with your personal
 access token:

 ```bash
-claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer $GITHUB_PERSONAL_ACCESS_TOKEN"}}'
+claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'

</details>

As per coding guidelines, documentation should be clear and consistent for users to follow.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @mcp/github.md around lines 48 - 67, Unify the token placeholder usage in the
Option 1 examples: pick a single placeholder name (e.g., YOUR_GITHUB_PAT) and
update every instance of GITHUB_PERSONAL_ACCESS_TOKEN,
$GITHUB_PERSONAL_ACCESS_TOKEN, and YOUR_GITHUB_PAT in the 'claude mcp add-json
github ...' command and the example with --scope to use that single form;
alternatively, if you want to show both literal token and environment variable
usage, provide two clear variants (one using Authorization":"Bearer
YOUR_GITHUB_PAT" and a second using Authorization":"Bearer
$GITHUB_PERSONAL_ACCESS_TOKEN" with a short note to export the env var), and
make the example with --scope user match the chosen variant exactly.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>mcp/github.md (2)</summary><blockquote>

`143-154`: **Consider adding cross-platform keyboard shortcuts.**

Line 152 mentions `CMD+I` for macOS, but doesn't include the Windows/Linux equivalent (`Ctrl+I`). Since Cursor AI is cross-platform, documenting both shortcuts improves accessibility.



<details>
<summary>🖥️ Proposed enhancement</summary>

```diff
 Additionally, you can generate a prompt to inquire about a specific GitHub
 pull request, issue, or repository. See the Validation section below for an
-example. Hit `CMD+I` to open the AI assistant within Cursor and enter a prompt
+example. Hit `CMD+I` (macOS) or `Ctrl+I` (Windows/Linux) to open the AI assistant within Cursor and enter a prompt
 to query GitHub (see [Validation section below](`#validation`)).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp/github.md` around lines 143 - 154, The doc currently only lists the macOS
shortcut "CMD+I" for opening the AI assistant; update the text in the paragraph
that mentions "Hit `CMD+I` to open the AI assistant within Cursor" to include
cross-platform equivalents (e.g., "CMD+I (macOS) / Ctrl+I (Windows/Linux)") so
users on all platforms see the correct shortcut; ensure the same change is
reflected wherever "CMD+I" appears (e.g., the Validation section and the "Open
MCP Settings" guidance) to keep shortcuts consistent across the MCP setup
documentation.

183-187: Clarify when Docker logout is needed.

Line 187 suggests running docker logout ghcr.io to clear stored credentials, but this may confuse users:

  1. The ghcr.io/github/github-mcp-server image is public and doesn't require authentication to pull.
  2. Most users won't have credentials cached for ghcr.io unless they've explicitly logged in.
  3. Logging out would only help if invalid/expired credentials are cached and preventing access.
📝 Proposed clarification
 **Docker Issues:**

 - Confirm Docker Desktop is running.
 - Pull the image manually: `docker pull ghcr.io/github/github-mcp-server`
-- Log out from GitHub Container Registry (clears stored credentials): `docker logout ghcr.io`
+- If you have cached credentials that may be invalid, clear them: `docker logout ghcr.io`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp/github.md` around lines 183 - 187, Clarify that the image
ghcr.io/github/github-mcp-server is public so authentication is not normally
required, and update the Docker Issues section to say to only run the command
`docker logout ghcr.io` if you have previously logged into ghcr.io and are
troubleshooting failed pulls due to cached/expired credentials; mention that
most users can skip the logout step unless they explicitly logged in or see
authentication errors when pulling the image.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mcp/github.md`:
- Around line 57-67: Add a security warning near the description of the
--scope/project behavior (.mcp.json) to warn users not to store secrets or
personal access tokens in project-scoped configs because they may be committed
to version control; instruct them to prefer --scope user or --scope local for
tokens, to use environment variables or a secret manager instead of embedding
Authorization headers in JSON, and to use placeholders in example commands
(e.g., YOUR_GITHUB_PAT) and mention adding .mcp.json to .gitignore if
project-scoped secrets are unavoidable.
- Around line 121-141: The Cursor AI config under mcpServers -> "github" uses
the placeholder "YOUR_PERSONAL_ACCESS_TOKEN" for the
GITHUB_PERSONAL_ACCESS_TOKEN env value which is inconsistent with other examples
that use "YOUR_GITHUB_PAT"; update the placeholder value to "YOUR_GITHUB_PAT"
(both in the env object and any example strings) so the "mcpServers", "github",
and "GITHUB_PERSONAL_ACCESS_TOKEN" entries match the Claude Code examples and
avoid confusion.
- Around line 72-80: Clarify the placeholder usage in the Option 2 example:
update the text around the command that includes "claude mcp add github -e
GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- \  docker run -i --rm -e
GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server" to state
explicitly that users can either (A) replace YOUR_GITHUB_PAT with their literal
token in the claude mcp command, or (B) export GITHUB_PERSONAL_ACCESS_TOKEN in
their shell first and then omit the value (i.e., use -e
GITHUB_PERSONAL_ACCESS_TOKEN without =VALUE so Docker inherits the parent
environment); mention both alternatives and show which form of the -e flag
corresponds to each approach.

---

Duplicate comments:
In `@mcp/github.md`:
- Around line 48-67: Unify the token placeholder usage in the Option 1 examples:
pick a single placeholder name (e.g., YOUR_GITHUB_PAT) and update every instance
of GITHUB_PERSONAL_ACCESS_TOKEN, $GITHUB_PERSONAL_ACCESS_TOKEN, and
YOUR_GITHUB_PAT in the 'claude mcp add-json github ...' command and the example
with --scope to use that single form; alternatively, if you want to show both
literal token and environment variable usage, provide two clear variants (one
using Authorization":"Bearer YOUR_GITHUB_PAT" and a second using
Authorization":"Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" with a short note to
export the env var), and make the example with --scope user match the chosen
variant exactly.

---

Nitpick comments:
In `@mcp/github.md`:
- Around line 143-154: The doc currently only lists the macOS shortcut "CMD+I"
for opening the AI assistant; update the text in the paragraph that mentions
"Hit `CMD+I` to open the AI assistant within Cursor" to include cross-platform
equivalents (e.g., "CMD+I (macOS) / Ctrl+I (Windows/Linux)") so users on all
platforms see the correct shortcut; ensure the same change is reflected wherever
"CMD+I" appears (e.g., the Validation section and the "Open MCP Settings"
guidance) to keep shortcuts consistent across the MCP setup documentation.
- Around line 183-187: Clarify that the image ghcr.io/github/github-mcp-server
is public so authentication is not normally required, and update the Docker
Issues section to say to only run the command `docker logout ghcr.io` if you
have previously logged into ghcr.io and are troubleshooting failed pulls due to
cached/expired credentials; mention that most users can skip the logout step
unless they explicitly logged in or see authentication errors when pulling the
image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 188c9704-d575-46cb-87ea-299a76197119

📥 Commits

Reviewing files that changed from the base of the PR and between 5eadb4b and 2327d19.

📒 Files selected for processing (1)
  • mcp/github.md

Comment on lines +57 to +67
Use the `--scope` flag to control where the configuration is stored:

- `--scope local` — current project only (default)
- `--scope project` — shared with the team via `.mcp.json`
- `--scope user` — all projects on this machine

Example with user scope:

```bash
claude mcp add-json --scope user github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Security risk: tokens in --scope project configurations.

Line 60 indicates that --scope project shares the configuration with the team via .mcp.json, which is typically version-controlled. Since the configuration in lines 54-66 embeds the personal access token directly in the JSON (in the Authorization header), using --scope project would commit the token to the repository, exposing it to all team members and potentially in git history.

📋 Recommended documentation addition

Add a security warning after line 61:

 - `--scope project` — shared with the team via `.mcp.json`
 - `--scope user` — all projects on this machine
+
+> **Security Warning:** When using `--scope project`, the token will be stored
+> in `.mcp.json` which may be version-controlled. Never commit personal access
+> tokens to version control. Use `--scope user` or `--scope local` for token-based
+> configurations.
 
 Example with user scope:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp/github.md` around lines 57 - 67, Add a security warning near the
description of the --scope/project behavior (.mcp.json) to warn users not to
store secrets or personal access tokens in project-scoped configs because they
may be committed to version control; instruct them to prefer --scope user or
--scope local for tokens, to use environment variables or a secret manager
instead of embedding Authorization headers in JSON, and to use placeholders in
example commands (e.g., YOUR_GITHUB_PAT) and mention adding .mcp.json to
.gitignore if project-scoped secrets are unavoidable.

Comment on lines +72 to 80
### Option 2: Local Docker Deployment

If you prefer to run the server locally, ensure Docker is installed and running,
then execute:

```bash
claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- \
docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Clarify placeholder replacement for Option 2.

Line 78 uses YOUR_GITHUB_PAT as a placeholder, but it's unclear whether users should:

  1. Replace it with their literal token value
  2. Export it as an environment variable first
  3. Use a different approach

Given that Docker's -e GITHUB_PERSONAL_ACCESS_TOKEN (without a value) inherits from the parent environment, users must replace YOUR_GITHUB_PAT with their literal token in the claude mcp add command.

📝 Proposed clarification
 ### Option 2: Local Docker Deployment

 If you prefer to run the server locally, ensure Docker is installed and running,
-then execute:
+then execute the following command, replacing `YOUR_GITHUB_PAT` with your personal
+access token:

 ```bash
 claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- \
   docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @mcp/github.md around lines 72 - 80, Clarify the placeholder usage in the
Option 2 example: update the text around the command that includes "claude mcp
add github -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- \ docker run -i
--rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server" to state
explicitly that users can either (A) replace YOUR_GITHUB_PAT with their literal
token in the claude mcp command, or (B) export GITHUB_PERSONAL_ACCESS_TOKEN in
their shell first and then omit the value (i.e., use -e
GITHUB_PERSONAL_ACCESS_TOKEN without =VALUE so Docker inherits the parent
environment); mention both alternatives and show which form of the -e flag
corresponds to each approach.


</details>

<!-- fingerprinting:phantom:triton:puma:bd8739bf-b4b2-40c3-87b8-b6bdc372b46c -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines 121 to 141
```jsonc
{
// ...
"mcpServers": {
"github": {
"command": "npx",
"command": "docker",
"args": [
"-y",
"@modelcontextprotocol/server-github"
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server",
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_PERSONAL_ACCESS_TOKEN"
}
}
}
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_PERSONAL_ACCESS_TOKEN",
},
},
},
}
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent token placeholder in Cursor AI configuration.

Line 136 uses YOUR_PERSONAL_ACCESS_TOKEN, while all Claude Code examples use YOUR_GITHUB_PAT (lines 66, 78, 89). This inconsistency can confuse users who are setting up both tools.

🔧 Proposed fix for consistency
       "env": {
-        "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_PERSONAL_ACCESS_TOKEN",
+        "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT",
       },

As per coding guidelines, documentation should maintain consistency for clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mcp/github.md` around lines 121 - 141, The Cursor AI config under mcpServers
-> "github" uses the placeholder "YOUR_PERSONAL_ACCESS_TOKEN" for the
GITHUB_PERSONAL_ACCESS_TOKEN env value which is inconsistent with other examples
that use "YOUR_GITHUB_PAT"; update the placeholder value to "YOUR_GITHUB_PAT"
(both in the env object and any example strings) so the "mcpServers", "github",
and "GITHUB_PERSONAL_ACCESS_TOKEN" entries match the Claude Code examples and
avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted A task or activity that was supported by AI, such as CoPilot, ChatGPT, or other AI technology.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(mcp): update GitHub MCP server guide to use official server

2 participants