Repository navigation
Description
MCP Config Generation Gaps
Problem
getSequantMcpConfig() in src/lib/mcp-config.ts returns a minimal config:
{ command: "npx", args: ["sequant@latest", "serve"] }This config works in Cursor (runs from workspace root) but fails in Claude Desktop (runs from an undefined directory, can't find the project).
Additionally, sequant init auto-adds this same incomplete config to all detected clients without per-client adjustments.
Issues
1. Missing cwd for Claude Desktop
Claude Desktop spawns MCP servers without a project-aware working directory. Without cwd, the server can't find .sequant/settings.json, the git repo, or worktrees. Every Claude Desktop user will get a broken setup.
Fix: getSequantMcpConfig() should accept a projectDir parameter and include cwd for clients that need it.
2. Auth guidance missing from config
The issue's design section showed "env": { "ANTHROPIC_API_KEY": "..." } but this is wrong for Max plan users who authenticate via claude login. The config should not hardcode an API key requirement.
Fix: Only include env field when ANTHROPIC_API_KEY is already set in the current environment. Never include it as a placeholder — it confuses Max plan users and could overwrite working OAuth auth.
3. All clients get identical config
sequant init writes the same JSON to Claude Desktop, Cursor, and VS Code configs. But:
- Cursor doesn't need
cwd(runs from workspace) - Claude Desktop needs
cwd(doesn't run from project) - VS Code + Continue may need
cwddepending on extension behavior
Fix: addSequantToMcpConfig() should accept a client type and generate appropriate config per client.
Acceptance Criteria
-
getSequantMcpConfig()acceptsprojectDirandclientTypeparameters - Claude Desktop config includes
cwd: process.cwd()(absolute path) - Cursor config omits
cwd(not needed) -
env.ANTHROPIC_API_KEYis only included when the env var is currently set -
sequant initgenerates per-client configs with correct fields - Docs example configs match what
sequant initgenerates - Tests cover per-client config generation
Files to Change
src/lib/mcp-config.ts—getSequantMcpConfig(),addSequantToMcpConfig()src/lib/mcp-config.test.ts— per-client test casessrc/commands/init.ts— pass client type to config generator
Activity
fix(#395): generate per-client MCP configs with cwd and env
admarble commentedon Mar 24, 2026
Exec Phase Complete
AC Coverage
getSequantMcpConfig()acceptsprojectDirandclientTypecwdcwdenv.ANTHROPIC_API_KEYonly when setsequant initgenerates per-client configsKey Files Changed
src/lib/mcp-config.ts— AddedMcpClientType, updatedgetSequantMcpConfig()andaddSequantToMcpConfig()src/lib/mcp-config.test.ts— Added 7 new per-client tests (17 total)src/commands/init.ts— PassesclientTypeto config generatordocs/features/mcp-server.md— Updated auto-setup noteCHANGELOG.md— Added entryQuality Gates
npm run build✅npm run lint✅npm test✅ (1843/1843)PR
PR #412: #412
admarble commentedon Mar 24, 2026
QA Review for Issue #395
AC Coverage
getSequantMcpConfig()acceptsprojectDirandclientType{projectDir?, clientType?}paramscwd: process.cwd()CLIENTS_NEEDING_CWDset includesclaude-desktop; falls back toprocess.cwd()cwdcursornot inCLIENTS_NEEDING_CWDset —cwdnever addedenv.ANTHROPIC_API_KEYonly included when setprocess.env.ANTHROPIC_API_KEYbeing truthysequant initgenerates per-client configsinit.tspassesclient.clientTypetoaddSequantToMcpConfig()sequant initgeneratescwdfor Claude Desktop/VS Code, omit for Cursor, env conditionalCoverage: 7/7 AC items fully met
Quality Plan Verification
N/A — No quality plan found in issue comments
CI Status
build (20.x)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed
Stale Branch Check
Quality Metrics
any)Build Verification
N/A — Build passed (local and CI)
Test Coverage Analysis
src/lib/mcp-config.tssrc/lib/mcp-config.test.tssrc/commands/init.tssrc/lib/mcp-config.test.tsdocs/features/mcp-server.mdCHANGELOG.mdCoverage: 2/2 changed source files have corresponding tests
Code Review
Strengths:
CLIENTS_NEEDING_CWDset pattern — easy to extend for new clientsMcpClientTypetype exported for type safety across the codebasegetSequantMcpConfig()andaddSequantToMcpConfig()work with no args (existing callers unaffected)process.env.ANTHROPIC_API_KEYin afterEachmcp-config.ts, wiring ininit.tsIssues:
Suggestions:
Test Quality Review
Anti-Pattern Detection
Dependency Audit
N/A — No dependency changes
Code Patterns
No anti-patterns detected in changed files.
Call-Site Review
New exported functions detected: 0 (existing functions modified, no new functions)
McpClientTypeis a new exported type (not a function).getSequantMcpConfigandaddSequantToMcpConfighad their signatures extended but already existed.Call-site for
addSequantToMcpConfig:init.ts:565— now passesclient.clientTypeas second arg. Correct per AC-5.Execution Evidence
N/A — No executable scripts changed (only library code and docs)
Skill Command Verification
N/A — No skill files changed
CLI Registration Verification
N/A — No option interface changes
CHANGELOG Verification
Result: CHANGELOG requirements met
Smoke Test
Not Required — No workflow-affecting changes (library code and docs only)
Self-Evaluation
CLIENTS_NEEDING_CWDordetectMcpClients— but that's a future concern, not a current gapVerdict: READY_FOR_MERGE
All 7 acceptance criteria are met. Implementation is clean, minimal, and well-tested. CI is green. No regressions detected.
Documentation
docs/features/mcp-server.md— auto-setup note updated)Next Steps
/docs 395to generate admin-facing documentation if neededfix(#392): merge #395 and fix cross-PR test gaps
docs(#392, #395): update MCP server docs for init --mcp flag and per-…
admarble commentedon Mar 24, 2026
Documentation Updated
File:
docs/features/mcp-server.md(existing doc updated)Changes:
env.ANTHROPIC_API_KEYconditional inclusion in auto-setup sectionStatus:
✅ Documentation ready for review and merge.
fix(#395): generate per-client MCP configs with cwd and env (#412)
docs(#392, #395): update MCP server docs for init --mcp flag and per-…
docs(#392, #395): update MCP server docs for init --mcp flag and per-…
fix(#392): sequant init --yes should not auto-add MCP to all clients (#…