Skip to content
Source

Use the servers in your local agent

The factory of your repository already uses Linear and Notion. You want the same servers in Claude Code, Cursor or VS Code on your machine. You do not want to copy URLs by hand, or to put a key in a file that you can commit by mistake.

src mcp pull writes the MCP servers of the repository into the config of your local agents. It writes no credential.

You need read access to the repository, and src: see Install and set up the CLI.

1. Pull the config

In a clone of the repository, run:

src mcp pull

It writes these files at the top of the working tree:

  • .mcp.json, for Claude Code. It always writes this file.
  • .cursor/mcp.json, for Cursor, when the .cursor folder exists.
  • .vscode/mcp.json, for VS Code, when the .vscode folder exists.

It gets the servers of the repository and the servers of its organization. It keeps the other servers in each file, and replaces a server with the same name.

To write for one agent only, add --agent claude, --agent cursor or --agent vscode. With --agent, src makes a missing folder.

2. Set the variables

Each header value in the config is a placeholder. For a connection linear, .mcp.json gets:

{
  "mcpServers": {
    "linear": {
      "type": "http",
      "url": "https://mcp.linear.app/mcp",
      "headers": {
        "Authorization": "Bearer ${LINEAR_TOKEN}"
      }
    }
  }
}

src mcp pull prints the variables to set. Set each one in your shell before you start your agent:

export LINEAR_TOKEN=lin_api_...

The variable names come from the connection name and the header:

  • An Authorization: Bearer header gives <NAME>_TOKEN, for example LINEAR_TOKEN.
  • Another header gives <NAME>_<HEADER>. The connection my-crm with the header X-Api-Key gives MY_CRM_X_API_KEY.

Cursor and VS Code read an environment variable as ${env:NAME}, so .cursor/mcp.json and .vscode/mcp.json get Bearer ${env:LINEAR_TOKEN}. You set the same variable.

3. Sign in to the OAuth servers

An OAuth server gets only its URL. src mcp pull prints the names of these servers. Your agent asks you to sign in when it connects to one.

Done

Start your agent. It lists the MCP servers of the repository, and connects with your own keys.

src mcp pull commits nothing. Run it again when the repository gets a new server.

Without the CLI

  • On the web: a repository admin finds the same .mcp.json on the MCP tab, in the card Use these servers in your local agent. Click Copy the config.
  • Over REST: GET /repos/<owner>/<repo>/mcp-config.
  • Over MCP: the tool get_repo_mcp_config.