← Docs
MCP for AI assistants
Nextfarm's Model Context Protocol server lets Claude, ChatGPT or your own assistant read farm data using a regular API key. What the assistant can do is decided by the key's scopes.
| Address | |
|---|---|
| Production | https://api-prod.nextfarm.vn/api/v1/mcp |
| Sandbox | https://api-dev.nextfarm.vn/api/v1/mcp |
1. Create a key
In Manage › API keys, create a dedicated key for the assistant with only the read scopes it needs.
2. Connect the assistant
Claude Desktop — claude_desktop_config.json
{
"mcpServers": {
"nextfarm": {
"url": "https://api-prod.nextfarm.vn/api/v1/mcp",
"headers": { "Authorization": "Bearer nfk_..." }
}
}
}Claude Code
claude mcp add --transport http nextfarm https://api-prod.nextfarm.vn/api/v1/mcp \
--header "Authorization: Bearer nfk_..."Tools
| Tool | What it does | Scope |
|---|---|---|
farm_search | Quick search across parcels, seasons, farmers, devices, lots, QR labels, certificates | per-section scopes |
farm_list_parcels · farm_get_parcel | Parcels | gis.parcels.view |
farm_list_seasons | Seasons by year | gis.parcels.view |
iot_list_devices | Devices and connection status | iot.devices.view |
iot_latest_readings · iot_readings_history | Sensor readings | iot.telemetry.view |
iot_list_alerts | Alerts | iot.alerts.view |
harvest_list_records | Harvest records | farm-harvest.harvest.view |
trace_list_lots · trace_get_lot | Traceability | farm-harvest.trace.view |
cert_list_expiring | Expiring certificates | farm-harvest.certification.view |
book_list_tables · book_query_records | Read farm books | office.base.record.view |
book_add_record | WRITE: add a book row | office.base.record.manage |
There are no device-control tools. If a key lacks the scope for a tool, the tool answers plainly "key is missing a scope (needs …)" so the assistant can tell you instead of guessing.
The server is stateless and never stores keys: each request uses exactly the key you send, and every scope rule applies as if you called the API directly.
Full security rules for partners: Security →