/brapi-mcp-server:brapi-guidefrom brapi-mcp-server
Use brapi_* tools to compare plant-breeding phenotypes across studies, find records across BrAPI aliases, verify which trials measured a trait, retrieve genotype calls or export a variant set, and query staged results in SQL.
Ships in brapi-mcp-server. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Work within a BrAPI upstream's advertised endpoints. Access depends on the upstream, which may require credentials configured by the operator.
Keep every BrAPI ID with the upstream connection that produced it. If comparing across connections, verify the biological identity and measurement definitions before joining records.
| ID | Where to get it |
|---|---|
germplasmDbId | brapi_find_germplasm rows after resolving a name or accession. |
observationVariableDbId | brapi_find_variables rows, where every free-text match carries textMatchRank, or the top 10 in ontologyCandidates. Use a trait label or ontology PUI to find candidates. |
studyDbId | brapi_find_studies for candidate studies (pass variables to find studies that recorded a variable directly), matching brapi_find_observations rows or contributing brapi_germplasm_performance studies for evidence of measurement. |
variantSetDbId | Rows from brapi_raw_get on /variantsets. Follow upstream pages when searching for a set. |
variantDbId, callSetDbId | Variant IDs from brapi_find_variants or genotype-call rows. Call-set IDs come from genotype-call rows; a call set is one sample's calls, and each matrix row from brapi_export_genotype_matrix is a call set. |
flagged count, each perRowWarnings item, and warnings about incomplete checks with the user before asking for apply confirmation.Start with brapi_find_studies { variables } to find candidate studies that recorded the variable, and read its warnings: the filter is checked by count, and a warning means narrowing is unverified. On SGN/Breedbase, scope brapi_find_observations to a study or germplasm to use embedded observations when the upstream advertises that route. If an observation search skips collection, get contributing study IDs from brapi_germplasm_performance, then retry against those studies or other known study IDs. A germplasm filter on study discovery can be ignored upstream. Verify study membership from matching observations, and use brapi_get_study for trial, location, and season context.
Read coverage in the performance or matrix result. Contributing studies have collected measurements. Empty, failed, partial, and unprocessed studies have distinct outcomes. An incomplete scoped-unit scan can leave additional studies unseen.
Use brapi_build_phenotype_matrix with long form and aggregate: "all" to preserve study IDs, observation and unit IDs, categorical values, and replicate rows. Use designLegend to identify field design columns from embedded units. A wide matrix pools across studies by germplasm and variable. Use countLegend to read the number of values used in each pooled cell. To compare studies separately, group long rows by study, germplasm, and variable. Preserve measured zeros.
Use studies, trials, or programs to scope brapi_find_germplasm. Check the warnings before treating results as verified membership. If a scalar-only route expands filters into several requests, skipped combinations mean coverage is partial. For variable text matches, use the matches ranked by textMatchRank to find likely IDs, then read their scales and methods before choosing one. ontologyCandidates holds only the top 10 of textMatchCount; when more match, read every method variant from the ranked results[] rows or the staged dataframe (WHERE textMatchRank IS NOT NULL ORDER BY textMatchRank).
On the BrAPI Community Test Server, the variable catalog ignores study filters. Read study.observationVariableDbIds from brapi_get_study when the study publishes it, then pass the listed IDs as variables to brapi_find_variables. To check whether a variable was measured, look for an observation carrying both the variable ID and the study ID.
Pass deferredImageDbIds from brapi_get_image or deferredRoots from brapi_walk_pedigree into a follow-up call. Pedigree maxDepth reports the effective depth. Read frontier separately for unresolved expansions among the roots the call processed.
Use brapi_federated_find with aliases and query: { entity, filters } for studies, germplasm, or observations across known connections. Check coverage per alias before drawing conclusions. Keep the source alias alongside each DbId. Germplasm with the same unambiguous PUI can share one row. Read sources and conflicts before selecting values from that row.
Scope brapi_find_genotype_calls to the relevant variant set or other known IDs when inspecting calls. Use brapi_export_genotype_matrix when you need the wide pivot or VCF-lite or PLINK text. Check whether the pull stopped early and whether the matrix reached its separate column limit. Use variantColumnLegend to map matrix columns back to variant IDs. Rows are call sets, not germplasm: join phenotypes on germplasmDbId, where a germplasm with several call sets joins once per call set and null means the germplasm was unresolved. When the variant-column cap trims the matrix, pass the variants missing from variantColumnLegend as variantDbIds in further calls; variantDbIds also scopes an export to a region or batch.
For calls from particular germplasm, pass the germplasm IDs to the finder or export. A completed lookup can establish that there are no matching call sets. A failed lookup leaves membership unknown. If you have independently verified call-set IDs, use those in the finder to continue.
A bare numeric value can be dosage or a single allele index. When text export marks such a call missing, recover the original value from the staged matrix and leave the allele interpretation unresolved. Check coordinate and allele metadata before using the exported text for downstream analysis.
Keep the staged dataframe.tableName or the table name in the staging notice. Call brapi_dataframe_describe with that name before writing SQL. Run one read-only statement through brapi_dataframe_query. Stage further results in the same workspace to join them there. The workspace is tenant-scoped and can be further scoped to the MCP session. Keep the exact name for deployments that disable listing.
Use registerAs to save the full SQL result under a fresh name for later queries. For a long phenotype table, replace the table name below with the one returned by the matrix tool.
SELECT studyDbId, germplasmDbId, observationVariableDbId, replicateIndex, value
FROM df_example
ORDER BY studyDbId, germplasmDbId, observationVariableDbId, replicateIndex
LIMIT 100 OFFSET 0
Advance the offset by rows actually returned. If none fit the preview, narrow the projection or aggregate. A staged preview covers the fetched rows, so check upstream coverage separately. The handle's expiresAt dates its provenance. Tables live in the canvas until it expires or the table is dropped. On missing_table, check the workspace and table name, then re-stage the source if needed.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
brapi-mcp-server@cyanheads is listed by cyanheads/cyanheads — review the source before installing
npx claudepluginhub cyanheads/cyanheads --plugin brapi-mcp-server