Setup

GitHits Remote MCP works with any tool that supports the latest version of the Model Context Protocol. Below are instructions for setting up GitHits MCP with your AI coding tool or IDE.

OAuth 2.1 with Dynamic Client Registration (Alpha)

The easiest and most secure way to connect to GitHits MCP is using OAuth 2.1 with Dynamic Client Registration (DCR). This method doesn't require managing API tokens - simply authenticate with your GitHits account via the approval flow that is built into your IDE or coding tool.

The OAuth 2.1 with DCR method is currently in alpha and supported by a growing number of tools. If you encounter issues, please refer to the API Token Authentication section below as a reliable alternative.

What You Need

You need only your AI IDE or CLI, and the GitHits MCP server URL and a config file or CLI command to add the server to your tool. The remote MCP server URL is:

https://mcp.githits.com/

Please note that not all IDEs and coding tools support OAuth 2.1 with DCR yet. Check your tool's documentation for MCP support and configuration details. Below, we provide setup instructions for some popular tools that support OAuth 2.1 with DCR.

VS Code / Copilot

Add the following to .vscode/mcp.json in your project:

{
  "servers": {
    "GitHits": {
      "url": "https://mcp.githits.com",
      "type": "http"
    }
  }
}

VS Code will automatically handle the OAuth authentication flow via your browser.

Claude Code

Add via the CLI:

claude mcp add --transport http GitHits --scope user https://mcp.githits.com/

Claude Code will automatically handle the OAuth authentication flow.

Codex

Run the following command to enable the GitHits MCP client with OAuth support:

codex mcp add GitHits --url https://mcp.githits.com

Revoking OAuth Access

To revoke access a tool has to GitHits, you can do so from your GitHits account settings:

  1. Go to app.githits.com and log in.
  2. Click on your profile icon in the top-right corner and select "Settings".
  3. Navigate to the "Authorized Applications" section.
  4. Find the application you want to revoke access for and click "Revoke Access".

API Token Authentication

For tools that don't yet support OAuth 2.1, you can use API token authentication.

What You Need

Before you begin, you'll need:

  1. GitHits Account: Sign up at app.githits.com
  2. API Token: Generate one from Profile Icon → Settings → MCP Tokens
  3. IDE or Coding Tool: Copy the provided configuration into your tool along with your API token - see examples below.
Tip

Your API token is free and gives you access to search across millions of code examples. Keep it secure!

Example Setups

This is not an exhaustive list, but here are some popular tools with setup instructions.

Please refer to your IDE / coding tool documentation for MCP support and configuration details. The setup generally involves adding a configuration file or specifying the MCP server URL and your API token.

VS Code / Copilot

Tip

VS Code now supports OAuth 2.1 with DCR. We recommend using the setup above instead, which doesn't require managing API tokens.

Copy the mcp.json file to .vscode/mcp.json in your project. VS Code will automatically pick it up and ask for your token during first connection.

{
  "servers": {
    "GitHits": {
      "url": "https://mcp.githits.com/",
      "type": "http",
      "headers": {
        "Authorization": "Bearer ${input:githits_mcp_token}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "githits_mcp_token",
      "description": "GitHits Access Token",
      "password": true
    }
  ]
}

Cline

Cline has built-in support for MCP, but you'll need to add the GitHits MCP configuration manually and modify it a bit.

{
  "mcpServers": {
    "GitHits": {
      "url": "https://mcp.githits.com",
      "disabled": false,
      "timeout": 360,
      "type": "streamableHttp",
      "autoApprove": [],
      "headers": {
        "Authorization": "Bearer <copy-githits-token-here>"
      }
    }
  }
}

Cursor

Add the GitHits MCP configuration to your Cursor .cursor/mcp.json:

{
  "mcpServers": {
    "GitHits": {
      "url": "https://mcp.githits.com/",
      "headers": {
        "Authorization": "Bearer <copy-githits-token-here>"
      }
    }
  }
}

Windsurf

Add the GitHits MCP configuration to your Windsurf mcp_config.json:

{
  "mcpServers": {
    "GitHits": {
      "serverUrl": "https://mcp.githits.com/",
      "headers": {
        "Authorization": "Bearer <copy-githits-token-here>"
      }
    }
  }
}

Claude Code

Add via the CLI:

claude mcp add --transport http GitHits --scope user https://mcp.githits.com --header "Authorization: Bearer your-token"

Codex

codex mcp add GitHits --url https://mcp.githits.com --bearer-token-env-var GITHITS_API_TOKEN

Add the following configuration to your ~/.codex/config.toml file:

[features]
rmcp_client = true

Get your token from GitHits and set it as an environment variable before running Codex:

export GITHITS_API_TOKEN="your-token-here"

Deleting tokens / Revoking Access

To delete or revoke an API token, go to your GitHits account settings:

  1. Go to app.githits.com and log in.
  2. Click on your profile icon in the top-right corner and select "Settings".
  3. Navigate to the "MCP Tokens" section.
  4. Find the token you want to delete and click "deactivate" or "delete" icon.

Troubleshooting: Using mcp-remote (e.g. for Google Antigravity, Zed etc.)

If your IDE doesn't support remote MCP servers natively, has issues with streamable HTTP transport, or you're experiencing connection problems, you can use the mcp-remote package as a workaround. This package acts as a local proxy that bridges your IDE to remote MCP servers.

When to Use This

  • Your IDE only supports local/stdio MCP servers
  • You're experiencing issues with native HTTP MCP support
  • OAuth flow isn't working correctly in your tool
  • You need a more reliable connection method

Setup

Add a stdio-based MCP server configuration to your IDE's MCP settings. The exact file location and format depends on your tool.

For tools using mcpServers (Cursor, Cline, Claude Desktop, etc.):

{
  "mcpServers": {
    "GitHits": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.githits.com/"]
    }
  }
}

For VS Code / Copilot (uses servers):

{
  "servers": {
    "GitHits": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.githits.com/"]
    }
  }
}

This will:

  1. Use npx to run the mcp-remote package (installing it automatically if needed)
  2. Create a local stdio-based MCP server that proxies requests to GitHits
  3. Handle the OAuth authentication flow through your browser
Tip

The mcp-remote approach works with virtually any IDE that supports stdio-based MCP servers, making it a reliable fallback option.