
How to add GitHub Repo MCP to Windsurf
Let AI assistants browse public GitHub repositories, explore directories, and view file contents. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 27★ · stdio · apikey
Windsurf config for GitHub Repo MCP
npx github-repo-mcp{
"mcpServers": {
"github-repo-mcp": {
"command": "wsl",
"args": [
"bash",
"-c",
"cmd /c npx -y github-repo-mcp"
],
"env": {
"GITHUB_TOKEN": "Your_Github_Token"
}
}
}
}Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the GitHub Repo MCP config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5GitHub Repo MCP's tools become available to Cascade.
Before you start
- Node.js 18+
- npm or yarn
- Optional: a GitHub personal access token for higher API rate limits
What GitHub Repo MCP can do in Windsurf
getRepoAllDirectoriesLists all files and directories at the root of a GitHub repository. Parameters: repoUrl (the URL of the GitHub repository, e.g. "https://github.com/owner/repo").
getRepoDirectoriesLists the contents of a specific directory in a GitHub repository. Parameters: repoUrl (the repository URL) and path (the directory path to fetch, e.g. "src").
getRepoFileRetrieves and displays the content of a specific file from a GitHub repository. Parameters: repoUrl (the repository URL) and path (the file path to fetch, e.g. "src/index.js").
Security
Works without authentication against public repositories only (60 requests/hour rate limit). An optional GitHub personal access token (GITHUB_TOKEN) can be supplied for higher rate limits and to access repositories the token has permission for. The server detects common binary file extensions and will not display their contents, and large files may be unavailable due to GitHub API size limits.
GitHub Repo MCP + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the GitHub Repo MCP config there under the "mcpServers" key and restart the client.
Is GitHub Repo MCP safe to use with Windsurf?
Works without authentication against public repositories only (60 requests/hour rate limit). An optional GitHub personal access token (GITHUB_TOKEN) can be supplied for higher rate limits and to access repositories the token has permission for. The server detects common binary file extensions and will not display their contents, and large files may be unavailable due to GitHub API size limits.
Do I need a GitHub token?
No. The server works without authentication, but unauthenticated GitHub API access is limited to 60 requests per hour. Setting a personal access token via the GITHUB_TOKEN environment variable in mcp.json raises this limit.
Can it access private repositories?
Only public repositories are accessible by default. A token with appropriate permissions is required to access private repositories.
Can it read any file type?
It displays code and text files. The server detects common binary file extensions and will not display their contents, and very large files may be unavailable due to GitHub API size limits.