How it works
The MCP server exposes Leaf functionality as typed tools. When your assistant needs to find a grower, inspect an operation, or check weather, it calls the appropriate tool. The server uses your authenticated Leaf session for downstream API calls and returns structured, assistant-friendly summaries. No SDK installation is required. The server runs remotely atmcp.withleaf.io/mcp using Streamable HTTP transport.
Authentication
The hosted MCP server uses interactive OAuth. Add the server URL to your MCP client, then follow the sign-in prompt to authenticate with Leaf. The MCP client refreshes the session without requiring you to paste a token into its configuration. See Authentication for background on Leaf API authentication. Direct API tokens are separate from the hosted MCP login flow.Access and projects
Your session uses one active project at a time. To switch projects, ask your assistant to calllist_projects and then select_project. select_project also switches your active project in the Leaf dashboard.
To use the MCP server, your project’s plan must include MCP and your role must grant MCP use. Without that access, only the project tools are available, so that you can select a project that has it.
The tool list reflects the active project. After you switch projects, reload the Leaf server in your MCP client, or reconnect, to refresh the list.
Tools follow the same gates as the Leaf dashboard: the project’s plan must include the feature, and your role must grant the matching permission. For example:
- File tools require
files.view. - Region tools require
regions.view. - Creating a field set requires
field-sets.create.
get_grower with include: ["providers"] requires providers.view. Tools that have no dashboard counterpart, such as documentation, knowledge, units, and weather tools, need only MCP access. If a tool you expect is missing, contact your organization administrator.
Connecting from Cursor
Add this to your.cursor/mcp.json file (project-level) or ~/.cursor/mcp.json (global):
Connecting from Claude Code
Run this command in your terminal:Connecting from other MCP clients
Any client that supports Streamable HTTP and OAuth can connect. Point it athttps://mcp.withleaf.io/mcp and complete the Leaf sign-in flow. The server doesn’t use SSE or stdio transport.
Available tools
The MCP server exposes tools in these categories:
See Tools Reference for the full list with parameters.
Common use cases
- Troubleshoot data issues: Describe a symptom, such as a missing operation or a failed upload. The assistant finds the matching procedure with
search_knowledge, then follows it with the support tools:get_file_lineage,get_provider_connection,get_effective_config,get_user_units, andget_recent_failures. - Draft a support ticket: Ask the assistant to write up the issue.
draft_support_ticketfills in the support form fields from the records you checked and returns a draft. You review it and send it yourself from Leaf’s support request page; the tool doesn’t submit anything. - Find fields: Find a field by name with
search_fieldsorsearch_best, find duplicate or overlapping boundaries withfields_overlapping, or find fields within a distance withfields_nearby. - Build a field set: Collect fields from a search, a grower, or a region, then save them with
create_field_set,add_fields_to_field_set, oradd_grower_fields. - Explore data interactively: Search fields using provider, status, timestamp, or operation criteria, then open the returned
dashboardUrlorexploreUrlfor deeper investigation. - Find recent field work: Ask for a grower’s newest harvests. The server filters to harvested operations, sorts by start time descending, and paginates that ordered result.
- Download or visualize operations: Request GeoJSON or GeoParquet through a short-lived
downloadUrl. Either result includes animageRecipethat the assistant can follow with its available rendering tools. - Monitor billing: Check contract consumption at the project or Leaf user level to catch unexpected usage spikes.
Response behavior
The MCP server creates and updates saved field sets, file trackers, and regions. It doesn’t delete them. All other tools only read Leaf data, exceptselect_project, which saves your active project to your Leaf login.
Dashboard links
Grower, field, operation, file, field set, and file tracker results include adashboardUrl that opens the matching page in the Leaf dashboard. Links use the form https://dashboard.withleaf.io/{organization}/{project}/.... When the server can’t determine the organization or project, it omits the link.
A field’s dashboardUrl opens the field page, and its exploreUrl opens the field in Explore. A region’s dashboardUrl opens the regions page.
Operation downloads
Operationgeojson and geoparquet includes return an expiring downloadUrl served by the MCP server. The link lasts for at most ten minutes and never outlives the access token that authorized it. Image includes return bounded metadata rather than private image bytes. Request only one of geojson, geoparquet, or images in a single operation call.
The geojson and geoparquet results each include a structured imageRecipe for client-side rendering. It identifies the file format, recommends how to select and color a numeric measurement, provides unit hints when requested, and describes optional get_field calls for field-boundary overlays. Rendering happens in the client or agent environment rather than on the MCP server.
What to do next
- Tools Reference for the complete tool list with parameters and types.
- Authentication for background on authentication when calling the Leaf API directly.

