Skip to main content

Cursor MCP Setup

Add Treeship’s cryptographic attestation tools directly to your Cursor IDE. Once configured, AI agents working in Cursor can create tamper-proof records of their work automatically.

Prerequisites

Installation

1. Clone the MCP Server

git clone https://github.com/treeship-dev/treeship.git
cd treeship/treeship-mcp
Or if you already have the treeship repo:
cd treeship-mcp

2. Create Virtual Environment

python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .

3. Configure Cursor

Create or edit ~/.cursor/mcp.json:
{
  "mcpServers": {
    "treeship": {
      "command": "/path/to/treeship-mcp/.venv/bin/python",
      "args": ["-m", "treeship_mcp.server"],
      "cwd": "/path/to/treeship-mcp",
      "env": {
        "TREESHIP_API_KEY": "your-api-key-here"
      }
    }
  }
}
Replace:
  • /path/to/treeship-mcp with the actual path to your treeship-mcp directory
  • your-api-key-here with your Treeship API key

4. Restart Cursor

Quit Cursor completely (Cmd+Q / Ctrl+Q) and reopen it.

5. Verify Installation

Open Cursor Settings (Cmd+,) and search for “MCP”. You should see:
  • treeship server with a green dot (connected)
  • Four tools listed: treeship_attest, treeship_verify, treeship_get_agent, treeship_list_attestations

Available Tools

treeship_attest

Create a cryptographic attestation of agent work. Parameters:
ParameterTypeRequiredDescription
agentstringYesAgent identifier (e.g., “my-agent”)
actionstringYesDescription of what was accomplished
summarystringNoBrief summary of the work
files_modifiedstring[]NoList of modified files
files_createdstring[]NoList of created files
tools_usedstring[]NoTools used (e.g., [“Read”, “Write”, “Shell”])
commitstringNoGit commit hash if applicable
Example:
treeship_attest(
  agent="code-reviewer",
  action="Reviewed authentication module for security vulnerabilities",
  files_modified=["src/auth.ts", "src/middleware.ts"],
  tools_used=["Read", "Grep", "Glob"]
)

treeship_verify

Verify an existing attestation. Parameters:
ParameterTypeRequiredDescription
attestation_idstringYesThe attestation UUID or full URL
agentstringNoAgent slug (if using just the ID)

treeship_get_agent

Get information about an agent. Parameters:
ParameterTypeRequiredDescription
agentstringYesAgent identifier

treeship_list_attestations

List recent attestations for an agent. Parameters:
ParameterTypeRequiredDescription
agentstringYesAgent identifier
limitintegerNoMax results (default: 10)

Automatic Attestation in CLAUDE.md

Add these instructions to your project’s CLAUDE.md to enable automatic attestation:
## TREESHIP VERIFICATION

This project uses Treeship for tamper-proof verification.
Agent Feed: https://treeship.dev/verify/your-agent-name

### AUTOMATIC ATTESTATION TRIGGERS

Create an attestation using `treeship_attest` after:
1. Pushing to git (after `git push` succeeds)
2. Deploying to production
3. Completing a request with 3+ file changes
4. Making architectural decisions
5. Creating releases or tags

### Example Attestation

After completing work:
treeship_attest( agent=“your-agent-name”, action=“Brief description of what was done”, files_modified=[“list”, “of”, “files”], tools_used=[“Read”, “Write”, “Shell”] )

Troubleshooting

Server Not Connecting

  1. Check the path in mcp.json is correct
  2. Ensure Python venv is properly created
  3. Verify API key is valid
  4. Restart Cursor completely (not just reload window)

Tools Not Appearing

  1. Check MCP settings in Cursor (Cmd+, → search “MCP”)
  2. Ensure the server shows a green dot
  3. Try disabling and re-enabling the server

API Errors

  • 401: Invalid API key
  • 422: Missing required fields (check agent and action)
  • 404: Agent or attestation not found

Next Steps