GitDBDocs
MCP

Connect your AI agent

Connect Claude Code, Cursor, or Windsurf to a GitDB repository over MCP with a personal access token.

GitDB hosts an MCP server for your repositories. Any agent that can talk to a remote MCP server connects to it directly, with nothing to install: you give it the server URL, your personal access token, and the repository to work on.

Before you start

You need:

  • A gitdb.co account with access to at least one repository.
  • A personal access token (step 1 below).
  • An MCP client, such as Claude Code, Cursor, or Windsurf.

Connection details

SettingValue
Server URLhttps://mcp.gitdb.co/mcp
TransportHTTP (Streamable HTTP)
Authorization headerBearer followed by your personal access token
X-Gitdb-Repo headerThe repository to work on, written as org/repo

Each connection works on one repository. GitDB's tools don't take a repository argument, so the connection itself names the repository:

  • If your account can access more than one repository, X-Gitdb-Repo is required.
  • If your account can access exactly one repository, it's optional. Setting it anyway keeps the connection working after you gain access to a second repository.
  • To work with several repositories, add one server entry per repository, each with its own name and its own X-Gitdb-Repo value.

If your client can't send custom headers other than Authorization, add the repository to the URL instead: https://mcp.gitdb.co/mcp?repo=org/repo. Use one method or the other. If the header and the URL name different repositories, the connection is refused.

Step 1: Create a personal access token

  1. Sign in at gitdb.co and open Settings → Personal access tokens (gitdb.co/settings/tokens).
  2. Click Generate new token.
  3. Give the token a name that tells you which agent uses it.
  4. Choose scopes:
    • repo:read is enough for the search, read, and history tools.
    • Add repo:write if the agent should create branches or tags, stage and commit changes, merge branches, or save memories. Without a write scope, those tools are refused.
  5. Choose an expiration and generate the token.
  6. Copy the token right away. You will not be able to see it again. Personal access tokens start with gdb_.

The token acts with your permissions. It can reach the repositories your account can reach, and it can write only where your organization role allows writing. Treat it like a password. If it's ever exposed, revoke it on the same settings page and generate a new one.

The examples below read the token from an environment variable named GITDB_TOKEN, so the token never appears in a config file. To set it for your current terminal session on macOS or Linux, run this and paste the token when prompted (nothing is echoed):

read -rs GITDB_TOKEN && export GITDB_TOKEN

The variable must be visible to the program that runs your agent. You can also paste the token in place of the variable reference in a config file. If you do, keep that file out of version control.

Step 2: Add GitDB to your agent

In every example, replace acme/web-app with your own organization and repository.

Claude Code

Add the server from your project directory:

claude mcp add --transport http gitdb https://mcp.gitdb.co/mcp \
  --header "Authorization: Bearer $GITDB_TOKEN" \
  --header "X-Gitdb-Repo: acme/web-app"

Your shell fills in the token when you run the command. Claude Code saves the server for the current project.

To share the setup with your team, commit a .mcp.json file to the project root instead. Each teammate then sets their own GITDB_TOKEN:

{
  "mcpServers": {
    "gitdb": {
      "type": "http",
      "url": "https://mcp.gitdb.co/mcp",
      "headers": {
        "Authorization": "Bearer ${GITDB_TOKEN}",
        "X-Gitdb-Repo": "acme/web-app"
      }
    }
  }
}

Cursor

Add the server to ~/.cursor/mcp.json to use it in every project, or to .cursor/mcp.json in a project root to use it in that project only:

{
  "mcpServers": {
    "gitdb": {
      "url": "https://mcp.gitdb.co/mcp",
      "headers": {
        "Authorization": "Bearer ${env:GITDB_TOKEN}",
        "X-Gitdb-Repo": "acme/web-app"
      }
    }
  }
}

Windsurf (now Devin Desktop)

Open the MCP config file from the Cascade panel: click the ... (Actions) menu at the top right, then click Open MCP config file in the MCPs section. On macOS and Linux the file is ~/.config/devin/mcp_config.json; on Windows it's %APPDATA%\devin\mcp_config.json. Add:

{
  "mcpServers": {
    "gitdb": {
      "serverUrl": "https://mcp.gitdb.co/mcp",
      "headers": {
        "Authorization": "Bearer ${env:GITDB_TOKEN}",
        "X-Gitdb-Repo": "acme/web-app"
      }
    }
  }
}

Windsurf names the URL field serverUrl, not url.

Other MCP clients

Any client that supports remote MCP servers over Streamable HTTP with custom request headers can connect using the connection details above.

Step 3: Verify the connection

  1. Confirm that your client sees the server:
    • Claude Code: run /mcp in a session. gitdb should show as connected.
    • Cursor: in Cursor's MCP settings, check that gitdb is enabled and lists its tools.
    • Windsurf: in the MCPs section of the Cascade panel, check that gitdb is listed.
  2. Ask your agent: "List the branches and tags in this repository."

The agent calls gitdb_list_refs and replies with your repository's branches and tags. That confirms your token and your repository selection work. gitdb_list_refs is a standard tool: on a paid plan it isn't counted, and on the free plan it uses one of your fast calls. See MCP tools for everything your agent can do.

Fast calls, premium ops, and the 5-hour window

  • Every tool is standard (Git, file, grep, commit, branch, pull request, and staging tools) or premium (AST code intelligence, semantic search, and agent memory). See MCP tools for how the classes work.
  • On a paid plan (Pro, Max, Ultra), standard tools are unmetered: they're never counted and always run at full speed. Each premium tool call counts as one premium op against your plan's premium allowance for the current 5-hour window.
  • On the free plan, each standard tool call uses one of your fast calls for the window and runs at full speed. When the fast calls are used up, standard tools keep working at reduced speed until the window resets — they're never refused for running out. With agent-ops credits and spending on, they stay at full speed instead, one credit per call. AST tools run on credits from the first call (1 credit per call); semantic search and agent memory need the 15-day Pro trial or a paid plan. See Free plan: fast calls and reduced speed.
  • On an individual plan, calls draw on the organization that owns the connected repository; on Team and Enterprise, they draw on your own seat's window, set by your seat plan.
  • The window opens with the first call your plan counts and lasts 5 hours. When it ends, the next counted call opens a fresh window with the full allowance. How many premium ops you get per window depends on your plan; see gitdb.co/pricing.
  • Connecting, reconnecting, and listing the available tools don't count.
  • A tool refused because your plan doesn't include its feature doesn't count either.
  • Git clones, fetches, and pushes never count. Your repository stays fully usable over Git at all times; see When your fast calls or premium allowance run out.
  • When a paid plan's premium allowance runs out, the connection stays open and standard tools keep working at full speed. Premium tools are refused without running until the window resets, until you upgrade to a plan with a larger allowance, or — within about two minutes — once your organization has agent-ops credits and you have turned credit spending on (it is off by default). Credits are spent only after the premium allowance is used up.
  • For repositories owned by your personal account, you can track usage on the Agent ops this window card on your dashboard, on Settings → Billing & plans, and in the footer of every gitdb.co page. Settings → Usage shows the exact time the window resets, in UTC and in your local time.

On an individual plan, when a premium tool call is refused because the organization's premium allowance is used up, the tool returns this JSON object instead of its result (formatted here for reading):

{
  "error": "GaaS API error: MCP premium tool-call allowance (AST, semantic search, memory) exceeded for this organization: the limit is N premium tool calls per 5-hour window. 'TOOL' was not executed. Standard tools are not metered on your plan and keep working. The window resets at HH:MM UTC — retry in about MINUTES minutes (retry_after_secs) — raise the limit by upgrading at https://gitdb.co/pricing, or keep going now with agent-ops credits at https://gitdb.co/settings/billing?view=credits. Your repo stays fully usable over git: clone it locally, keep working, and push back — git transport is never metered against this allowance.",
  "code": "QUOTA_WINDOW_EXCEEDED",
  "retry_after_secs": SECONDS
}

N is your plan's premium allowance per window, TOOL is the tool your agent called, and HH:MM is the time the window resets, in UTC, rounded up to the minute. MINUTES is the same wait rounded up to minutes; retry_after_secs (SECONDS) is the exact wait in seconds. Scripts and agents should check the code field, which stays the same even if the wording changes.

On Team and Enterprise, each seat — the personal access token an agent uses, or the developer — has its own window, set by that member's seat plan. A seat's window opens with its own first counted call. On a paid seat plan, the window counts the seat's premium ops and standard tools are unmetered. On a Free seat plan, the window holds the seat's fast calls, and once they're used up its standard tools run at reduced speed, as on the free plan, unless the organization's credits keep them fast. When a seat reaches its premium allowance, its standard tools keep working and its premium tool calls are refused — the tool returns this JSON object instead (formatted here for reading):

{
  "error": "GaaS API error: MCP premium tool-call limit (AST, semantic search, memory) reached for this seat: your seat in this organization is on the 'PLAN' plan, which allows N premium tool calls per 5-hour window for each seat (the developer, or each agent credential, making the call). 'TOOL' was not executed. Standard tools are not metered on this seat's plan and keep working. This seat's window resets at HH:MM UTC — retry in about MINUTES minutes (retry_after_secs) — upgrade this seat to a higher plan (an owner or admin of this organization can change it) at https://gitdb.co/pricing, or an owner can add agent-ops credits for the organization at https://gitdb.co/settings/billing?view=credits. Your repo stays fully usable over git: clone it locally, keep working, and push back — git transport is never metered against this allowance.",
  "code": "QUOTA_SEAT_WINDOW_EXCEEDED",
  "retry_after_secs": SECONDS
}

PLAN is the seat's plan name, N is that plan's premium allowance per window, TOOL is the tool your agent called, and HH:MM is the time this seat's window resets, in UTC, rounded up to the minute. MINUTES is the same wait rounded up to minutes; retry_after_secs (SECONDS) is the exact wait in seconds. A refused op is not charged.

On the free plan (or a Free seat plan), when your fast calls are used up and no credit pays for a call, standard tools run at reduced speed. If a call would have to wait too long, or too many of your calls are already waiting, it isn't run and the tool returns this JSON object instead (formatted here for reading):

{
  "error": "GaaS API error: Your N fast calls for this 5-hour window are used, so the free plan is running standard tools at reduced speed — 'TOOL' was not executed: retry in SECONDS seconds (retry_after_secs). Fast calls return at HH:MM UTC. This organization has no agent-ops credits available right now (a just-bought balance is picked up within about two minutes, with \"Use credits when my window runs out\" turned on). Keep full speed now with agent-ops credits (https://gitdb.co/settings/billing?view=credits), or upgrade / start a 15-day Pro trial (https://gitdb.co/pricing). Your repo stays fully usable over git: clone it locally, keep working, and push back — git transport is never metered against this allowance.",
  "code": "QUOTA_THROTTLED",
  "retry_after_secs": SECONDS
}

N is your plan's fast calls per window, TOOL is the tool your agent called, SECONDS is how long to wait before retrying (the same number in the message and in retry_after_secs), and HH:MM is when the window resets and the fast calls return, in UTC, rounded up to the minute. The sentence about credits depends on your balance: if your credits are still loading, it says so and asks you to retry in about two minutes; if you hold credits but spending is off, it asks you to turn on Use credits when my window runs out.

Troubleshooting

GitDB answers failed requests with one of the messages below. Depending on the client, you'll see it in the agent's reply or in the client's MCP logs.

MessageWhat it meansWhat to do
Bearer token requiredNo token reached GitDB.Check the Authorization header. If you use GITDB_TOKEN, make sure the variable is set for the program running your agent.
invalid tokenGitDB doesn't recognize the token.Check that you copied the whole token. If it was revoked, generate a new one.
token expiredThe token's expiration date has passed.Generate a new token and update your config.
this token can access multiple repositories — specify one via the X-Gitdb-Repo header or ?repo=org/nameYour account can access several repositories and the connection didn't name one.Add the X-Gitdb-Repo header. The message lists the repositories you can choose from.
requested repository is not accessible to this tokenThe repository in X-Gitdb-Repo isn't one your account can access.Check the spelling. The format is org/repo.
conflicting repo selectorsThe header and the ?repo= URL parameter name different repositories.Keep only one of them.
no accessible repositoriesYour account doesn't have access to any repository yet.Create a repository or accept an invitation to one, then reconnect.
agent seat limit exceeded (HTTP 429)Each personal access token that an agent uses takes one agent seat while it's active, and your plan limits how many can be active at once. Connections that share a token share a seat.Wait for the time in the response's Retry-After header, or until another agent goes idle, then retry. To run more agents at once, upgrade your plan.
Other HTTP 429 responsesToo many requests in a short period.Wait for the time in the Retry-After header, then retry.
A tool returns permission denied and says the credential is read-onlyThe token has no write scope, or your role in the organization is read-only.Generate a token with repo:write, or ask an organization owner for write access.
A tool returns does not include this featureYour plan doesn't include the feature this tool needs. Semantic search and agent memory are on paid plans; on the free plan the message offers the 15-day Pro trial or an upgrade. The call isn't counted.Start the 15-day Pro trial, or see gitdb.co/pricing for the plans that include it.
A tool returns code CREDITS_REQUIREDOn the free plan, AST tools run on agent-ops credits, and no credit could pay for this call. The message says why: your credits are still loading, credit spending is off, or you have no credits. The tool was not executed and nothing was spent.Loading: retry in about two minutes. Spending off: turn on Use credits when my window runs out in Settings → Billing → Credits. No credits: add some there, or start the 15-day Pro trial.
A tool returns code AST_INDEX_BUILDING (index building — retry in a few minutes)Your first credit-paid AST call on this repository started its AST index. The call wasn't charged.Retry in a few minutes, once the index is built. See AST indexing on credits.
A tool returns MCP premium tool-call allowance (AST, semantic search, memory) exceeded for this organization with code QUOTA_WINDOW_EXCEEDEDThe organization's premium allowance for the current 5-hour window is used up. The premium tool was not executed; standard tools keep working.Wait until the reset time the message gives (UTC) — or wait retry_after_secs seconds and retry; a refused op is never charged. Or upgrade for a larger allowance, or add agent-ops credits — they take over within about two minutes if you have turned credit spending on (it is off by default). Meanwhile, clone the repository and keep working locally; see When your fast calls or premium allowance run out.
A tool returns MCP premium tool-call limit (AST, semantic search, memory) reached for this seat with code QUOTA_SEAT_WINDOW_EXCEEDEDThis seat has used its own plan's premium allowance for its current 5-hour window. The premium tool was not executed; standard tools keep working.Wait until the reset time the message gives (UTC) — or wait retry_after_secs seconds and retry; a refused op is never charged. Or upgrade this seat's plan — an owner or admin of the organization can change it — or an owner can add agent-ops credits for the organization. Meanwhile, clone the repository and keep working locally; see When your fast calls or premium allowance run out.
A tool returns code QUOTA_THROTTLED (Your N fast calls for this 5-hour window are used, so the free plan is running standard tools at reduced speed)Your fast calls for the current 5-hour window are used up and no credit paid for this call, so standard tools run at reduced speed. This call would have had to wait too long, or too many of your calls were already waiting, so it was answered at once. The tool was not executed and nothing was counted.Wait the retry_after_secs the response gives, then retry. The message also says when the fast calls return (the window reset, UTC) and whether your credits are loading, held because spending is off, or used up. To stay at full speed, add agent-ops credits with spending on, or upgrade.
A tool returns code GATEWAY_AT_CAPACITYGitDB is briefly at capacity. The call was not sent and nothing ran.Retry after the retry_after_secs the response gives (about a second).
gitdb_search_code or another semantic tool returns code EMBED_AT_CAPACITYThe embedding queue is full, so the query was not embedded and nothing ran.Retry after the wait the message gives.
A tool returns MCP tool-call refused: this organization's usage cap for the current billing period is reached with code QUOTA_CREDIT_CAP_EXCEEDEDThe organization's usage cap for the current billing period is reached. The tool was not executed.An owner or admin of the organization can review the organization's usage. Meanwhile, your repository stays fully usable over Git: clone it, keep working locally, and push back.
credit-usage billing is not configuredThe organization's usage billing setup isn't complete, so tool calls are refused without running.An owner or admin of the organization can raise it with their account contact. Meanwhile, your repository stays fully usable over Git: clone it, keep working locally, and push back.

On this page