Linear MCP Server
This server is a remote Model Context Protocol (MCP) server for Linear. A model can use it to find, read, create and update issues, comments and projects, and to read teams, users and cycles. The server runs on Cloudflare Workers and on Bun. It uses the MCP server template 2.1 and the official MCP TypeScript SDK 2.3.0.
The server URL is the deployed Worker's MCP_PUBLIC_URL, for example https://linear-mcp.<subdomain>.workers.dev/mcp.
The server uses protocol version 2026-07-28. It also accepts clients that use the 2025 protocol versions.
[!WARNING] You connect this server to your MCP client at your own risk. A model can make mistakes. Examine what the tools do, and examine the changes in Linear. The write tools change issues, comments and projects in your workspace.
Tools
The server cannot delete issues, comments or projects. It can archive issues.
Connect a client
Use the server URL and the Streamable HTTP transport. The client signs you in with Linear the first time.
Alice and Wonderlands use the same URL.
Authentication
The server is its own OAuth authorization server, in front of Linear's OAuth. MCP clients do not receive Linear tokens.
- The client registers at
/registerand signs the user in at/authorize. The client must use PKCE S256. - The server sends the user to Linear. Linear asks for the scopes
readandwrite. - Linear returns the user to the server's
/oauth/callback. The server keeps the Linear tokens, encrypted. - The client gets a code, and exchanges the code at
/tokenfor an access token and a refresh token. These tokens are opaque and have meaning only for this server. - On each MCP request, the server finds the Linear token for the access token. If the Linear token expires in less than one minute and Linear issued a refresh token, the server refreshes it first. The tools use the Linear token. They do not see the client's token.
Every MCP request needs the scopes read and write. For the complete flow, the storage and the redirect rules, refer to docs/oauth.md.
Configuration
The deployment settings are in wrangler.production.jsonc (Workers; gitignored, with wrangler.production.example.jsonc as its shape) or .env (Bun). .env.example describes all variables.
Secrets:
Linear's endpoints and scopes are constants in src/services/linear-oauth.ts. For the setup at Linear and at Cloudflare, refer to docs/deploy.md.
Development
Requirements: Bun 1.4 or later, and Node.js 22.18 or later.
-
Install the dependencies:
bun install -
Copy
.env.exampleto.env. SetPROVIDER_CLIENT_ID,PROVIDER_CLIENT_SECRETandRS_TOKENS_ENC_KEY. In the Linear OAuth application, add the callback URLhttp://127.0.0.1:3000/oauth/callback. -
Start the server:
bun run devThe server URL is
http://127.0.0.1:3000/mcp. To use the Cloudflare local runtime, runbun run dev:worker(port 8787). Put its secrets in.dev.vars. -
Before you commit, run the checks:
bun run check bun run test:smoke
bun run check does the type check, the lint check and the tests. bun run test:smoke starts the real server on Bun and on workerd. It signs in through a Linear stand-in on loopback and calls the tools. No test uses the network. The tests against the real Linear API run only on request: RUN_LINEAR_LIVE_TESTS=true LINEAR_TEST_TOKEN=… bun run test:live. They make and delete issues in a team named "Tests".
Project structure
src/
server.ts Identity, instructions, Runtime, Deps, and the hooks that connect the OAuth proxy
settings.ts The Linear OAuth application, the encryption key, the redirect allowlist
tools/ One file for each tool; shared/ has schemas, resolvers and helpers
resources/ The issues dashboard (ui://linear/issues)
services/ linear.ts: Linear clients; linear-oauth.ts: Linear as the OAuth provider
oauth/ The OAuth proxy. It is the same for every provider (docs/oauth.md)
platform/ Template code. Do not change it
bun.ts Entry point for Bun: file storage
worker.ts Entry point for Workers: KV and the NativeOAuthAuthority Durable Object
tests/ Tests for the tools, the proxy and the platform; fixtures from before 1.1.0
scripts/ Smoke tests and the Linear stand-in
docs/ The OAuth proxy, deployment, and the tool design rules (rules.md)
For the template's concepts (the request path, defineTool, the error policy, the configuration checks), refer to the template documentation.