Cursor
Set up Respan
- Sign up — Create an account at platform.respan.ai
- Create an API key — Generate one on the API keys page
- Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Use AI
Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.
Cursor is an AI-powered code editor with built-in agent capabilities. With Respan integration, you get hierarchical traces of every agent interaction including thinking blocks, file edits, shell commands, and MCP tool calls.
How It Works
Cursor provides hooks that fire during agent execution. Our integration captures these events in real-time and sends them to Respan as hierarchical traces.
The hook captures thinking blocks, file edits, shell commands, and MCP tool calls as child spans under a root agent span.
For details on trace structure and span types, see the Observability Data Model.
Prerequisites
- Cursor IDE installed
- Respan API key
- Python 3.8+ with
requestslibrary
Installation
1. Set Environment Variables
Add these to your shell profile (.bashrc, .zshrc, or PowerShell $PROFILE):
2. Download the Hook Script
Download the hook script to your Cursor hooks directory:
3. Configure Cursor Hooks
Create ~/.cursor/hooks.json with the following configuration:
4. Restart Cursor
Restart Cursor IDE to apply the hooks configuration.
Hooks Reference
Span Types
Trace Fields
Debugging
Check the log file for issues:
Common Issues
Example Output
After setup, you’ll see traces in Respan with full hierarchy:
Source Code
The full source code is available on GitHub: Respan/respan-example-projects/cursor