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
- Claude (claude.ai and Claude Desktop)
- Cursor
- VS Code (GitHub Copilot)
- OpenAI Codex
- Gemini CLI
- Windsurf
- Other clients (stdio only)
- Your own agent
- Troubleshooting
Claude Code
Anthropic's coding agent in the terminal and IDEs.
- 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.
- Start Claude Code, run /mcp, pick patchlit and choose Authenticate. Your browser opens Patchlit's consent page.
- 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
claude mcp add --transport http patchlit https://patchlit.dev/mcpclaude mcp login patchlitOr with an API key
claude mcp add --transport http patchlit https://patchlit.dev/mcp \
--header "Authorization: Bearer $PATCHLIT_API_KEY"{
"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.
- 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.
- Name it Patchlit and paste the address below. Keep the detected sign-in method.
- Click Add, then Connect, and Allow on Patchlit's consent page.
Sign in with OAuth
https://patchlit.dev/mcpOr with an API key
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.
- Add the entry below to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project.
- Open Cursor's MCP settings; Patchlit appears there. Choose to sign in, and Allow on the consent page.
- In Agent chat, ask about your red dependency PRs.
Sign in with OAuth
{
"mcpServers": {
"patchlit": { "url": "https://patchlit.dev/mcp" }
}
}Or with an API key
{
"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.
- 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).
- Start the server from the file or the MCP view. VS Code asks you to sign in; Allow on the consent page.
- In Copilot Chat, switch to Agent mode and ask about your dependency PRs.
Sign in with OAuth
{
"servers": {
"patchlit": { "type": "http", "url": "https://patchlit.dev/mcp" }
}
}Or with an API key
{
"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.
- Add the server, then sign in with codex mcp login. Your browser opens Patchlit's consent page.
- Start Codex and ask about your dependency PRs.
Sign in with OAuth
codex mcp add patchlit --url https://patchlit.dev/mcp
codex mcp login patchlitOr with an API key
[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.
- Add the server with the command below (or the settings.json entry).
- Run /mcp auth patchlit in Gemini CLI to sign in, and Allow on the consent page.
Sign in with OAuth
gemini mcp add --transport http patchlit https://patchlit.dev/mcp{
"mcpServers": {
"patchlit": { "httpUrl": "https://patchlit.dev/mcp" }
}
}Or 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.
- In Cascade, open the MCP panel and choose Open MCP config file. Add the entry below.
- Press refresh in the MCP panel, then sign in when Cascade asks and Allow on the consent page.
Sign in with OAuth
{
"mcpServers": {
"patchlit": { "serverUrl": "https://patchlit.dev/mcp" }
}
}Or with an API key
{
"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.
npx -y mcp-remote https://patchlit.dev/mcp --transport http-only{
"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.
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);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.