Skip to content

Latest commit

Β 

History

History
99 lines (77 loc) Β· 2.6 KB

File metadata and controls

99 lines (77 loc) Β· 2.6 KB

Cursor Integration

Use Aegis as an MCP server inside Cursor.

Prerequisites

  • Aegis installed so the primary ag CLI is on your PATH
  • Cursor with MCP support enabled
  • Aegis server running on 127.0.0.1:9100

Configuration

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.

Setup

  1. Start the Aegis server (in a terminal):
    ag
    # or with custom port:
    ag --port 9100
  2. Verify Aegis is running:
    curl http://127.0.0.1:9100/v1/health
  3. Restart Cursor to load the MCP tools

Available MCP Tools (24 total)

Session management:

  • create_session β€” create a new Claude Code session
  • list_sessions β€” list all sessions (filter by status or workDir)
  • get_status β€” get session status
  • get_session_summary β€” session summary with message count

Messaging:

  • send_message β€” send a message to a session
  • get_transcript β€” read the full message transcript

Session control:

  • approve_permission β€” approve a pending permission prompt
  • reject_permission β€” reject a pending permission prompt
  • interrupt_session β€” interrupt the running Claude Code
  • escape_session β€” escape from ask_question mode
  • kill_session β€” terminate a session

Observability:

  • server_health β€” check Aegis server health
  • get_session_metrics β€” token usage, duration, tool call counts
  • get_session_latency β€” per-operation latency breakdown

Batch & pipelines:

  • batch_create_sessions β€” create multiple sessions at once
  • create_pipeline β€” create a multi-step pipeline

Memory:

  • state_get β€” read a value from session-scoped memory
  • state_set β€” write a value to session-scoped memory
  • state_delete β€” delete a memory entry

For the full reference, see MCP Tools.

Troubleshooting

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.