Adding linear support via mcp#586
Open
tylermmorton wants to merge 1 commit into
Open
Conversation
|
@tylermmorton is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been hacking on adding Linear as a backlog management option via Linear's MCP server based on comments in #518 -- Generated from the following claude plan. Still testing and working out issues, but I'm open to feedback on design and implementation
Linear Backlog Manager Integration (MCP)
Context
Sandcastle supports pluggable backlog managers (GitHub Issues, Beads) selected at
sandcastle inittime. The goal is to add Linear as a third option using the Linear MCP server (@tacticlaunch/mcp-linear) instead of a curl-based CLI script. The MCP approach is simpler — no team ID or state UUIDs required, just an API token — and gives the agent richer tool access via Claude Code's native MCP support.The current templates use
!{{LIST_TASKS_COMMAND}}\`` to run a shell command inline in prompts. MCP tools aren't invoked this way; the agent calls them directly. This requires a newLIST_TASKS_SNIPPET` template variable that holds the full invocation style (shell command for CLI managers, tool description for MCP managers).Implementation
1.
src/InitService.ts— interface changeAdd
LIST_TASKS_SNIPPETtoBacklogManagerEntry.templateArgsinterface (~line 223):This replaces the hardcoded
!backtick`` usage in prompt templates with a substitutable block.2.
src/InitService.ts— update existing entriesAdd
LIST_TASKS_SNIPPETto the GitHub Issues entry:Add
LIST_TASKS_SNIPPETto the Beads entry:3.
src/InitService.ts— addLINEAR_TOOLSand registry entryAfter
BEADS_TOOLS(~line 256), add:Key details:
/home/node/.claude/settings.json— the subsequentusermod -d /home/agent -m -l agent nodein the Dockerfile moves this to/home/agent/.claude/settings.jsonchown -R node:nodeensures the agent user (UID 1000, renamed fromnode) can read/write the settingsAdd Linear entry to
BACKLOG_MANAGER_REGISTRY:Note:
LIST_TASKS_COMMANDis kept to satisfy the interface but is no longer used by templates.4. Update 3 prompt templates
Replace
!{{LIST_TASKS_COMMAND}}\`` with{{LIST_TASKS_SNIPPET}}` in:src/templates/simple-loop/prompt.md(line 5)src/templates/sequential-reviewer/implement-prompt.md(line 5)src/templates/parallel-planner/plan-prompt.md(line 7)5. Delete
linear-cli.shfrom all template directoriesRemove the 5 files added in the previous curl-based implementation:
src/templates/blank/linear-cli.shsrc/templates/simple-loop/linear-cli.shsrc/templates/sequential-reviewer/linear-cli.shsrc/templates/parallel-planner/linear-cli.shsrc/templates/parallel-planner-with-review/linear-cli.sh6. Update changeset
Update
.changeset/linear-backlog-manager.mdbody if needed.Key files
src/InitService.ts:223LIST_TASKS_SNIPPETto interfacesrc/InitService.ts:258src/InitService.ts:258LINEAR_TOOLS+ Linear registry entrysrc/templates/simple-loop/prompt.md:5!{{LIST_TASKS_COMMAND}}\`` →{{LIST_TASKS_SNIPPET}}`src/templates/sequential-reviewer/implement-prompt.md:5src/templates/parallel-planner/plan-prompt.md:7src/templates/*/linear-cli.shVerification
npm run typecheck— no type errorsnpm test— no new failures (44 pre-existing failures expected)sandcastle initshows "Linear" as backlog manager optionnpm install -g @tacticlaunch/mcp-linearandsettings.jsoncreation;.env.examplecontains onlyLINEAR_API_TOKENprompt.mduses{{LIST_TASKS_SNIPPET}}value (MCP tool description) instead of!backtick command```