Skip to main content
Leaf provides a Model Context Protocol (MCP) server that lets you work with Leaf data directly from Cursor. You can find growers, query fields, inspect operations, check weather data, and browse API documentation without leaving your editor.

Before you start

  • A Leaf account.
  • Cursor IDE installed (version 0.40+ with MCP support).

Step 1: Add the MCP server to Cursor

Open Cursor Settings (Cmd+, on Mac, Ctrl+, on Windows/Linux) and navigate to MCP Servers. Click Add new MCP Server and configure it:
  • Name: leaf-mcp
  • Type: HTTP
  • URL: https://mcp.withleaf.io/mcp
Save the configuration and follow Cursor’s Leaf sign-in prompt. The hosted MCP server uses OAuth, so you do not add a token header.

Step 2: Verify the connection

Open a new Cursor chat (Agent mode) and ask:
Cursor calls the get_docs_index tool and returns a list of all documentation topics available through the MCP server. If you see the index, the connection is working.

Step 3: Find a grower

Cursor calls search_growers. A unique match includes a leaf_user_id; multiple matches return candidates so you can choose the correct grower.

Step 4: Query fields for the grower

Replace <leaf_user_id> with the UUID from the previous step. Cursor calls search_fields with the Leaf user, fuzzy name, provider, and status filters. It returns field summaries with links to the matching dashboard pages. For an unfiltered first page, ask Cursor to call list_fields.

Step 5: Pull harvest operations

Cursor calls list_operations with the grower ID, operation_type=harvested, sort_by=start_time, and sort_direction=desc. Sorting happens before pagination, so the first page contains the newest matching operations. Each summary includes an operation_id and dashboardUrl. To dig into a specific operation:
This calls get_operation with include: ["summary"]. Open the returned dashboardUrl to continue in the Leaf Dashboard.

Step 6: Explore additional tools

The MCP server exposes customer-path tools across these areas: You can ask Cursor natural-language questions and it will pick the right tool. For example:
  • “What’s the weather forecast for field X?”
  • “Show me the processing status of file Y”
  • “Pull the API documentation for field operations”

What you built

You connected Leaf’s MCP server to Cursor and used it to find a grower, list fields, and inspect a harvest operation through natural language. The MCP server gives you Leaf data access from your editor without writing HTTP requests, which is useful for exploration, debugging, and rapid prototyping. For the same workflow in Claude Code, see Connect Leaf’s MCP Server in Claude Code.
Last modified on November 9, 2026