GitMCP Documentation

repository·main·Indexed 26 days ago

https://github.com/idosal/git-mcp

GitMCP is a remote Model Context Protocol (MCP) server that converts GitHub repositories and GitHub Pages sites into searchable documentation hubs for AI assistants. It provides tools for retrieving primary documentation, searching code and docs, and fetching external URL content to reduce hallucinations. The tool supports integration with AI IDEs and clients including Cursor, Claude Desktop, Windsurf, VSCode, Cline, Highlight AI, Augment Code, and Msty AI.

Tokens
5.5K
Snippets
24
Records
43
Agent score
94%

What's inside git-mcp

  1. Choose a GitMCP server URL format

    main

    GitMCP offers two main ways to connect to GitHub content via MCP URLs. Choose the format that best fits your workflow:

    1. Specific Repository: Targets a single project. Use this for stability and security when working with specific libraries.

      • For GitHub repositories: gitmcp.io/{owner}/{repo}
      • For GitHub Pages sites: {owner}.gitmcp.io/{repo}
    2. Generic/Dynamic Server: Allows the AI to decide which repository to access based on your prompt. Use this for maximum flexibility.

      • URL: gitmcp.io/docs
  2. Deploy the MCP server to Cloudflare Workers

    main

    Follow these steps to deploy the server to Cloudflare:

    1. Create a KV namespace for OAuth: npx wrangler@latest kv namespace create remote-mcp-server-oauth-kv
    2. Retrieve the KV namespace ID from the command output and add it to your wrangler.jsonc file.
    3. Deploy the worker: npm run deploy
    npx wrangler@latest kv namespace create remote-mcp-server-oauth-kv
    npm run deploy
  3. Connect Claude Desktop to a remote MCP server

    main

    Once deployed to Cloudflare, update your Claude Desktop configuration to point to your production workers.dev URL using the mcp-remote proxy.

    1. Open your Claude Desktop configuration file.
    2. Update the args to use your specific worker URL:
    {
      "mcpServers": {
        "math": {
          "command": "npx",
          "args": ["mcp-remote", "https://worker-name.account-name.workers.dev/sse"]
        }
      }
    }
    1. Restart Claude.
  4. Connect GitMCP to Windsurf

    main

    Update your Windsurf configuration file at ~/.codeium/windsurf/mcp_config.json to include the GitMCP server URL.

    {
      "mcpServers": {
        "gitmcp": {
          "serverUrl": "https://gitmcp.io/{owner}/{repo}"
        }
      }
    }
  5. Connect GitMCP to Highlight AI

    main
    1. Open Highlight AI and click the plugins icon (@ symbol) in the sidebar.
    2. Click Installed Plugins at the top of the sidebar.
    3. Select Custom Plugin.
    4. Click Add a plugin using a custom SSE URL.

    Use the following details:

    • Plugin name: gitmcp
    • SSE URL: https://gitmcp.io/{owner}/{repo}
  6. Connect GitMCP to Claude Desktop

    main

    To connect Claude Desktop, go to Settings > Developer > Edit Config and add the following configuration. This uses npx to run the remote MCP connection.

    {
      "mcpServers": {
        "gitmcp": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://gitmcp.io/{owner}/{repo}"
          ]
        }
      }
    }
  7. Connect the MCP Inspector to your server

    main

    You can use the MCP Inspector to explore the MCP API via SSE (Server-Sent Events).

    1. Start the inspector: npx @modelcontextprotocol/inspector
    2. In the inspector interface (usually http://localhost:5173), set the Transport Type to SSE.
    3. Enter the server URL: http://localhost:8787/sse (for local) or your workers.dev/sse URL (for remote).
    4. Click Connect.
    5. If prompted, navigate the (mock) user/password login screen by entering any email and password.

    Once connected, you can list and call defined tools directly from the inspector.

    npx @modelcontextprotocol/inspector
  8. Connect GitMCP to Cline

    main

    Update your Cline configuration file at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json.

    {
      "mcpServers": {
        "gitmcp": {
          "url": "https://gitmcp.io/{owner}/{repo}",
          "disabled": false,
          "autoApprove": []
        }
      }
    }
  9. Connect GitMCP to Cursor

    main

    To use GitMCP in Cursor, update your local MCP configuration file at ~/.cursor/mcp.json with the chosen GitMCP URL.

    {
      "mcpServers": {
        "gitmcp": {
          "url": "https://gitmcp.io/{owner}/{repo}"
        }
      }
    }
  10. Connect GitMCP to Augment Code

    main

    Navigate to the MCP section in Augment Code settings and add a new server named git-mcp Docs using either the command line or a JSON configuration.

    npx mcp-remote https://gitmcp.io/{owner}/{repo}

    Or via JSON:

    {
      "mcpServers": {
        "git-mcp Docs": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://gitmcp.io/{owner}/{repo}"
          ]
        }
      }
    }
  11. Develop the Remote MCP Server locally

    main

    To set up a local development environment for the remote MCP server, clone the repository, install dependencies, and run the development command using nx.

    1. Clone the repository: git clone git@github.com:cloudflare/ai.git
    2. Install dependencies: cd ai && npm install
    3. Run the server locally: npx nx dev remote-mcp-server

    The server should be accessible at http://localhost:8787/.

    Note: The repository path in the instructions refers to cloudflare/ai, ensure you are in the correct directory after cloning.

    # clone the repository
    git clone git@github.com:cloudflare/ai.git
    
    # install dependencies
    cd ai
    npm install
    
    # run locally
    npx nx dev remote-mcp-server