Leaf’s MCP server works with Claude Code, giving you Leaf API access from the command line through natural language. You can list users, browse fields, pull operations data, and read API documentation without writing HTTP requests.
Before you start
Save the id_token.
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.
Your Leaf token expires periodically. If you get authentication errors, generate a fresh token and update the config.
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:
List Leaf users:
Query fields:
Pull harvest operations:
Get an operation summary:
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 path API_Reference/Field_Operations/operations_endpoints and returns the full endpoint documentation, which Claude Code can then reference when helping you write integration code.
What you built
You connected Leaf’s MCP server to Claude Code and queried Leaf data from the terminal. 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.