Cursor integration
Cursor IDE Integration with Kaizen OS¶
This guide explains how to integrate Cursor IDE with Kaizen OS using the MCP (Model Context Protocol) server.
Overview¶
The Kaizen OS MCP server provides Cursor with safe, high-leverage tools for interacting with the civic governance system. It acts as a bridge between your IDE and the constitutional AI framework.
Architecture¶
Cursor IDE ←→ MCP Server ←→ Kaizen OS Gateway ←→ AI Companions
↓ ↓ ↓ ↓
Code Editor Tool Calls Constitutional AUREA, ATLAS,
& Commands & Validation Validation ZENITH, SOLARA
Setup Instructions¶
1. Install MCP Server¶
2. Configure Environment¶
Create .env file in apps/mcp-server/:
KAIZEN_TOKEN=your_kaizen_api_token
KAIZEN_GW_BASE=https://api.kaizen-os.civic.ai
CONSENSUS_READONLY=true
PORT=3033
3. Configure Cursor MCP¶
Add to your Cursor settings (~/.cursor/mcp_settings.json):
{
"mcpServers": {
"kaizen-os": {
"command": "node",
"args": ["/path/to/your/repo/apps/mcp-server/dist/index.js"],
"env": {
"KAIZEN_TOKEN": "your_token_here",
"KAIZEN_GW_BASE": "https://api.kaizen-os.civic.ai",
"CONSENSUS_READONLY": "true"
}
}
}
}
4. Restart Cursor¶
Restart Cursor IDE to load the MCP server configuration.
Available Tools¶
ADR Creation¶
Create Architecture Decision Records with constitutional validation.
// In Cursor chat or command palette
adr.create({
title: "Implement Constitutional Validation",
context: "Adding automated constitutional scoring to all AI responses"
})
Output: - ADR file created in /docs/03-architecture/adr/ - Constitutional compliance check - Suggested reviewers from AI companions
PR Drafting¶
Generate pull request templates with Kaizen OS standards.
Output: - PR template with constitutional checklist - Risk assessment and mitigation steps - Suggested reviewers based on scope
GI Checking¶
Run Governance Integrity validation on code changes.
Output: - GI score (0-1 scale) - Constitutional violations - Improvement suggestions - Pass/fail status
Ledger Attestation¶
Log development actions to the immutable audit trail.
Output: - Attestation hash - Timestamp - Event logged to civic ledger
Consensus Review¶
View AI companion votes and constitutional scores for PRs.
Output: - Vote breakdown by companion - Constitutional scores - Consensus status - Detailed reasoning
Code Scaffolding¶
Generate service, component, and test templates.
Output: - Complete file structure - Constitutional compliance built-in - Test templates - Documentation stubs
Workflow Examples¶
Feature Development¶
-
Start with ADR
-
Generate scaffolding
-
Check GI compliance
-
Draft PR
-
Attest completion
Code Review Process¶
-
Review consensus
-
Check constitutional compliance
-
Attest review
Security & Permissions¶
Read-Only Mode¶
By default, the MCP server operates in read-only mode: - ✅ Can view consensus votes - ✅ Can check GI scores - ✅ Can create ADRs and PRs - ❌ Cannot participate in governance votes - ❌ Cannot approve critical operations
Constitutional Validation¶
All operations are validated against the Custos Charter: - Human dignity and autonomy - Transparency and accountability - Equity and fairness - Safety and harm prevention - Privacy and data protection - Civic integrity - Environmental responsibility
Audit Trail¶
Every action is logged to the immutable ledger: - Tool usage - Constitutional scores - User identity - Timestamps - Metadata
Troubleshooting¶
Common Issues¶
MCP Server not connecting - Check KAIZEN_TOKEN is set correctly - Verify server is running on correct port - Check Cursor MCP configuration
Constitutional violations - Review code against Custos Charter - Use gi.check to identify specific issues - Consult AI companions for guidance
API errors - Verify KAIZEN_GW_BASE URL - Check network connectivity - Review token permissions
Debug Mode¶
Enable detailed logging:
Health Check¶
Test server connectivity:
Best Practices¶
Development Workflow¶
- Always start with ADR for architectural decisions
- Use GI checks before committing code
- Attest important milestones to ledger
- Review consensus before merging PRs
Constitutional Compliance¶
- Respect human agency in all decisions
- Maintain transparency in reasoning
- Ensure equity and fairness
- Prevent harm and protect privacy
- Support civic integrity
- Consider environmental impact
Security¶
- Never commit tokens or secrets
- Use constitutional validation
- Maintain audit trail
- Follow principle of least privilege
Advanced Configuration¶
Custom Tools¶
Extend the MCP server with custom tools:
// Add to src/index.ts
app.post('/tools/custom.tool', async (req, res) => {
// Your custom tool implementation
});
Integration with Other IDEs¶
The MCP server can be used with other IDEs that support MCP: - VS Code (with MCP extension) - Neovim (with MCP plugin) - Emacs (with MCP package)
Support¶
- 📧 Email: support@kaizen-os.civic.ai
- 💬 Discord: #cursor-integration channel
- 🐙 GitHub: Issues
- 📚 Docs: Full Documentation
"In constitutional development, we build not just code, but civic infrastructure."
Version 1.0 | Cycle C-114 | October 26, 2025