Use Aegis as an MCP server inside Cursor.
- Aegis installed so the primary
agCLI is on your PATH - Cursor with MCP support enabled
- Aegis server running on
127.0.0.1:9100
Add an MCP server entry in your Cursor settings (~/.cursor/settings.json or the GUI MCP settings):
{
"mcpServers": {
"aegis": {
"command": "ag",
"args": ["mcp"]
}
}
}Without a global install, use:
{
"mcpServers": {
"aegis": {
"command": "npx",
"args": ["--package=@onestepat4time/aegis", "ag", "mcp"]
}
}
}Then restart Cursor.
- Start the Aegis server (in a terminal):
ag # or with custom port: ag --port 9100 - Verify Aegis is running:
curl http://127.0.0.1:9100/v1/health
- Restart Cursor to load the MCP tools
Session management:
create_sessionβ create a new Claude Code sessionlist_sessionsβ list all sessions (filter by status or workDir)get_statusβ get session statusget_session_summaryβ session summary with message count
Messaging:
send_messageβ send a message to a sessionget_transcriptβ read the full message transcript
Session control:
approve_permissionβ approve a pending permission promptreject_permissionβ reject a pending permission promptinterrupt_sessionβ interrupt the running Claude Codeescape_sessionβ escape from ask_question modekill_sessionβ terminate a session
Observability:
server_healthβ check Aegis server healthget_session_metricsβ token usage, duration, tool call countsget_session_latencyβ per-operation latency breakdown
Batch & pipelines:
batch_create_sessionsβ create multiple sessions at oncecreate_pipelineβ create a multi-step pipeline
Memory:
state_getβ read a value from session-scoped memorystate_setβ write a value to session-scoped memorystate_deleteβ delete a memory entry
For the full reference, see MCP Tools.
| Problem | Solution |
|---|---|
| Tools don't appear in Cursor | Restart Cursor after saving MCP config |
| "Server not reachable" errors | Ensure Aegis is running: curl http://127.0.0.1:9100/v1/health |
| Auth errors | Set AEGIS_AUTH_TOKEN env var before starting Aegis |
| Stale tool data | Restart the Aegis server and Cursor |
For more help, see the full MCP tools reference.