Skip to content

Add a Remote MCP configuration example that employs a PAT #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 13, 2025
Merged

Conversation

jww3
Copy link
Contributor

@jww3 jww3 commented Jun 13, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 14:16
@jww3 jww3 requested a review from a team as a code owner June 13, 2025 14:16
Copy link
Contributor

@Copilot 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

This PR adds a configuration example for using a GitHub Personal Access Token when connecting to a remote MCP server.

  • Adjusted heading levels for the Remote and Local GitHub MCP Server sections.
  • Introduced an HTML table comparing OAuth and PAT-based JSON configs.
  • Added an inputs prompt block for capturing the PAT in the PAT example.
Comments suppressed due to low confidence (4)

README.md:15

  • [nitpick] Heading level was bumped to H1 here, which is inconsistent with other sections using ##. Consider reverting to ## Remote GitHub MCP Server.
# Remote GitHub MCP Server

README.md:92

  • [nitpick] Similarly, this heading is H1 but other sections use H2. For consistency, use ## Local GitHub MCP Server.
# Local GitHub MCP Server

README.md:46

  • Missing comma after the "url" property, causing invalid JSON.
"url": "https://api.githubcopilot.com/mcp/"

README.md:64

  • Remove the trailing comma in the "headers" object to ensure valid JSON.
"Authorization": "Bearer ${input:github_mcp_pat}",

README.md Outdated
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"authorization_token": "<your GitHub PAT>"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the Claude docs, I don't see a way to prompt or otherwise read the PAT dynamically (e.g. from an environment variable). As far as I can tell, it has to be pasted into the JSON as plain text.

Please correct me if I'm wrong!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you are correct

README.md Outdated
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"authorization_token": "<your GitHub PAT>"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"authorization_token": "<your GitHub PAT>"
"authorization_token": "bearer <your GitHub PAT>"

Technically it needs that. Claude code adds it automatically apparently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm ... none of their examples include Bearer and this wasn't even meant to be Claude-specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(see disclaimer below)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Their tools add it automatically but it still works with it included and I'm worried about other clients doing it wrong. I confirmed that with Anthropic yesterday.

@jww3 jww3 merged commit e9926b9 into main Jun 13, 2025
16 checks passed
@jww3 jww3 deleted the jww3-patch-1 branch June 13, 2025 18:47
@jaril
Copy link
Contributor

jaril commented Jun 13, 2025

Finally got this working with Cursor, though it took more guesswork than I'd like to admit.

Initially thought about filing an issue for adding host-specific setup instructions, but you're right—the responsibility should be on each client to properly document their configuration requirements. Anthropic does it a bit better than Cursor where they don't even mention it.

But FWIW in case anybody else asks, this is how to set it up for Cursor.

{
  "mcpServers": {
    "github-remote": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_GITHUB_TOKEN_HERE"
      }
    },
  }
}

@nehalecky
Copy link

Hi @jww3, thanks for this! Any tips for setting up with claude code, using the cli? I like how HF gives all flavors of clients. Happy to submit a PR, with guidance. Thanks! :)
https://huggingface.co/settings/mcp

@jaril
Copy link
Contributor

jaril commented Jun 17, 2025

Hi @jww3, thanks for this! Any tips for setting up with claude code, using the cli? I like how HF gives all flavors of clients. Happy to submit a PR, with guidance. Thanks! :) https://huggingface.co/settings/mcp

Either of these should work:

claude mcp add --t http github https://api.githubcopilot.com/mcp/ --H "Authorization: Bearer YOUR_GITHUB_TOKEN"
claude mcp add-json github '{"type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": {"Authorization": "Bearer YOUR_GITHUB_TOKEN"

(fwiw it works even if you drop the Bearer part)

@nehalecky
Copy link

Hi @jaril , thank you! I had tried before, but my PAT wasn't setup correctly previously. 🫠 With minor changes to the flags in your command (single dash for abbreviations), I got it to work, like this:

claude mcp add -t http github https://api.githubcopilot.com/mcp/ -H "Authorization: Bearer YOUR_GITHUB_TOKEN"

Or, if you use 1password for secrets management (there are dozens!)

claude mcp add -t http github https://api.githubcopilot.com/mcp/ -H "Authorization: Bearer $(op read "op://Private/<YOUR-SECRET-REFERENCE>")"

which felt nice. :)

Also, for a starting working model for auth perms for claude code for those just getting started, I went with this (✅ granted, and ❌ no):

  • ✅ Write, review, and manage code
  • ✅ Create/manage issues and PRs
  • ✅ Automate workflows
  • ✅ Coordinate team activities
  • ❌ Destructive operations
  • ❌ Security compromises
  • ❌ Unnecessary access to sensitive data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants