Skip to main content
Leaf’s MCP server works with Claude Code, giving you access to Leaf data from the command line through natural language. You can find growers, browse fields, inspect operations, and read API documentation without writing HTTP requests.

Before you start

Step 1: Configure the MCP server

Add the Leaf MCP server to your Claude Code configuration. Create or edit ~/.claude/claude_code_config.json:
For project-level configuration, add the same block to .mcp.json in your project root instead. Complete the Leaf sign-in prompt when Claude Code connects. The hosted MCP server uses OAuth, so you do not add a token header.

Step 2: Verify the connection

Launch Claude Code and ask:
Claude Code calls get_docs_index and returns the documentation index. If you see the list, the MCP server is connected.

Step 3: Query your data

The same tools available in Cursor work here. A few examples: Find a grower:
Query fields:
Pull harvest operations:
Get an operation summary:
Claude Code uses search_growers, passes the returned leaf_user_id to search_fields, and calls list_operations with operation_type: "harvested", sort_by: "start_time", and sort_direction: "desc". Sorting happens before pagination, so the first operation page contains the newest matches. It then calls get_operation with include: ["summary"]. Open a returned dashboardUrl to continue in the Leaf Dashboard. Check weather:

Step 4: Use documentation tools for context

Claude Code can pull Leaf API documentation inline to answer questions about endpoints, schemas, and behavior:
This calls get_leaf_doc with the index path machine-data/field-operations and returns the full documentation page, which Claude Code can then reference when helping you write integration code.

Available tools

What you built

You connected Leaf’s MCP server to Claude Code and used it to find a grower, inspect fields and operations, and read Leaf documentation. This setup is useful for exploring customer data, debugging integrations, and getting contextual API documentation while writing code. For the same workflow in Cursor IDE, see Connect Leaf’s MCP Server in Cursor.
Last modified on November 9, 2026