BRaVa MCP
BRaVa MCP
一个用于生物库罕见变异分析(BRaVa)协会关联结果的MCP服务器:针对约120万个体(来自全球10个生物库、44个统一表型、7个祖先分层)进行的罕见编码变异基于基因检验的荟萃分析。
仅提供汇总统计信息。不适用于临床。
它直接提供数据表,而非封装接口
基因水平的结果是一个单一的平面事实表,并且模型已经能够以专家级别编写SQL,因此query直接将其交付:本地61,791,444行数据,无需网络。任何问题都是一个查询,包括那些固定工具集永远无法预料的问题。
-- what does this gene do
SELECT trait, mask, p_skato, beta FROM results
WHERE gene='PCSK9' AND ancestry='All' AND mask<>'synonymous'
ORDER BY p_skato LIMIT 20
-- most pleiotropic genes
SELECT gene, count(DISTINCT trait) traits FROM results
WHERE ancestry='All' AND p_skato < 1.39e-7 GROUP BY gene ORDER BY traits DESC
-- what a European-only study would have missed
SELECT a.gene, a.trait, a.p_skato FROM results a
WHERE a.ancestry='AFR' AND a.p_skato < 2.5e-6 AND NOT EXISTS (
SELECT 1 FROM results e WHERE e.ancestry='EUR'
AND e.gene_idx=a.gene_idx AND e.pheno=a.pheno AND e.p_skato < 2.5e-6)Related MCP server: gwas-mcp
工具
工具 | 用途 |
| 对整个基因水平表的只读SQL |
| 表、列、可运行的配方,以及使有效查询在科学上错误的陷阱。请先阅读此项 |
| 基因-表型对的跨祖先复制,或对命中列表进行筛选 |
| 单个变异结果,可针对某个表型进行全基因组搜索,或针对单个基因内部搜索 |
其余三个非查询工具覆盖了SQL无法处理的情况。
gene_phenotype_detail,因为一致性计数必须排除All和non_EUR,这两个分层与正在计数的分层包含了相同的个体:显而易见的SQL会重复计数,而且看起来完全合理。
variants,因为变异水平发布是一个独立的上游格式,数据量要大一个数量级,并且更新频繁,本地副本在一周内就会过时。
schema(),因为一个语法完美的查询在这里仍然可能在科学上是错误的。效应量与旁边的p值属于不同的检验,一个掩码是校准对照而非生物学类别,祖先分层存在重叠,p值恰好为零是最强结果而非缺失值。其中几点会颠倒答案而非降低质量,这就是为什么它们与列一同提供,而不是放在README中。
数据库
873 MB,作为发布资产发布,并在首次使用时下载到~/.cache/brava-mcp/中。特意不提交到仓库:部署会每次重新克隆整个仓库,因此如果仓库内包含1GB数据,将永远被重新获取。克隆此仓库仅需3.9 MB。
由etl/build_db.py从280个已发布的phenotype/{P}.{ANC}.json文件构建。这些文件携带与19541个逐基因文件相同的数据,因此选择这种转换是为了礼貌:一次请求280个文件,而非19541个,以获得相同覆盖范围,而不是每次查询一个基因时都去请求。上游免费层的B类操作是稀缺资源;而R2的出站流量是免费的。
数据按键列排序,且未构建ART索引:带索引2.49 GB,不带索引1.75 GB,排序后0.87 GB。没有遗漏任何索引,因为这些是过滤扫描,DuckDB的区域映射已经能够处理。以上每个查询的返回时间均低于70毫秒。
运行方式
make sync # install
make db # download the published database (873 MB, once)
make test # offline suite
make test-all # + live-data checks
make eval # 14 benchmark questions, answers derived independently
make serve # HTTP daemon on :3163
uv run python server.py # stdio使用uv run python etl/build_db.py从上游重建数据库(约200秒:下载120秒,加载76秒,然后是排序压缩)。
变量 | 默认值 | 用途 |
|
| 共享守护进程使用 |
|
| 守护进程端口 |
| 发布资产 | 数据库的获取位置 |
|
| 本地数据库路径 |
| 上游R2 | 变异水平文件 |
阅读结果
beta > 0 表示风险增加(二分类表型)或表型值增加(数量表型)。
beta和se始终来自逆方差加权的Burden荟萃分析,包括在那些你读到p_skato的行上。没有SKAT-O效应量。SKAT-O是主要的综合检验。当基因内的变异方向一致时,Burden检验效力最强;当变异方向混合时,SKAT检验效力最强。
synonymous掩码是校准对照。有意义的同义结果表示残余检验膨胀,而非生物学意义。旗舰论文的阈值:基因×掩码Bonferroni 1.39e-7,基因水平Cauchy 2.5e-6,变异水平1.82e-8。
BRaVa不包含等位基因频率和常见变异GWAS。变异行链接到gnomAD以获取前者。
schema()会返回所有这些信息,外加另外五个陷阱,以及列定义。
评估
evals/questions.json包含十四个问题,所有十四个问题均由evals/resolve_golds.py直接从原始上游文件解析得到,该脚本未从brava导入任何内容,因此基准测试不会与解码错误一致,同时也可作为上游漂移检测器。
evals/selfcheck.py逐一通过这些工具运行每个问题:目前14/14通过,每个问题平均一次调用,整个集合零次出站HTTP请求。它检查每个问题的evidence(工具必须返回的值),从不检查其answer,因为有些答案是结论,无法通过字符串匹配验证。因此它证明数据是可访问的以及成本如何,而非证明模型得出了正确结论;后一半需要一个模型在环的运行器,目前尚未完成。
流量
基因水平问题是本地的,因此完全不会给上游项目带来成本。只有variants会获取数据,并且每个文件会被永久缓存。构建数据库需要280次请求,仅一次。请参见nikbaya/brava_browser#1了解与上游作者的交流。
引用
Palmer, Hill, Hodgson, 等. Rare variant association analyses across 10 global biobanks. medRxiv (2026). doi:10.64898/2026.05.21.26353759
该数据库源自该发布,通过BRaVa浏览器发布的文件构建,并根据浏览器的MIT许可证重新分发。
许可证
MIT。
Available Tools
4 toolsgene_phenotype_detailBRead-onlyIdempotent
Does a gene-trait association replicate across ancestries and biobanks?
BRaVa's distinctive view, and a tool rather than a documented query because the concordance count has to exclude the two pooled strata ('All' and 'non_EUR') that contain the same individuals as the ones being counted. The obvious SQL double-counts and looks entirely reasonable.
Pass a comma-separated list to screen a whole hit list at once: one gene at a time costs a call each, the list form returns a verdict per gene. Verdicts separate "underpowered" from "discordant", which is the distinction that matters when a stratum is fifteen times smaller than another.
| Name | Required | Description | Default |
|---|---|---|---|
| maf | No | "<0.1%" (default) or "<0.01%". | <0.1% |
| gene | Yes | Gene symbol or Ensembl id, or a comma-separated list of them. | |
| mask | No | Variant annotation mask (default "pLoF | damaging missense"). | pLoF | damaging missense |
| test | No | Burden, SKAT or SKAT-O (default SKAT-O). | SKAT-O |
| phenotype | Yes | Trait id or name. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, setting a baseline for safety. The description adds context beyond annotations: it explains why this is a tool (SQL double-counting) and describes the verdict types. This is helpful but not exhaustive—there is no mention of rate limits, authentication needs, or what happens if inputs are invalid. The description adds some behavioral insight but falls short of full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is verbose and includes extraneous technical reasoning about SQL double-counting and the tool's origin. While informative, the first three sentences could be condensed. The key actionable information (handling lists, verdict meanings) appears only in the last two sentences. The structure lacks front-loading of essential details, making it less efficient for an AI agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists (context confirms), the description does not need to detail return values. It explains the tool's purpose, input batch behavior, and verdict semantics, which suffices for most use cases. However, it omits specifics about supported biobanks, ancestry strata, or example phenotype IDs. The description is adequate for an expert but could be more complete for general AI consumption.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers all 5 parameters with descriptions (100% coverage), so the baseline is 3. The description adds extra value: it notes that the 'gene' parameter accepts a comma-separated list and that using a list returns a verdict per gene. It also clarifies the default for 'maf' and 'mask'. This goes beyond the schema, improving parameter understanding for batch usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear question defining the tool's purpose: 'Does a gene-trait association replicate across ancestries and biobanks?' This directly states the function. It also distinguishes itself as a specialized view that handles a SQL double-counting issue, which helps set it apart from generic query tools like the sibling 'query'. However, the purpose is embedded within technical reasoning, slightly reducing clarity for a general AI agent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides some usage advice: passing a comma-separated list to screen multiple genes, noting that one gene at a time costs a call each. It also explains the verdict distinction between 'underpowered' and 'discordant'. However, it does not explicitly say when to use this tool versus its siblings ('query', 'schema', 'variants') or when not to use it. The guidance is present but implicit and incomplete.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryARead-onlyIdempotent
Run read-only SQL over the whole BRaVa gene-level results table.
61.8 million rows: every gene x trait x variant-mask x MAF-cutoff x ancestry cell, with the Burden, SKAT and SKAT-O p-values, the effect size and its standard error, and the cross-cohort heterogeneity test. Local, so a query costs no network.
Call schema() first. It returns the tables, the columns, worked query
templates, and the semantic traps that make a syntactically valid query
scientifically wrong here. Several of them invert the answer rather than
degrade it.
Query the results view rather than the raw tables: it exposes p-values
instead of -log10, and labels instead of integer codes, so the obvious query
is also the correct one.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One read-only statement (SELECT / WITH / DESCRIBE / SHOW / EXPLAIN). Combine steps with a CTE rather than sending several statements. | |
| max_rows | No | Rows returned (default 50, capped 500). The response is also capped at 25,000 characters, so select the columns you need. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, so the description's behavioral burden is lower. The description adds value by disclosing the exact size of the table ('61.8 million rows'), the cost profile ('local, so a query costs no network'), and the fact that results are capped (25,000 characters, max rows 500). This goes beyond basic safety disclosure to provide performance expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear introductory sentence, a list of table contents, a callout to call schema() first, and a recommendation to use the results view. Every sentence adds value. It could be slightly more concise by removing the exact row count and focusing on the most critical guidance, but it's not overly verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of the domain (61.8 million rows, multiple dimensions per cell), the rich annotations (readOnly, openWorld, idempotent), a fully described 2-parameter schema, and the presence of an output schema, the description is remarkably complete. It explains the exact contents, potential pitfalls (semantic traps), and best practices. There is no need to discuss return values since an output schema exists.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides clear descriptions for both parameters (sql and max_rows) with examples and constraints. Schema description coverage is 100%, so the baseline is 3. The description does not add meaning beyond what the schema provides, as the schema already explains the allowed SQL statements, default row count, and character limit. The description's mention of capping (500 rows, 25,000 chars) is redundant with the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool runs 'read-only SQL over the whole BRaVa gene-level results table.' It specifies the verb ('query'), resource ('BRaVa gene-level results table'), and scope ('read-only SQL'). While the name 'query' is generic, the description distinguishes it from siblings by specifying the exact domain (BRaVa) and table type (gene-level results), making it clear what this tool does compared to 'variant' or 'schema'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises to 'call `schema()` first' to understand the correct tables, columns, and semantic traps. It warns about semantic traps that can 'invert the answer.' It recommends querying the `results` view instead of raw tables. This provides explicit when-to-use guidance and a prerequisite action (calling schema()), which is excellent for avoiding misuse.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
schemaARead-onlyIdempotent
The tables, the query templates, and the traps. Read this before querying.
Returns the shipped tables with their columns and row counts, worked queries for the questions people actually ask, the analysis vocabulary (masks, MAF cutoffs, tests, significance thresholds), and a list of ways a correct-looking query gives a wrong answer on this data. That list is not boilerplate: it covers effect sizes that belong to a different test than the p-value beside them, a mask that is a calibration control rather than a biological category, ancestry strata that overlap, and p-values of exactly zero that mean the most significant result rather than a missing one.
Returns: tables, columns, recipes, vocabulary, thresholds and pitfalls.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint, openWorldHint, and idempotentHint, which signal safety and non-mutating behavior. The description adds significant behavioral value beyond these: it details specific pitfalls (e.g., effect sizes mismatched to p-values, overlapping ancestry strata, p-values of exactly zero) that would otherwise be opaque. It also describes the return structure comprehensively.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is moderately concise but slightly verbose in the second paragraph (listing all pitfalls could be slightly tighter). However, it front-loads the critical usage instruction ('Read this before querying') and the return list. Every sentence adds value and earns its place by providing context not in structured fields.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 0 parameters, no nested objects, and a likely output schema (mentioned but not provided here), the description is remarkably complete. It covers purpose, usage timing, return structure, and even specific pitfalls. The contextual signals (parameter count 0, schema coverage 100%) confirm no gaps need filling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters and schema description coverage is 100% (though empty schema). The description adds no parameter details because there are none, but this is appropriate and complete for a parameterless tool. No further explanation needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns 'tables, columns, recipes, vocabulary, thresholds and pitfalls' – a specific resource (schema/metadata) with a distinct verb 'returns'. It distinguishes itself from siblings like 'query' and 'variants' by describing this as a metadata discovery tool rather than a data retrieval tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Read this before querying,' setting a clear usage context: this should be called before using sibling tools (e.g., 'query') to understand the data structure, pitfalls, and analysis vocabulary. It implies when-not-to-use by framing itself as preparatory, not transactional.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
variantsARead-onlyIdempotent
Single-variant results for a trait, genome-wide or inside one gene.
Drops below the gene-level burden tests to the individual variants carrying a
signal. Without gene this ranks the whole genome for the trait; with gene
it restricts to that gene and adds the per-biobank effect-direction tally,
the cross-biobank replication evidence.
Still fetched over HTTP rather than shipped in the database: the variant-level format is a separate, actively changing upstream release, an order of magnitude larger than the gene-level table, and rebuilt often enough that a local copy would be stale within the week. Each file is cached permanently once fetched.
Each row links to gnomAD, where population allele frequencies live.
| Name | Required | Description | Default |
|---|---|---|---|
| gene | No | Restrict to one gene. Omit for the genome-wide scan. | |
| chrom | No | Restrict the genome-wide scan to one chromosome ("2", "X"). | |
| limit | No | Max rows (default 25). | |
| max_p | No | p-value ceiling. The variant-level threshold is 1.82e-8. | |
| offset | No | Skip this many rows, to page through a long result set. | |
| ancestry | No | All (cross-ancestry meta, default) or a specific stratum. Only meaningful together with `gene`. | All |
| phenotype | Yes | Trait id or name. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds rich behavioral context beyond the annotations: explains the HTTP fetch mechanism, reasons for not storing the data locally (large size, frequent upstream rebuilds), caching behavior (permanent caching after first fetch), and links to external data (gnomAD). This goes far beyond the readOnlyHint, openWorldHint, and idempotentHint annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured into three clear paragraphs, front-loaded with the core purpose. It contains some explanatory detail (e.g., HTTP fetch rationale) that is valuable but slightly verbose. Overall, each sentence contributes to understanding the tool's behavior and usage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description need not detail return values. It covers purpose, modes, differentiation from siblings, caching, and external references. It does not explicitly mention pagination or error handling, but the schema descriptions for limit/offset and context signals provide that. The description is largely complete for a read-only data retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, providing baseline 3. The description adds significant value for the 'gene' parameter by explaining it enables additional per-biobank effect-direction and cross-biobank replication evidence. It also reinforces the role of 'max_p' implicitly through mention of the threshold. For other parameters, the schema descriptions suffice.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns 'single-variant results for a trait, genome-wide or inside one gene', explicitly distinguishing it from gene-level burden tests (likely a sibling tool). It uses a specific verb (returns/fetches) and resource (variants), and explains the two distinct modes of operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use genome-wide vs per-gene mode and contrasts with gene-level burden tests. It implies usage context well but does not explicitly state 'when not to use' or name alternative tools. The guidance on caching and HTTP fetch provides operational context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
gene_phenotype_detail - First observed
query - First observed
schema - First observed
variants
TDQS
Scored across 4 tools
Each tool has a distinct role: schema provides metadata and pitfalls, query runs arbitrary SQL, gene_phenotype_detail performs cross-ancestry replication analysis, and variants retrieves single-variant results. There is no overlap in functionality, and descriptions clearly differentiate use cases.
All tool names use lowercase and underscores, but they mix single-word verbs ('query', 'schema') and descriptive multi-word nouns ('gene_phenotype_detail', 'variants'). While the style is consistent (underscore_case), the pattern varies between imperative and descriptive, which is acceptable but not perfectly uniform.
Four tools are appropriate for a specialized genomic data server. Schema is a mandatory prerequisite, query enables flexible exploration, gene_phenotype_detail addresses the server's primary analysis use case, and variants provides deeper variant-level data. The count is compact and focused without being insufficient.
The server covers the main workflows: understanding the schema, running analytical SQL queries, performing replication checks, and accessing variant-level results. It lacks explicit tools for listing available traits or genes, but these can be obtained via query. The set is functionally complete for its domain, with minor gaps.
Maintenance
Related MCP Connectors
Look up allele frequencies by ancestry, gene constraint, variants, and coverage over gnomAD.
dbSNP refSNP records and HGVS/SPDI/rsID normalization for human genetic variants, from NCBI…
Canine genomics for agents: breed allele frequencies, AI pathogenicity + OMIA clinical disease layer
Pharmacogenomics for AI agents: cited drug–gene, gene and rsID lookups plus a medication screen.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAccess to 1000 Genomes Project dataset, hosted online in Dnaerys variant store2Apache 2.0
- AlicenseCqualityFmaintenanceProvides AI-powered access to major biological databases for GWAS and bioinformatics research. Enables natural language queries for protein, gene, variant, pathway, and drug discovery analysis.441MIT
- AlicenseNot gradedqualityDmaintenanceEnables real-time pharmacogenomics analysis, including variant clinical significance, drug-gene interactions, and dosing guidelines, by connecting to ClinVar, PharmGKB, gnomAD, and other databases.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query clinical genomics databases, retrieve supporting literature, analyze population genetics, and visualize biological pathways.18MIT