A Claude Code skill that sets up per-project GitHub MCP configuration. This keeps your GitHub Personal Access Token (PAT) isolated to specific projects rather than granting global access.
When invoked, this skill:
- Creates a
.mcp.jsonfile with GitHub MCP server configuration (token placeholder) - Adds
.mcp.jsonto.gitignoreto prevent accidental commits - Guides you through creating a fine-grained PAT with minimal permissions
Copy the SKILL.md file to your Claude Code skills directory:
mkdir -p ~/.claude/skills/github-mcp
cp SKILL.md ~/.claude/skills/github-mcp/Then restart Claude Code.
In any project where you need GitHub access, invoke the skill:
/github-mcp
Or simply ask Claude to set up GitHub access - it will detect when this skill is needed.
-
Create a fine-grained PAT at https://github.com/settings/personal-access-tokens/new
- Repository access: Select only the repositories you need
- Permissions: Contents, Issues, Pull requests (Read and write)
-
Edit
.mcp.jsonand replaceYOUR_TOKEN_HEREwith your PAT -
Restart Claude Code
-
Verify with
claude mcp list
- Security: Each project gets its own token with minimal permissions
- Isolation: Revoking one token doesn't affect other projects
- Fine-grained control: Limit access to specific repositories only
| File | Purpose |
|---|---|
.mcp.json |
MCP server configuration for Claude Code (gitignored) |
MIT