Skip to content
MCP server

Connect your agent

Every agent below connects to the same address, https://patchlit.dev/mcp. Use OAuth when a person is at the keyboard; use an API key for CI or a machine without a browser.

Claude Code

Anthropic's coding agent in the terminal and IDEs.

  1. Add the server with the command below. It is saved for you on this machine (scope local); add --scope project to share it with your team through .mcp.json, or --scope user for all your projects.
  2. Start Claude Code, run /mcp, pick patchlit and choose Authenticate. Your browser opens Patchlit's consent page.
  3. Choose what Claude may do (read, or read and start fixes), then Allow. Back in Claude Code, ask: "Which of my dependency PRs are red?"

Sign in with OAuth

Add the server
claude mcp add --transport http patchlit https://patchlit.dev/mcp
Or sign in from the shell
claude mcp login patchlit

Or with an API key

With an API key
claude mcp add --transport http patchlit https://patchlit.dev/mcp \
  --header "Authorization: Bearer $PATCHLIT_API_KEY"
.mcp.json (project scope; the key stays in your environment)
{
  "mcpServers": {
    "patchlit": {
      "type": "http",
      "url": "https://patchlit.dev/mcp",
      "headers": { "Authorization": "Bearer ${PATCHLIT_API_KEY}" }
    }
  }
}
  • Keep "type": "http" in .mcp.json: an entry without it is treated as a local server and skipped.
  • When a header is set, Claude Code uses it and does not fall back to OAuth. Remove the header to sign in with OAuth instead.
  • claude mcp logout patchlit signs out; disconnecting in Patchlit's Settings ends the access on our side too.

Reference: Claude Code documentation

Claude (claude.ai and Claude Desktop)

Claude on the web, desktop and mobile, through a custom connector.

  1. Pro and Max: open Customize, Connectors, then + Add and Add custom connector. Team and Enterprise: an Owner adds it under Organization settings, Connectors, and each member then clicks Connect.
  2. Name it Patchlit and paste the address below. Keep the detected sign-in method.
  3. Click Add, then Connect, and Allow on Patchlit's consent page.

Sign in with OAuth

Server address
https://patchlit.dev/mcp

Or with an API key

Request headers (only if you cannot use OAuth)
Authorization: Bearer $PATCHLIT_API_KEY
  • Every Claude plan can add custom connectors; the Free plan is limited to one.
  • On Team and Enterprise a header credential is shared by every member, so use OAuth there: each person signs in as themselves.
  • Claude connects from Anthropic's servers, not your computer, which is why the address must be public; ours is.

Reference: Claude (claude.ai and Claude Desktop) documentation

Cursor

The AI code editor.

  1. Add the entry below to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project.
  2. Open Cursor's MCP settings; Patchlit appears there. Choose to sign in, and Allow on the consent page.
  3. In Agent chat, ask about your red dependency PRs.

Sign in with OAuth

mcp.json
{
  "mcpServers": {
    "patchlit": { "url": "https://patchlit.dev/mcp" }
  }
}

Or with an API key

mcp.json with an API key from your environment
{
  "mcpServers": {
    "patchlit": {
      "url": "https://patchlit.dev/mcp",
      "headers": { "Authorization": "Bearer ${env:PATCHLIT_API_KEY}" }
    }
  }
}
  • ${env:NAME} reads an environment variable, so the key never sits in the file.

Reference: Cursor documentation

VS Code (GitHub Copilot)

Copilot's agent mode in Visual Studio Code.

  1. Run MCP: Add Server from the Command Palette and choose HTTP, or add the entry below to .vscode/mcp.json (or your user mcp.json).
  2. Start the server from the file or the MCP view. VS Code asks you to sign in; Allow on the consent page.
  3. In Copilot Chat, switch to Agent mode and ask about your dependency PRs.

Sign in with OAuth

.vscode/mcp.json
{
  "servers": {
    "patchlit": { "type": "http", "url": "https://patchlit.dev/mcp" }
  }
}

Or with an API key

.vscode/mcp.json, asking for the key once and storing it securely
{
  "inputs": [
    { "type": "promptString", "id": "patchlit-key", "description": "Patchlit API key", "password": true }
  ],
  "servers": {
    "patchlit": {
      "type": "http",
      "url": "https://patchlit.dev/mcp",
      "headers": { "Authorization": "Bearer ${input:patchlit-key}" }
    }
  }
}
  • Use the inputs prompt rather than pasting the key into the file, so it is not committed with the project.

Reference: VS Code (GitHub Copilot) documentation

OpenAI Codex

OpenAI's coding agent CLI.

  1. Add the server, then sign in with codex mcp login. Your browser opens Patchlit's consent page.
  2. Start Codex and ask about your dependency PRs.

Sign in with OAuth

Add and sign in
codex mcp add patchlit --url https://patchlit.dev/mcp
codex mcp login patchlit

Or with an API key

~/.codex/config.toml (Codex reads the key from the variable)
[mcp_servers.patchlit]
url = "https://patchlit.dev/mcp"
bearer_token_env_var = "PATCHLIT_API_KEY"
  • codex mcp login patchlit --no-browser prints a link for machines without a browser.

Reference: OpenAI Codex documentation

Gemini CLI

Google's open-source agent for the terminal.

  1. Add the server with the command below (or the settings.json entry).
  2. Run /mcp auth patchlit in Gemini CLI to sign in, and Allow on the consent page.

Sign in with OAuth

Add the server
gemini mcp add --transport http patchlit https://patchlit.dev/mcp
~/.gemini/settings.json
{
  "mcpServers": {
    "patchlit": { "httpUrl": "https://patchlit.dev/mcp" }
  }
}

Or with an API key

With an API key
gemini mcp add --transport http --header "Authorization: Bearer $PATCHLIT_API_KEY" patchlit https://patchlit.dev/mcp
  • Use "httpUrl" (Streamable HTTP), not "url", which Gemini CLI treats as the older SSE transport.
  • OAuth sign-in needs a browser on the same machine; over SSH, use an API key.

Reference: Gemini CLI documentation

Windsurf

The Windsurf editor's Cascade agent.

  1. In Cascade, open the MCP panel and choose Open MCP config file. Add the entry below.
  2. Press refresh in the MCP panel, then sign in when Cascade asks and Allow on the consent page.

Sign in with OAuth

mcp_config.json
{
  "mcpServers": {
    "patchlit": { "serverUrl": "https://patchlit.dev/mcp" }
  }
}

Or with an API key

mcp_config.json with an API key from your environment
{
  "mcpServers": {
    "patchlit": {
      "serverUrl": "https://patchlit.dev/mcp",
      "headers": { "Authorization": "Bearer ${env:PATCHLIT_API_KEY}" }
    }
  }
}
  • On Windsurf for teams, an admin may need to allow MCP servers first.

Reference: Windsurf documentation

Other clients (stdio only)

A client that can only start local servers can reach Patchlit through mcp-remote, which runs on your machine and forwards to the remote server.

Bridge with mcp-remote (signs in with OAuth)
npx -y mcp-remote https://patchlit.dev/mcp --transport http-only
In a client's config, with an API key
{
  "mcpServers": {
    "patchlit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://patchlit.dev/mcp", "--transport", "http-only", "--header", "Authorization:${AUTH_HEADER}"],
      "env": { "AUTH_HEADER": "Bearer YOUR_API_KEY" }
    }
  }
}

Some clients split arguments on spaces, which is why the example keeps “Bearer ” in the environment variable and no space after the colon.

Your own agent

Any program that speaks MCP over Streamable HTTP can connect. The server is stateless: each request is a JSON-RPC 2.0 message sent as a POST, answered with JSON. Send an API key (or an OAuth access token) as a Bearer token. Ask the server for its tools with tools/list rather than hard-coding them.

TypeScript (@modelcontextprotocol/sdk)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client({ name: "my-agent", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(new URL("https://patchlit.dev/mcp"), {
  requestInit: { headers: { Authorization: `Bearer ${process.env.PATCHLIT_API_KEY}` } },
});
await client.connect(transport);

const { tools } = await client.listTools();
const repos = await client.callTool({ name: "patchlit_list_repositories", arguments: {} });
console.log(repos.structuredContent);
Any language: plain HTTP (JSON-RPC 2.0)
curl -s https://patchlit.dev/mcp \
  -H "Authorization: Bearer $PATCHLIT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"patchlit_whoami","arguments":{}}}'

For Python and other languages, use the official SDK’s Streamable HTTP client from modelcontextprotocol.io and give it the same Authorization header. To sign users in with OAuth from your own app, register it at https://patchlit.dev/oauth/register (dynamic client registration); the endpoints are listed at https://patchlit.dev/.well-known/oauth-authorization-server.

Troubleshooting

  • 401 or “sign in to Patchlit”: the token is missing, expired or revoked. Sign in again from your agent, or check the API key is set in the environment the agent runs in.
  • “needs the write permission”: you allowed reading only. Disconnect the app in Settings, Connected apps, and connect again with “start and stop fixes” ticked.
  • “No connected repository”: install the GitHub App on that repository first, then call patchlit_list_repositories.
  • The consent page says the app is not registered, or stops the connection: start the connection again from the agent. A sign-in code is used once and expires after ten minutes, so an old link cannot be reused.
  • Too many calls: the limit is per account across all agents; wait a minute.
Still stuck? Write to [email protected] with the agent you use and the error it shows (never the key).