Skip to content

feat(init): add Cursor editor integration with MCP and governance rules#15

Merged
rhuanbarreto merged 2 commits into
mainfrom
claude/archgate-cursor-integration-eC9Yq
Feb 24, 2026
Merged

feat(init): add Cursor editor integration with MCP and governance rules#15
rhuanbarreto merged 2 commits into
mainfrom
claude/archgate-cursor-integration-eC9Yq

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

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

    • Creates .cursor/mcp.json to register the archgate MCP server
    • Creates .cursor/rules/archgate-governance.mdc with always-on governance rule that guides the agent through the ADR review workflow
    • Implements mergeCursorMcpConfig() to additively merge archgate config into existing MCP server configurations
  • Updated init command (src/commands/init.ts): Adds --editor <editor> option

    • Supports --editor claude (default) and --editor cursor
    • Validates editor choice and provides helpful error messages
    • Updates output messaging to reflect which editor was configured
  • Updated init helper (src/helpers/init-project.ts):

    • Adds EditorTarget type and InitOptions interface
    • Routes to appropriate editor configuration based on editor option
    • Renames claudeSettingsPath to editorSettingsPath in result for clarity
  • Renamed MCP tool (src/mcp/tools/claude-code-session-context.ts):

    • Renamed from session-context.ts to clarify that this tool is Claude Code-specific
    • Updated function name to registerClaudeCodeSessionContextTool()
    • Updated all references in tool registry and tests
  • Comprehensive test coverage (tests/helpers/cursor-settings.test.ts):

    • Tests for mergeCursorMcpConfig() covering empty config, existing servers, overwrites, and edge cases
    • Tests for configureCursorSettings() covering directory creation, file writing, and merging behavior
  • Documentation (docs/06-cursor-integration-plan.md):

    • Detailed integration plan covering current state, architecture, implementation phases, and open questions
    • Clarifies which MCP tools are editor-agnostic vs. Claude Code-specific
    • Outlines future phases for skills, hooks, and marketplace distribution

Implementation Details

The Cursor governance rule uses alwaysApply: true to ensure the agent always has ADR context available. The rule guides users through the governance workflow: review applicable ADRs before coding, then run the check tool 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

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
@rhuanbarreto rhuanbarreto changed the title Add Cursor editor integration with MCP and governance rules feat: Add Cursor editor integration with MCP and governance rules Feb 24, 2026
@rhuanbarreto rhuanbarreto changed the title feat: Add Cursor editor integration with MCP and governance rules feat: Cursor editor integration with MCP and governance rules Feb 24, 2026
@rhuanbarreto rhuanbarreto changed the title feat: Cursor editor integration with MCP and governance rules feat(init): add Cursor editor integration with MCP and governance rules Feb 24, 2026
@rhuanbarreto rhuanbarreto merged commit 5932530 into main Feb 24, 2026
1 of 4 checks passed
@archgatebot archgatebot Bot mentioned this pull request Feb 24, 2026
@rhuanbarreto rhuanbarreto deleted the claude/archgate-cursor-integration-eC9Yq branch February 24, 2026 22:49
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 was referenced Mar 4, 2026
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.

2 participants