Skip to content

Add Linear MCP server behind linear/linear_readonly flags - #24

Merged
DROOdotFOO merged 2 commits into
mainfrom
linear-mcp
Oct 13, 2026
Merged

DROOdotFOO merged 2 commits into
mainfrom
linear-mcp

Conversation

@DROOdotFOO

@DROOdotFOO DROOdotFOO commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • linear = true, linear_readonly = false added to chezmoi.toml and .chezmoi.toml.tmpl
  • dot_mcp.json.tmpl (Claude Code) and run_onchange_after_setup-codex.sh.tmpl (Codex) render https://mcp.linear.app/mcp, or /mcp/readonly when linear_readonly is set, from the same flags
  • test-codex-target.sh asserts the exact Linear URL in both renderers, derived from the resolved linear_readonly flag
  • CLAUDE.md MCP table and skills table updated; re-auth guidance is per host (codex mcp logout/login, Claude Code /mcp) and notes that flipping linear_readonly requires a fresh login (credential keyed by URL)
  • Companion skill: Add linear skill for Linear's hosted MCP server agent-skills#14

Checks

  • make lint pass
  • make codex-check pass with linear_readonly = false and = true

Smoke

  • chezmoi diff for ~/.mcp.json was exactly the Linear block; applied
  • codex mcp list shows linear https://mcp.linear.app/mcp enabled OAuth on Codex 0.151 (no rmcp flag needed)
  • OAuth works: get_workspace / list_teams returned the workspace

Note

The active chezmoi source clone needs chezmoi init after pulling so the generated config picks up the two new keys.

Renders the hosted Linear MCP server into ~/.mcp.json and the Codex setup
script from the same flags; linear_readonly switches both hosts to
/mcp/readonly. Codex target test asserts the entry. No secrets: OAuth via
the host.
@DROOdotFOO

Copy link
Copy Markdown
Owner Author

Adversarial Review: Linear MCP flags (PR #24)

Evidence: chezmoi execute-template of both renderers with linear_readonly flipped and linear=false (via temporary edit of ~/.config/chezmoi/chezmoi.toml, reverted); make lint, make codex-check in both states; Codex mcp_cmd.rs / rmcp-client/src/oauth.rs on main; live .well-known/oauth-protected-resource/mcp/readonly.

CRITICAL

  • none

HIGH

  • [New Hire + Security Auditor] (promoted MEDIUM -> HIGH) CLAUDE.md told users to rm -rf ~/.mcp-auth to re-auth. Neither managed host uses that directory (Codex: keychain Codex MCP Credentials; Claude Code: its own credential store); it only logs out mcp-remote servers. Fixed: codex mcp logout linear && codex mcp login linear / Claude Code /mcp -> clear auth.

MEDIUM

  • [Saboteur] Flipping linear_readonly changes the URL, and Codex's OAuth store key is (server_name, server_url) (compute_store_key), so the existing login silently stops applying and the next session prompts for OAuth. Not a bug, but undocumented. Fixed: CLAUDE.md states re-login is required after flipping.
  • [Saboteur] test-codex-target.sh only asserted startswith("https://mcp.linear.app/mcp"), so a broken {{ if .linear_readonly }} branch (e.g. /mcp/readonly emitted when false, or dropped when true) would pass. Fixed: test reads chezmoi data | .linear_readonly and asserts the exact URL in both renderers; passes with the flag in both states.
  • [Security Auditor] Default linear_readonly = false ships the full 68-tool surface (merge_diff, share_issue, delete_*) to every machine; guards are prompt-level in the skill. Left as the chosen default; readonly narrowing is real (server drops write tools; readonly resource metadata advertises only read).

LOW

  • [Saboteur] Machines whose generated ~/.config/chezmoi/chezmoi.toml predates the flags fail chezmoi apply with map has no entry for key "linear" (missingkey=error). Same as every prior flag; PR body already calls out chezmoi init. Left.
  • [Saboteur] Codex setup script: remove_server + add_http on each run_onchange is idempotent (codex mcp remove does not touch OAuth credentials on main); absent codex exits 0 before any edit. linear = false renders remove_server linear and no JSON entry (no trailing-comma issue; {{- if .linear }}, matches neighbours). No change.
  • [New Hire] Skills table says LIN-123; companion skill now uses LIN-123 everywhere too. Consistent.

Cross-Persona Overlaps

  • rm -rf ~/.mcp-auth guidance: New Hire + Security Auditor -> MEDIUM promoted to HIGH.

Verdict: CONCERNS -> addressed in dca494c

Checks after fixes

  • make lint — ok
  • make codex-check — "Codex target checks passed" with linear_readonly = false and again with = true
  • Rendered with linear_readonly = true: ~/.mcp.json -> {"type":"http","url":"https://mcp.linear.app/mcp/readonly"}; setup script -> add_http linear "https://mcp.linear.app/mcp/readonly"
  • Rendered with linear = false: no linear key in ~/.mcp.json; setup script -> remove_server linear
  • Config reverted; grep ^linear ~/.config/chezmoi/chezmoi.toml shows the original two lines

Not verified

  • Codex 0.151's OAuth store key / mcp remove semantics (verified on main source only).
  • Claude Code's credential key composition for HTTP servers (inferred to include the URL; re-login after flip is the safe assumption).

@DROOdotFOO
DROOdotFOO merged commit d924107 into main Oct 13, 2026
5 checks passed
@DROOdotFOO
DROOdotFOO deleted the linear-mcp branch October 13, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant