BetterLinearMCP
Provides secure, scoped tools for interacting with Linear's API, enabling AI agents to discover and manage issues, projects, teams, cycles, labels, and workspace administration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BetterLinearMCP list my open Linear issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BetterLinearMCP
A remote MCP server that gives AI agents secure, scoped access to Linear. Built with FastMCP 3.x — OAuth 2.1 + PKCE, granular scope enforcement, and 20+ tools covering discovery, read, write, and admin operations over Streamable HTTP.
Quick Start
No Linear account needed — sandbox mode runs against local seed data:
uv sync
make run-sandbox-http # terminal 1: start the sandbox server
make repl # terminal 2: launch the interactive REPLOr run the self-contained smoke test (starts server, tests all tools, stops):
make smoke-test-sandbox
The REPL auto-discovers all tools from the server and exposes them as commands with tab-completion, --help per tool, and JSON output. Type help inside the REPL for the full guide.
Related MCP server: linear-mcp
Connecting to Linear
To use real Linear data, you need an OAuth application and a few secrets:
Create an OAuth app in Linear Settings > API > OAuth Applications
Redirect URI:
http://localhost:8000/oauth/callbackScopes:
read,write,issues:create,admin
Generate secrets:
make generate-keyConfigure
.env:cp .env.example .envand fill in your credentials
Full walkthrough: guides/SETUP_LINEAR.md
Using Claude Code? The setup wizard handles everything interactively:
/blmcp-setupRunning the Server
The server reads .env automatically on startup via pydantic-settings.
Local Development
make run-sandbox-http # Sandbox over HTTP (no Linear account needed)
make run-http # Real Linear over HTTP (requires .env configured)
make run # Real Linear over stdio (local dev, Claude Desktop)Agent Loop (Claude Code)
Sandbox mode — the agent spawns the server directly via stdio. Works out of the box:
{
"mcpServers": {
"better-linear-mcp": {
"command": "uv",
"args": ["run", "python", "-m", "rl_linear_mcp.server"],
"env": {
"MCP_SANDBOX_ENABLED": "true"
}
}
}
}A ready-made config is included — just run:
claude --mcp-config .mcp.sample.jsonReal Linear — OAuth requires HTTP transport for the browser callback flow, so you run the server separately and connect via mcp-remote:
# Terminal 1: start the server (with .env configured)
make run-httpThen point your MCP client at it:
{
"mcpServers": {
"better-linear-mcp": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:8000/mcp"]
}
}
}mcp-remote bridges stdio↔HTTP — the agent talks stdio to mcp-remote, which proxies requests to the running HTTP server. This is necessary because the OAuth 2.1 + PKCE flow requires HTTP transport for the browser redirect callback.
Docker
make docker-build
make docker-run # HTTP transport, port 8000The container binds to 0.0.0.0. Pass env vars with -e or --env-file .env.
Docker + OpenTelemetry
Full observability stack — server + OTel Collector + Tempo + Prometheus + Grafana:
make compose-up # start everything
make compose-down # tear downGrafana dashboard at http://localhost:3000. Requires uv sync --extra otel.
Interactive REPL
The built-in REPL client connects to a running server and auto-discovers all tools. Every MCP tool becomes a command with argparse-generated --help, tab-completion, and JSON output.
make run-sandbox-http # terminal 1
make repl # terminal 2 (sandbox — no auth needed)
make repl-oauth # terminal 2 (real Linear — opens browser for OAuth)mcp> help # comprehensive usage guide
mcp> tools # list all tools
mcp> get_issue --help # show params for a tool
mcp> get_issue issue-001 # call a tool
mcp> create_issue --team_id team-eng-001 --title "Fix it"
mcp> search_issues bug # positional args for required params
mcp> get_audit_trail # view scope enforcement audit log
mcp> quitSupports stdin piping for agent-driven workflows:
echo -e "list_teams\nget_issue issue-001\nquit" | make replMCP Inspector
For a web-based UI, use the MCP Inspector (requires Node.js):
make inspect # stdio — inspector manages the server process
make inspect-sandbox # stdio with sandbox data
make inspect-http # HTTP — run make run-http firstScope-Based Access Control
Linear's OAuth grants broad permissions (read, write, admin). BetterLinearMCP maps these to granular domain-based MCP scopes (linear:{domain}:{read|write|admin}) and enforces them per-tool.
Linear Scope | What It Unlocks |
| All discovery and read tools — list teams, get issues, search, etc. |
| Mutation tools — create/update issues, create projects and labels, manage cycles |
| Workspace info and team member management |
Linear's issues:create and comments:create scopes are folded into the :write tier — our model uses read, write, and admin consistently across all domains.
Meta tools (get_access_info, echo) are always accessible regardless of scopes — they help users discover what they can do.
When a tool call requires scopes the user doesn't have, the server returns a 403 with the specific missing scopes.
Admins can grant additional MCP scopes to users via the manage_user_scopes tool. A user's effective scopes are the union of what Linear granted and what an admin has added. All scope mutations are audit-logged.
Admin-Granted Privilege Escalation
The manage_user_scopes tool lets workspace admins dynamically grant, revoke, and list scopes for any user — without requiring a new OAuth flow. This enables runtime privilege management: an admin can temporarily elevate a user's access for a sprint, then revoke it when done.
Actions: grant (add scopes), revoke (remove scopes), list (view current grants). Every mutation records granted_by, reason, and timestamp in the audit log.
┌─────────────────────────────────────────────────────────────────┐
│ Scope Grant / Revoke Lifecycle │
│ │
│ Bob (admin) Alice (regular user) │
│ ═══════════ ════════════════════ │
│ │
│ ┌─────────────┐ Scopes: [issues:read] │
│ │ list_teams │ ✅ allowed │
│ │ create_issue│ ✅ allowed ┌─────────────┐ │
│ │ manage_user │ ✅ allowed │ list_teams │ ✅ │
│ │ _scopes │ │ create_issue│ ❌ 403 │
│ └─────────────┘ │ "missing: │ │
│ │ issues: │ │
│ │ │ write" │ │
│ ▼ └─────────────┘ │
│ ┌─────────────────────┐ │
│ │ manage_user_scopes │ │
│ │ action: "grant" │──────────────────┐ │
│ │ target: alice │ │ │
│ │ scopes: │ ▼ │
│ │ [issues:write] │ Scopes: [issues:read, │
│ │ reason: "sprint │ issues:write] ← granted │
│ │ planning" │ │
│ └─────────────────────┘ ┌─────────────┐ │
│ │ create_issue│ ✅ │
│ │ │ now works! │ │
│ ▼ └─────────────┘ │
│ ┌─────────────────────┐ │
│ │ manage_user_scopes │ │
│ │ action: "revoke" │──────────────────┐ │
│ │ target: alice │ │ │
│ │ scopes: │ ▼ │
│ │ [issues:write] │ Scopes: [issues:read] ← reverted │
│ │ reason: "sprint │ │
│ │ complete" │ ┌─────────────┐ │
│ └─────────────────────┘ │ create_issue│ ❌ 403 │
│ │ blocked │ │
│ │ │ again │ │
│ ▼ └─────────────┘ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Audit Trail │ │
│ │─────────────────────────────────────────────────────────│ │
│ │ scope.enforce │ bob │ list_teams │ allowed │ │
│ │ scope.enforce │ bob │ create_issue │ allowed │ │
│ │ scope.enforce │ alice │ list_teams │ allowed │ │
│ │ scope.enforce │ alice │ create_issue │ denied │ │
│ │ scope.grant │ alice │ issues:write │ "sprint plan." │ │
│ │ scope.enforce │ alice │ create_issue │ allowed │ │
│ │ scope.revoke │ alice │ issues:write │ "sprint done" │ │
│ │ scope.enforce │ alice │ create_issue │ denied │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘This flow is tested end-to-end in tests/test_scope_grant_story.py — run it with uv run pytest tests/test_scope_grant_story.py -v -s.
Full scope mapping, admin grants, and per-tool requirements: guides/SCOPES.md
Tools
Core Tools
Tool | Scopes | Description |
Discovery | ||
|
| List all teams in the workspace |
|
| List all projects in the workspace |
|
| List cycles, optionally filtered by team |
|
| List all issue labels |
|
| List workflow states, optionally filtered by team |
Read | ||
|
| Get issue details by ID or identifier (e.g., |
|
| Get project details |
|
| Get team details |
|
| Search issues by query string |
Write | ||
|
| Create a new issue in a team |
|
| Update an existing issue (only provided fields change) |
|
| Create a new project |
|
| Create a new issue label |
|
| Add an issue to a cycle |
|
| Assign or unassign an issue |
|
| Change an issue's workflow state |
Admin | ||
|
| Get workspace name, URL key, user count, creation date |
|
| List team members with name, email, and active status |
|
| Grant, revoke, or list MCP scopes for any user. Actions: |
Meta | ||
| (none) | View full tool catalog with your access level |
| (none) | Echo a message (connectivity test) |
Extensions
Enabled by default, togglable via environment variables:
Tool | Toggle | Description |
|
| Semantic search across MCP tools by natural-language description |
|
| Execute multi-step workflow pipelines |
Detailed tool reference with parameters and return shapes: guides/TOOLS.md
Configuration
Key environment variables (full reference: guides/CONFIGURATION.md):
Variable | Default | Purpose |
|
|
|
|
| Enable OAuth 2.1 + PKCE on HTTP transport |
|
| File-backed sandbox (no Linear API calls) |
|
| OpenTelemetry tracing (requires |
|
| Semantic tool search |
|
| Compound workflow tool |
All variables managed via pydantic-settings. Booleans accept true/false/1/0/yes/no. Precedence: CLI flags > env vars > .env file > defaults.
Design Decisions
OAuth proxy pattern — The server exchanges auth codes for Linear tokens, stores them encrypted, and issues its own JWTs to MCP clients. Two tokens because Linear tokens are opaque (require API calls to verify) while JWTs are self-contained.
Client abstraction — An ABC (
LinearClientBase) defines 18 typed async methods with two implementations (GraphQL and file-backed sandbox). A factory returns the right one based on config. Tools never import a specific client class.Domain-based 3-tier scopes — Linear's coarse
read/write/adminOAuth scopes are mapped to granular MCP scopes (linear:{domain}:{tier}). Per-tool enforcement via middleware, not per-toolifchecks.Middleware chain architecture — Identity injection, scope enforcement, rate limiting, caching, and logging are all middleware. Conditionally wired based on settings — no dead code paths in production.
Auth bridge token propagation — In OAuth mode, the auth bridge middleware overrides the tool's
access_tokenargument with the upstream Linear token resolved from the JWT. Tools don't need to know whether they're running behind OAuth or with a direct API key.Structured error hierarchy — All application errors inherit from
BaseAppErrorwith typed context (entity IDs, step indices, missing scopes). Replaces genericValueError/KeyErrorwith catchable, inspectable exceptions. See DESIGN_CHOICES.md.Sandbox user profiles — The sandbox identity middleware supports multiple user profiles keyed by
access_token, enabling multi-user integration tests (admin + regular user) without multiple server instances.Additive scope resolution — A user's effective scopes are
OAuth-derived ∪ admin-granted. Admin grants are stored in a scope store (in-memory), resolved at enforcement time, and fully audit-logged.Pydantic-validated seed data — Sandbox seed data (
seed_data.json) is validated at load time by aSeedDatamodel. Schema drift is caught before runtime, not at request time.Hand-written entity models —
Linear*models inclients/models.pyare manually maintained to match the GQL fields we query. Auto-generation from Linear's public schema is a future improvement.Import order discipline —
telemetry.pymust be imported before FastMCP (OTel capturesTracerProviderat import time).server.pyenforces this with an# isort: splitcomment.Settings as leaf dependency — All config is centralized in
settings.pyviapydantic-settings. No module readsos.environdirectly (exception:telemetry.pyto avoid import-order coupling).
Architecture & PRDs
System architecture and diagrams: prd/prd-001-architecture/ARCHITECTURE.md
Authorization flow and token lifecycle: AUTHORIZATION_FLOW.md
All PRDs: prd/ — covers architecture, Linear integration, OAuth, client design, tool surface, search, DX, workflows, and sandbox mode.
Trade-offs
What we shipped
21 core tools across discovery, read, write, and admin — broad enterprise surface over deep feature polish
Full OAuth 2.1 + PKCE with encrypted token storage — production-grade auth, not a shortcut
Sandbox mode with Pydantic-validated seed data — zero-config testing without a Linear account
Per-tool scope enforcement with domain-based 3-tier model — goes beyond Linear's coarse
read/write/adminscopesStructured error hierarchy — typed exceptions with context, not string parsing. See DESIGN_CHOICES.md
What we cut
Token refresh probing — the OAuthProxy handles upstream refresh, but we don't proactively refresh before expiry. Tokens refresh on next use after expiry.
Webhook/real-time events — Linear supports webhooks for push-based updates. We're pull-only (tool calls). Adding a
subscribe_to_issueresource would enable real-time.Pagination cursors in REPL — the REPL doesn't support
--aftercursor chaining for multi-page results. You get the first page only.Auto-generated entity models —
Linear*models are hand-written to match our GQL queries.ariadne-codegenordatamodel-code-generatorfrom Linear's public schema would keep them in sync automatically.Persistent scope store — admin-granted scopes use an in-memory store. A SQLite-backed store would survive restarts.
Rate limiting against Linear — we have per-client rate limiting middleware, but don't track Linear's own API rate limits (1,500 req/hr).
What we'd do next
Comments and attachments —
create_comment,list_comments,attach_filetools for richer issue interactionBulk operations —
bulk_create_issues,bulk_transitionfor project management workflowsGraphQL subscriptions — real-time issue updates via MCP resources
Multi-workspace — current design assumes one workspace per server instance
Persistent token + scope storage — swap SQLite for the in-memory stores
Testing Tools
Interactive REPL
A cmd2-based REPL client that auto-discovers tools from a running server and exposes them as commands with tab-completion, --help, and JSON output:
make run-sandbox-http # terminal 1
make repl # terminal 2mcp> help # comprehensive usage guide
mcp> tools # list all tools
mcp> get_issue --help # show params for a tool
mcp> get_issue issue-001 # call a tool
mcp> search_issues bug # positional args for required params
mcp> create_issue --team_id team-eng-001 --title "Fix it" # --flags for optionalSupports stdin piping for agent-driven workflows:
echo -e "list_teams\nget_issue issue-001\nquit" | make replSmoke Tests
Non-interactive contract tests against a running server:
make smoke-test-sandbox # self-contained: starts sandbox, runs tests, stops server
make run-sandbox-http # or start manually in terminal 1...
make smoke-test # ...and run tests in terminal 2
make list-tools # list tools with input schemasClaude Code Slash Commands
This project includes Claude Code slash commands for common workflows. Run them from the Claude Code CLI:
Command | Description |
| Interactive setup wizard — walks through OAuth credentials, secret generation, |
| Launch the interactive MCP REPL to test tools against a running server. Starts the sandbox server if needed, connects, and guides you through tool discovery and testing. |
| Run read-only integration tests against a real Linear workspace. Authenticates via OAuth browser flow and exercises discovery/read tools. |
Commands are defined in .claude/commands/ and can be extended by adding new .md files.
Available Tools
24 toolsadd_issue_to_cycleAdd Issue To CycleD
Add an issue to a cycle.
Inputs: cycle_id (required), issue_id (required), access_token (required). Returns: object
assign_issueAssign IssueC
Assign an issue to a user, or unassign by passing None.
Inputs: issue_id (required), access_token (required), assignee_id. Returns: object
create_issueCreate IssueC
Create a new issue in a Linear team.
Inputs: title (required), team_id (required), access_token (required), priority, +4 more. Returns: object
create_labelCreate LabelC
Create a new issue label.
Inputs: name (required), access_token (required), color, description. Returns: object
create_projectCreate ProjectC
Create a new project in Linear.
Inputs: name (required), team_ids (required), access_token (required), description. Returns: object
echoEchoB
Echo back the provided message.
Inputs: message (required). Returns: result
get_access_infoGet Access InfoA
Return the full tool catalog with access policy for the given scopes.
Shows which tools the user can access and which are restricted based on their OAuth scopes. If no scopes are provided, all tools are shown as restricted.
Inputs: user_scopes. Returns: object
get_audit_trailGet Audit TrailB
Return recent scope audit events (enforcement decisions and mutations).
Shows timestamped records of every scope.enforce (allowed/denied), scope.grant, and scope.revoke event. Useful for security review and debugging access issues.
Requires linear:workspace:admin scope.
Inputs: access_token (required), limit. Returns: object
get_issueGet IssueC
Get detailed information about a Linear issue by ID or identifier.
Inputs: issue_id (required), access_token (required). Returns: object
get_projectGet ProjectC
Get detailed information about a Linear project.
Inputs: project_id (required), access_token (required). Returns: object
get_teamGet TeamC
Get detailed information about a Linear team.
Inputs: team_id (required), access_token (required). Returns: object
get_workspace_infoGet Workspace InfoC
Get information about the Linear workspace/organization.
Inputs: access_token (required). Returns: object
list_cyclesList CyclesC
List cycles, optionally filtered by team.
Inputs: access_token (required), after, first, team_id. Returns: object
list_labelsList LabelsC
List all issue labels in the workspace.
Inputs: access_token (required), after, first. Returns: object
list_projectsList ProjectsC
List all projects in the Linear workspace.
Inputs: access_token (required), after, first. Returns: object
list_teamsList TeamsC
List all teams in the Linear workspace.
Inputs: access_token (required), after, first. Returns: object
list_workflow_statesList Workflow StatesC
List workflow states, optionally filtered by team.
Inputs: access_token (required), after, first, team_id. Returns: object
manage_team_membersManage Team MembersC
List current members of a team for management purposes.
Inputs: team_id (required), access_token (required). Returns: object
manage_user_scopesManage User ScopesB
Grant, revoke, or list admin-granted scopes for a user.
Actions:
grant: Add scopes to a user. Requires 'scopes' parameter.
revoke: Remove scopes from a user. Requires 'scopes' parameter.
list: Show all admin-granted scopes for a user.
Requires linear:workspace:admin scope.
Inputs: action (required), access_token (required), target_user_id (required), reason, +1 more. Returns: object
run_workflowRun WorkflowB
Execute a sequential multi-step workflow pipeline.
Each step calls an MCP tool, optionally extracts a value from the result, and stores it under output_key. Later steps can reference prior outputs via $steps.{output_key}.{field} in params.
Scope enforcement: every step tool is checked against user_scopes before execution. If the caller lacks required scopes for any step, the workflow is rejected before any tool runs.
Inputs: steps (required), access_token (required), user_scopes. Returns: object
search_capabilitySearch CapabilityA
Search for MCP tools by natural-language description.
Returns ranked tool suggestions with access policy based on user scopes. Example: "I need to move an issue" → transition_issue, update_issue, ...
Inputs: query (required), user_scopes. Returns: object
search_issuesSearch IssuesC
Search issues by query string.
Inputs: query (required), access_token (required), after, first. Returns: object
transition_issueTransition IssueC
Transition an issue to a different workflow state.
Inputs: issue_id (required), state_id (required), access_token (required). Returns: object
update_issueUpdate IssueC
Update an existing issue. Only provided fields are changed.
Inputs: issue_id (required), access_token (required), title, priority, +4 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools map to distinct resources or actions, so an agent can usually tell them apart. However, search_capability and get_access_info both expose tool catalogs/access policy, and manage_team_members only lists members despite its manage prefix, which could be confused with get_team or list_teams.
The set predominantly follows a consistent snake_case verb_noun convention (list_teams, create_issue, get_project, update_issue). Minor deviations exist: manage_team_members/manage_user_scopes use manage_ instead of list_/get_, and echo is a single bare verb.
24 tools is on the heavy side for a Linear-focused MCP server. Several meta/utility tools (echo, search_capability, get_access_info, run_workflow) inflate the surface beyond the core workspace/issue/project operations.
Core issue create/get/update/search and project create/get/list are covered, with some admin scope support. But lifecycle coverage is notably incomplete: there are no delete operations for issues, projects, or labels; no update/delete for projects or labels; and cycle/team management is thin (no create/update cycle, no team provisioning).
Related MCP Connectors
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Search, read and create Linear issues, projects, teams and cycles.
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Linear issues, projects, teams, users, comments, and cycles through an optimized interface designed specifically for language models. Supports both local and remote deployment with OAuth authentication and batch operations.72MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables interaction with Linear workspaces to manage issues, projects, cycles, and teams through a GraphQL interface. It provides 21 tools for comprehensive task management, search, and workflow coordination using OAuth2 authentication.MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with Linear's issue tracking system, including creating, updating, searching issues, adding comments, and accessing resources via the Linear API.MIT
- FlicenseAqualityDmaintenanceEnables AI agents to search, create, update, and manage Linear issues through natural language, with support for teams, workflows, and comments.91-