trefle-mcp
You can query Trefle botanical data read-only through four MCP tools.
Search plant species by common or scientific name, with optional exact-match filters, range bounds, and pagination up to 50 results.
Retrieve a full species card by numeric ID or slug, including growth conditions, images, distributions, and synonyms.
List plants by growing conditions using filters, ranges, and pagination.
List species in a geographic distribution zone by slug or TDWG code, optionally filtered to native or introduced species.
Benefit from local filter/range validation, structured API errors, and token-based authentication via
TREFLE_TOKEN.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@trefle-mcp search Trefle for lavender and show full details of the top match"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
trefle-mcp
A small, read-only Model Context Protocol server for the public Trefle botanical REST API, built as a concrete answer to treflehq/trefle-api#225 ("Official MCP server exposing Trefle search and species data").
It is a clean-room implementation: written from the public API contract (routes, query keys, error envelope) and not derived from Trefle's source code. Not affiliated with or endorsed by Trefle.
Tools
Tool | Trefle endpoint | Notes |
|
| full-text search, optional |
|
| full species card |
|
| "plants by growing conditions" |
|
|
|
These are the four endpoints proposed in the issue (search, species show, plants list with filters, distributions).
Related MCP server: Botany MCP
Design decisions (the open questions in #225)
Transport: stdio. Each user brings their own token, so there is no hosted state or shared quota. A Streamable HTTP mode is a small follow-up if Trefle wants a hosted endpoint.
Auth:
TREFLE_TOKENenv var only. Sent asAuthorization: Bearer, never as?token=, so it does not leak into URLs, logs or tool output. The server fails fast with a clear message if it is missing.Context budget: list results are trimmed to id/slug/names/family/genus/year/image and
limitis capped at 50 per call;has_next_pageandtotaltell the agent whether to paginate.Validation: unknown
filter/rangekeys are rejected locally (same allow-list as the API) before any request, so the agent gets an actionable error without spending a request.Errors: Trefle's
{error, code, message, details}envelope is returned to the agent as structured JSON instead of a stack trace.Repo placement: works as a standalone package (
treflehq/trefle-mcp) or as a folder in the main repo.
1-Click Client Configuration & Quickstart
1-Click Claude Desktop Bundle (
.mcpb): Downloadtrefle-mcp.mcpband open it in Claude Desktop.Zero-Clone
uvxConfig (Claude Desktop / Cursor / VS Code):
{
"mcpServers": {
"trefle": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/khoap1220-hue/trefle-mcp.git",
"trefle-mcp"
],
"env": {
"TREFLE_TOKEN": "your-trefle-token"
}
}
}
}Local Source Install
pip install -e ".[test]"
export TREFLE_TOKEN=... # from your trefle.io account
python -m trefle_mcp.server # stdioTests
Fully offline: HTTP is mocked with respx, and one test spawns the real stdio server and runs the MCP
handshake + tools/list against it. No token or network needed.
PYTHONDONTWRITEBYTECODE=1 python -B -m pytest -qRoadmap (Planned Next Phases)
Retry with Retry-After on 429/5xx, lang parameter for localized common names, species/{id}/facts provenance tool, and remote Streamable HTTP transport.
License
MIT
Custom Enterprise MCP & Webhook Engineering
Need a production-hardened MCP server (OAuth 2.1, tenant scoping, annotation mutation guards, Official Registry server.json + Glama Grade-A) or replay-safe Stripe/HubSpot/n8n webhook integration?
48h Fixed Starter Slice: $145 via 0%-fee Contra Escrow (100% async — written spec, tested GitHub PR & 2-min walkthrough)
Portfolio & Services: khoaphan.dev/services
Related Open-Source MCP & A2A Security Suite
Project | Focus & Verification |
Zero-dep MCP & A2A v1.0 security guard, 11-CVE multi-lang SCA, RFC 8785 JCS/JWKS verifier & GitHub Action (Featured in | |
Official Anthropic MCP Registry servers for Caido AppSec HTTPQL traffic/findings & AnythingLLM RAG workspaces with fail-closed ACLs | |
Official Anthropic MCP Registry servers for 21-tool Blender 4.1+ 3D automation (zero-zombie Job Objects) & ShopNex e-commerce operations | |
Read-only Official Anthropic MCP Registry servers for WakaTime developer productivity telemetry & Trefle botanical species data | |
Architecture notes, live Ed25519-signed A2A |
Available Tools
4 toolsget_speciesARead-onlyIdempotent
Full species card (growth conditions, images, distributions, synonyms) by id or slug.
Inputs: id_or_slug (required).
list_plantsCRead-onlyIdempotent
List plants filtered by growing conditions, e.g. ranges={"minimum_temperature_deg_c": "-10,"}.
Inputs: page, limit, ranges, filters.
search_speciesBRead-onlyIdempotent
Full-text search of plant species by common or scientific name. filters: exact-match keys, e.g. {"edible": "true", "flower_color": "red,white"}. ranges: "min,max" bounds, e.g. {"ph_minimum": "5,", "light": "6,10"}. limit is capped at 50.
Inputs: q (required), page, limit, ranges, +1 more.
species_in_distributionBRead-onlyIdempotent
Species recorded in a geographic zone (slug or TDWG code like 'fra'). establishment: optional 'native' or 'introduced'.
Inputs: zone (required), page, limit, establishment.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
get_species and species_in_distribution are clearly distinct, but search_species and list_plants both return plant lists and can accept range filters, creating some boundary overlap. The descriptions help distinguish name-driven search from condition-driven listing, but an agent may still hesitate between them for broad queries.
All names use snake_case and are readable, with three following a verb_noun pattern (search_species, get_species, list_plants). species_in_distribution is a noun phrase and a minor deviation from the otherwise consistent convention.
Four tools are well-scoped for a focused plant-species lookup server, and each maps to a distinct core workflow: search, detail retrieval, condition-based listing, and geographic distribution. There is no obvious padding or missing essential tool.
The surface covers the main read-only workflows: finding species, retrieving full species cards, listing by growing conditions, and querying distributions. Minor gaps may exist around taxonomy/reference endpoints, but agents can likely work around them through get_species.
Maintenance
Related MCP Connectors
Live GBIF species taxonomy, IUCN status, biodiversity occurrences, country stats, and datasets.
Read and write Drupal JSON:API nodes, taxonomy terms, users and files.
Search published psychedelic research papers, clinical-trial registrations, stakeholders, patents and editorial overviews with source links. Version 1.4.0: 20 read-only tools, including catalogue counts and distributions. OAuth and a free Blossom account required. Limits: 60 MCP requests/minute; 100 ordinary or 500 supporter requests per UTC day. Research context only, no personalized treatment or dosing advice. Guide: https://www.moreblossom.com/connect
Look up Pokémon, moves, abilities, items, natures, and type matchups from PokéAPI v2.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables queries about global taxonomic data, including scientific name matching, classification chains, common names, and synonyms from the Catalogue of Life index.52 npmMIT
- FlicenseNot gradedqualityDmaintenanceRemote MCP server for authoritative plant information from the VicFlora API. Enables searching plants, fetching profiles, finding occurrences near a point, and looking up botanical terms.-
- AlicenseNot gradedqualityCmaintenanceEnables querying biodiversity data from the Global Biodiversity Information Facility (GBIF) API v1, supporting species occurrence searches and other GBIF endpoints through natural language.64 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables querying a global plant database with over 1 million species, providing access to plant records and species search via natural language.51 npmMIT