feat(init): add Cursor editor integration with MCP and governance rules#15
Merged
Merged
Conversation
Add support for configuring Cursor settings alongside existing Claude Code settings when running `archgate init`. The --editor flag accepts "claude" (default) or "cursor". Cursor integration creates: - .cursor/mcp.json with archgate MCP server registration - .cursor/rules/archgate-governance.mdc with alwaysApply governance rule Also adds docs/06-cursor-integration-plan.md covering the full Cursor integration strategy across phases. https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ
Make the Claude Code-specific nature of this tool explicit in its name. The tool reads session transcripts from ~/.claude/projects/ which only exists in Claude Code — renaming prevents confusion when the MCP server is used by other editors like Cursor. Renames across source, tests, and all documentation (README, CONTRIBUTING, ADRs, strategic/tactical/technical plans, agent memory). https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ
Merged
rhuanbarreto
added a commit
that referenced
this pull request
Feb 28, 2026
…es (#15) * feat(init): add --editor cursor option for Cursor IDE integration Add support for configuring Cursor settings alongside existing Claude Code settings when running `archgate init`. The --editor flag accepts "claude" (default) or "cursor". Cursor integration creates: - .cursor/mcp.json with archgate MCP server registration - .cursor/rules/archgate-governance.mdc with alwaysApply governance rule Also adds docs/06-cursor-integration-plan.md covering the full Cursor integration strategy across phases. https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ * refactor(mcp): rename session_context to claude_code_session_context Make the Claude Code-specific nature of this tool explicit in its name. The tool reads session transcripts from ~/.claude/projects/ which only exists in Claude Code — renaming prevents confusion when the MCP server is used by other editors like Cursor. Renames across source, tests, and all documentation (README, CONTRIBUTING, ADRs, strategic/tactical/technical plans, agent memory). https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ --------- Co-authored-by: Claude <noreply@anthropic.com>
rhuanbarreto
added a commit
that referenced
this pull request
Mar 3, 2026
…es (#15) * feat(init): add --editor cursor option for Cursor IDE integration Add support for configuring Cursor settings alongside existing Claude Code settings when running `archgate init`. The --editor flag accepts "claude" (default) or "cursor". Cursor integration creates: - .cursor/mcp.json with archgate MCP server registration - .cursor/rules/archgate-governance.mdc with alwaysApply governance rule Also adds docs/06-cursor-integration-plan.md covering the full Cursor integration strategy across phases. https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ * refactor(mcp): rename session_context to claude_code_session_context Make the Claude Code-specific nature of this tool explicit in its name. The tool reads session transcripts from ~/.claude/projects/ which only exists in Claude Code — renaming prevents confusion when the MCP server is used by other editors like Cursor. Renames across source, tests, and all documentation (README, CONTRIBUTING, ADRs, strategic/tactical/technical plans, agent memory). https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ --------- Co-authored-by: Claude <noreply@anthropic.com>
rhuanbarreto
added a commit
that referenced
this pull request
Mar 4, 2026
…es (#15) * feat(init): add --editor cursor option for Cursor IDE integration Add support for configuring Cursor settings alongside existing Claude Code settings when running `archgate init`. The --editor flag accepts "claude" (default) or "cursor". Cursor integration creates: - .cursor/mcp.json with archgate MCP server registration - .cursor/rules/archgate-governance.mdc with alwaysApply governance rule Also adds docs/06-cursor-integration-plan.md covering the full Cursor integration strategy across phases. https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ * refactor(mcp): rename session_context to claude_code_session_context Make the Claude Code-specific nature of this tool explicit in its name. The tool reads session transcripts from ~/.claude/projects/ which only exists in Claude Code — renaming prevents confusion when the MCP server is used by other editors like Cursor. Renames across source, tests, and all documentation (README, CONTRIBUTING, ADRs, strategic/tactical/technical plans, agent memory). https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
This PR adds Cursor editor support to Archgate, enabling users to initialize Cursor-specific governance settings alongside the existing Claude Code integration. The implementation follows the same MCP-based architecture while respecting Cursor's configuration conventions.
Key Changes
New Cursor settings helper (
src/helpers/cursor-settings.ts): Generates Cursor-specific configuration files.cursor/mcp.jsonto register the archgate MCP server.cursor/rules/archgate-governance.mdcwith always-on governance rule that guides the agent through the ADR review workflowmergeCursorMcpConfig()to additively merge archgate config into existing MCP server configurationsUpdated init command (
src/commands/init.ts): Adds--editor <editor>option--editor claude(default) and--editor cursorUpdated init helper (
src/helpers/init-project.ts):EditorTargettype andInitOptionsinterfaceeditoroptionclaudeSettingsPathtoeditorSettingsPathin result for clarityRenamed MCP tool (
src/mcp/tools/claude-code-session-context.ts):session-context.tsto clarify that this tool is Claude Code-specificregisterClaudeCodeSessionContextTool()Comprehensive test coverage (
tests/helpers/cursor-settings.test.ts):mergeCursorMcpConfig()covering empty config, existing servers, overwrites, and edge casesconfigureCursorSettings()covering directory creation, file writing, and merging behaviorDocumentation (
docs/06-cursor-integration-plan.md):Implementation Details
The Cursor governance rule uses
alwaysApply: trueto ensure the agent always has ADR context available. The rule guides users through the governance workflow: review applicable ADRs before coding, then run thechecktool after to validate compliance.The MCP server registration is additive—if users have existing MCP servers configured, archgate is merged in without disrupting them. The same pattern applies to the rules directory.
All changes maintain backward compatibility with Claude Code integration while establishing the pattern for future editor support.
https://claude.ai/code/session_01LjZoCqwLTqSF3vaHyJmQPZ