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.
Inputs: gene (required), phenotype (required), maf, mask, +1 more. Returns: result
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.
Inputs: sql (required), max_rows. Returns: result
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.
Inputs: no named parameters. Returns: result
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.
Inputs: phenotype (required), gene, chrom, limit, +3 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
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
Ancestry allele frequencies, LoF constraint, variant lists, and coverage from gnomAD, with ClinVar.
Find pharmacogenomics guidelines, translate diplotypes, and retrieve prescribing recommendations.
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
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAccess to 1000 Genomes Project dataset, hosted online in Dnaerys variant store3Apache 2.0
- AlicenseCqualityBmaintenanceProvides 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.4449 PyPI1MIT
- 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.15MIT