Skip to content
Source
Sign inSign up

Connect with an API key

Skills, MCP and apps / MCP servers

Give your factory an MCP server

Your triage agent must find the Linear issue for each new report, and open one when there is none. But a stranger's issue must not make the agent change your Linear data.

6 min read

Your team tracks its work in Linear. Connect the Linear MCP server to the repository with an API key. Then pick the agents that get it, and the tools that are on.

You need:

  • Admin access to the repository.

1. Open MCP servers

Open the repository, then Agents, then MCP servers under Tools (/@<owner>/<repo>/agents/mcp). The Connect a server form is on this page.

Under Popular servers, click linear. The form fills in the URL and the header name of the built-in Linear server. In step 2, you then type only the value.

The Agents tab with MCP servers open under Tools in the sidebar, and no server connected yet. Under it, the row Popular servers has the buttons linear, notion, figma, sentry, atlassian, stripe and github, and below them the Connect a server form starts.

For a server that is not in Popular servers, start from the marketplace:

  1. Click Find a server, and open the listing of the server.
  2. Click Connect to a repository.
  3. Pick the repository, then click Continue.

The MCP servers section opens, with the URL and the header names of the listing filled in.

2. Connect the server

  1. In Name, type linear. The agents see its tools as linear_<tool>.
  2. In Server URL, type the https URL of the server, for example https://mcp.linear.app/mcp.
  3. If the form shows Credential, select Header token.
  4. Under Headers, keep the header name Authorization. In Value, type Bearer and then your Linear API key.
  5. Click Connect.

Source lists the tools of the server. A card for linear shows the badges Repository, Header and Connected.

Note

The header values are stored encrypted, and no page shows them again. To change a value, connect again with the same name. The connection keeps its agents and its tools.

3. Pick the agents

A new connection is off for every agent.

  1. On the card, under Agents, select each agent that gets the tools, for example Triage.
  2. Under Tools, turn on each tool that the agents need.
  3. Click Save agents and tools.

An agent that you select gets the tools in every one of its steps. For example, PR review gets them in its review, in Check scope and duplicates, in Verify the linked issue and in Push fixes.

Each tool has a badge. A read-only tool starts on. A tool that changes data starts off. If an agent must change data, turn that tool on.

4. Know what a stranger's run gets

  • A run for an author without write access gets only the tools that are on and read-only.
  • A run for an author with write access gets every tool that is on.

Source applies this rule in code when it builds the tools of the run, so no text in an issue can change it.

5. See it in a run

Open a new issue. In the Factory panel, open the Log of the triage run.

  • A Tool call entry names the tool with its connection, for example linear_list_issues. The tool names come from the server.
  • A Tool result entry follows it.
  • Before the first call of an MCP tool, the log shows a call of __lazy__tool__discovery__. The model loads the tool there.

Header values are hidden in the log.

Done

The agents that you picked can call the Linear tools that are on. On the items of an author without write access, they can only read.

Connect once for every repository of an organization

An organization owner can connect a server for all repositories of the organization:

  1. Open the organization, then the MCP servers tab (/organizations/<org>/mcp).
  2. Connect the server, then pick the agents and the tools, as in steps 2 and 3.

Each repository of the organization then shows the connection with the badge Organization. A repository admin sees it, but cannot change it there.

To use another key or another server on one repository, a repository admin connects a server with the same name on that repository. The repository connection takes the place of the organization connection there.

If a server does not answer

The run goes on without that server. A note at the top of the log names the server, and says why:

The note saysWhat to do
MCP server linear refused its credential (HTTP 401), so the run goes on without it. Connect it again with a new header value on the MCP page.Connect again with the same name and a new key.
MCP server notion refused its credential (HTTP 401), so the run goes on without it. Sign in again on the MCP page.The connection uses OAuth sign-in. Its card now says Needs sign-in. Sign in again.
MCP server notion was left out of this run: it needs a new sign-in. Sign in again on the MCP page.The card says Needs sign-in. Sign in again. See Connect a server that needs sign-in.
MCP server notion was left out of this run: Source could not get a fresh token for it. If this happens again, sign in again on the MCP page.The next run tries again. If the note comes back, sign in again.
MCP server linear is not available: HTTP 500, or no answerThe server had a fault or did not answer. The next run tries again.

After a 401, the next runs go on without an OAuth connection until you sign in again. The notes never show a header value or the answer of the server.

A tool call that gets no answer within 30 s is cancelled. The agent then gets this answer, which names the connection and never its URL: MCP server linear did not answer within 30 s, so the call was cancelled. Try it once more at most, then report it as failed.

To list the tools of the server again, click Refresh on the card. For example, do this after the server adds a tool. A new tool starts off unless it is read-only.

From the CLI, REST or MCP

printf '%s\n' "Bearer $LINEAR_API_KEY" | src mcp connect linear --listing builtin/linear
src mcp tools linear --agent triage --enable list_issues
src mcp list
  • src mcp connect reads the header values from standard input, one line for each --header, in order. A value never goes into your shell history.
  • src mcp tools takes the tool names as the server gives them, without the linear_ prefix. --agent replaces the agents of the connection.
  • Add --org <org> to act on an organization.
  • REST has the same actions under /repos/<owner>/<repo>/mcp and /orgs/<org>/mcp. MCP has list_repo_mcp_connections, put_repo_mcp_connection and the other *_mcp_connection tools.

Note

Agent tokens cannot add or change a connection. Only people connect servers.