io.github.cyanheads/protein-mcp-server

平台与服务

by cyanheads

用于获取和分析 3D 蛋白质结构数据的 MCP Server,支持 RCSB PDB、PDBe 与 UniProt。

什么是 io.github.cyanheads/protein-mcp-server

用于获取和分析 3D 蛋白质结构数据的 MCP Server,支持 RCSB PDB、PDBe 与 UniProt。

README

<div align="center"> <h1>@cyanheads/protein-mcp-server</h1> <p><b>Federated protein structure & annotation across experimental (PDB) and predicted (AlphaFold) models via MCP. STDIO or Streamable HTTP.</b> <div>7 Tools • 2 Resources</div> </p> </div> <div align="center">

Version License Docker MCP SDK npm TypeScript Bun

</div> <div align="center">

Install in Claude Desktop Install in Cursor Install in VS Code

Framework

</div> <div align="center">

Public Hosted Server: https://protein.caseyjhand.com/mcp

</div>

Tools

Seven tools spanning the structure-research arc — discover, fetch, find homologs, track ligands, compare, profile the corpus, and annotate — over experimental (PDB) and predicted (AlphaFold) structures from one surface:

ToolDescription
protein_search_structuresSearch experimental and predicted structures by free text, sequence, or organism/method/resolution filters, with optional facet breakdowns.
protein_get_structureFetch metadata and coordinate-file URLs by ID — experimental (PDB), predicted (AlphaFold), or best-available — with batch partial success and optional coordinate inlining.
protein_find_similarFind sequence homologs (RCSB mmseqs2) or fold homologs (Foldseek) from a sequence, PDB ID, or UniProt accession.
protein_track_ligandsResolve ligand names/formulas to component IDs, find structures containing a ligand, or map binding-site residues.
protein_compare_structuresStructurally align multiple structures (TM-align / jFATCAT) to a reference or as a full pairwise matrix.
protein_analyze_collectionProfile the PDB into distributions and trends with server-side facets — counts, histograms, timelines, and cross-tabs.
protein_get_annotationsFetch UniProt features and natural variants plus InterPro domain/family memberships with GO terms.

protein_search_structures

Federated search across experimental (PDB) and predicted (computed-model) structures via RCSB Search v2.

  • Free-text, protein-sequence (triggers an mmseqs2 similarity search), and organism / method / resolution filters
  • content_type scopes the search to experimental, predicted, or all — the default all is a genuine union of both universes, so computed models appear alongside PDB entries
  • Every hit names its source; experimental hits are enriched with title, method, resolution, and organism, while computed models carry the UniProt accession parsed from their ID
  • Optional facets return a method / organism / release-year breakdown alongside the hits at no extra call, each reporting how many matches carry no value for that dimension; each dimension may be listed once
  • Chain hit IDs straight into protein_get_structure

protein_get_structure

Fetch structures with metadata and coordinate-file URLs, resolving across providers by source.

  • source: experimental takes PDB entry IDs, batched in one RCSB GraphQL call; it also resolves the computed-model IDs search returns (AF_* / MA_*), which come back as source: predicted credited to their modelling provider
  • source: predicted takes UniProt accessions and returns the AlphaFold model with pLDDT/PAE confidence
  • source: best_available takes UniProt accessions and returns the top federated model (experimental if one exists, else the best prediction)
  • Per-ID partial success — unresolved IDs are listed in failed[], not a batch-level error
  • include_coords inlines coordinate content; when a batch overflows the response budget it returns a per-structure size outline, so you can re-call with sections: [ids] for specific structures
  • Every response carries an attribution block naming the upstream data licenses and citations (see Upstream data licensing)

protein_find_similar

Find structurally or evolutionarily related proteins, by sequence or by fold.

  • by: sequence runs a synchronous RCSB mmseqs2 search; by: structure runs an asynchronous Foldseek search against experimental and predicted databases
  • Query from a raw one-letter sequence, a PDB ID, or a UniProt accession
  • Foldseek targets default to pdb100 + afdb50; override via databases (e.g. afdb-swissprot, BFVD)
  • Async jobs that exceed the poll budget return status: computing with a ticketId — re-call with ticket_id set to that value to poll the same job instead of resubmitting
  • Each hit names the engine and source database it came from

protein_track_ligands

Ligand discovery and binding-site analysis across the PDB.

  • mode: find_ligand resolves a name or formula to chemical component IDs with formula, weight, SMILES, and InChIKey
  • mode: structures_with_ligand returns PDB entries containing a ligand by exact component ID
  • mode: binding_site returns the protein residues lining a ligand's pocket in a structure, with contact distances
  • Binding sites are experimental-only — computed from deposited coordinates (predicted models carry no bound ligands)

protein_compare_structures

Structural alignment of multiple structures (up to the configured PROTEIN_MAX_COMPARE_STRUCTURES cap) via the RCSB Structural Comparison service.

  • Methods: tm-align, fatcat-rigid, fatcat-flexible
  • reference: first aligns every structure to the first; reference: all_pairs computes the full pairwise matrix
  • Optional per-structure chain restricts the alignment to a single chain
  • A structure repeated in structures[] is compared once — the repeat would only add a self-alignment and a mirrored pair, which the resume mechanism cannot tell apart from the original
  • Each pair is an independent async job, fanned out with a concurrency cap and per-pair partial success — a pair still computing when the budget elapses returns status: computing with its job uuid, and a failed pair degrades its row without sinking the others
  • Re-call with a matching { a, b, uuid } entry in resume[] (copied from a prior response's pairs[]) to poll a computing pair's job instead of resubmitting
  • Returns TM-score, RMSD, and aligned-residue count per pair, plus modeledResidues and coverage — each a [a, b] tuple, with coverage a 0–100 percentage of that structure's own modeled-residue count

protein_analyze_collection

Profile the PDB into distributions and trends over an optional scoping query — backed by RCSB's server-side facet engine (one call, compact buckets, no row pull).

  • Group by method, organism, polymer_type, resolution, release_year, or molecular_weight
  • One group_by dimension for a breakdown, or two distinct dimensions for a cross-tab (the first nests the second); a repeated dimension is rejected
  • interval sets the bin width for value histograms or the period for date histograms (year / month / quarter)
  • Scope with a free-text query, organism, method, or max_resolution; content_type selects the structure universe
  • bucket_limit caps buckets per dimension level, not per response — a cross-tab applies it separately to the parent dimension and to the nested child inside each parent bucket, so up to bucket_limit × (1 + bucket_limit) buckets come back. Each level flags its own truncation, and bucketsReturned gives the realized total
  • Every dimension reports missingValueCount — matches in scope carrying no value for that attribute, which therefore fall in no bucket (a resolution breakdown does not cover NMR entries, and neither method nor resolution covers computed models)

protein_get_annotations

Sequence and functional annotation for a protein.

  • UniProt features (domains, binding sites, PTMs) and natural sequence variants
  • InterPro domain/family memberships (Pfam, PROSITE, …) with associated GO terms
  • Provide a UniProt accession directly, or a PDB ID — resolved to a UniProt accession via the structure's sequence cross-reference
  • A multi-chain PDB entry can map to several accessions; the default is the deterministic lowest-author-chain pick, with the alternatives listed under ambiguity. Pass chain (an author chain ID, e.g. A) to select a specific one
  • include scopes which annotation classes are fetched: features, domains, variants, or all
  • Every response carries an attribution block naming the upstream data licenses and citations (see Upstream data licensing)

Resources

TypeNameDescription
Resourcepdb://{entry_id}Experimental structure summary for a PDB entry — title, method, resolution, organism, chains, and bound ligands.
Resourceaf://{uniprot}Predicted-structure summary for a UniProt accession from AlphaFold DB — mean pLDDT, confidence-band fractions, model URLs, and version.

All resource data is also reachable via tools — pdb://{entry_id} mirrors protein_get_structure for source: experimental, and af://{uniprot} mirrors it for source: predicted. Many MCP clients are tool-only and don't surface resources; the summaries remain reachable through the tools.

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool and resource definitions — single file per primitive, framework handles registration and validation
  • Unified error handling — handlers throw, framework catches, classifies, and formats
  • Pluggable auth: none, jwt, oauth
  • Swappable storage backends: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1
  • Structured logging with optional OpenTelemetry tracing
  • STDIO and Streamable HTTP transports

Protein-specific:

  • One federated surface over experimental (PDB) and predicted (AlphaFold / 3D-Beacons) structures — search, fetch, and compare treat both universes the same
  • Keyless across every upstream — RCSB, AlphaFold DB, 3D-Beacons, UniProt, InterPro, and Foldseek, no API keys to provision
  • Corpus analytics run server-side on RCSB's facet engine — distributions, histograms, and cross-tabs in one call, no row pull and no SQL workspace
  • Async alignment and Foldseek jobs poll within a bounded budget and hand back a job ticket (ticketId / per-pair uuid) instead of blocking — re-call with ticket_id or a resume[] entry to poll the same job instead of resubmitting

Agent-friendly output:

  • Provenance on every response — each hit carries a source (experimental / predicted), the engine and database that produced it, and effective-query / total-count echoes so agents can reason about coverage
  • Graceful partial failure — batch fetches and pairwise comparisons return per-item rows (failed[], per-pair status) instead of failing the whole request, each with actionable recovery text
  • Discriminated output contracts — typed source and status unions, computing results with resume tickets, and budget-overflow outlines let callers branch on data, not string parsing

Getting started

Public Hosted Instance

A public instance is available at https://protein.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{
  "mcpServers": {
    "protein": {
      "type": "streamable-http",
      "url": "https://protein.caseyjhand.com/mcp"
    }
  }
}

Self-hosted

Add the following to your MCP client configuration file. No API key is required — every upstream provider is keyless.

json
{
  "mcpServers": {
    "protein-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/protein-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Or with npx (no Bun required):

json
{
  "mcpServers": {
    "protein-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/protein-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Or with Docker:

json
{
  "mcpServers": {
    "protein-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/protein-mcp-server:latest"]
    }
  }
}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.3.2 or higher (or Node.js v24+).
  • No accounts or API keys — RCSB, AlphaFold DB, 3D-Beacons, UniProt, InterPro, and Foldseek are all public and keyless.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/protein-mcp-server.git
  1. Navigate into the directory:
sh
cd protein-mcp-server
  1. Install dependencies:
sh
bun install

Configuration

All upstream providers are keyless, so the server runs out of the box with no configuration. Every variable below is optional.

VariableDescriptionDefault
PROTEIN_ASYNC_POLL_TIMEOUT_MSMax wall-clock to poll an async job (alignment / Foldseek) before returning a computing result.30000
PROTEIN_MAX_BATCH_IDSCap on IDs accepted by protein_get_structure in one batch (1–100).25
PROTEIN_MAX_COMPARE_STRUCTURESCap on structures per protein_compare_structures call (2–25).10
PROTEIN_FACET_BUCKET_CAPDefault cap on buckets per protein_analyze_collection dimension (1–500).50
PROTEIN_FANOUT_CONCURRENCYMax concurrent upstream requests for per-ID / per-pair fan-out (1–16).5
RCSB_SEARCH_BASE_URLBase URL for the RCSB Search API v2.https://search.rcsb.org
ALPHAFOLD_BASE_URLBase URL for the AlphaFold Protein Structure Database API.https://alphafold.ebi.ac.uk
FOLDSEEK_BASE_URLBase URL for the Foldseek structural-similarity search service.https://search.foldseek.com
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
OTEL_ENABLEDEnable OpenTelemetry instrumentation.false

See .env.example for the full list of provider base-URL overrides and tuning limits.

Running the server

Local development

  • Build and run:

    sh
    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:stdio
    # or
    bun run start:http
    
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, security
    bun run test       # Vitest test suite
    bun run lint:mcp   # Validate MCP definitions against spec
    

Docker

sh
docker build -t protein-mcp-server .
docker run --rm -e MCP_TRANSPORT_TYPE=http -p 3010:3010 protein-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/protein-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources and inits the provider services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts).
src/mcp-server/resourcesResource definitions (*.resource.ts).
src/servicesProvider service layer — RCSB, AlphaFold, 3D-Beacons, UniProt, InterPro, Foldseek, and shared HTTP/identifier helpers.
tests/Unit and integration tests mirroring src/.

Development guide

See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources via the barrels in src/mcp-server/*/definitions/index.ts
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Contributing

Issues and pull requests are welcome. Run checks and tests before submitting:

sh
bun run devcheck
bun run test

Upstream data licensing

Structure and annotation data comes from public upstream databases, each under its own license. protein_get_structure and protein_get_annotations carry an attribution block on every response — the license, citation, and homepage for each source that contributed to that specific response — so the attribution obligation travels with the data to downstream consumers rather than living only here. CC BY / CC BY-SA sources require attribution on redistribution; CC0 sources are citation-only (attribution encouraged, not required).

SourceContributes toLicense
RCSB PDBprotein_get_structure — experimental recordsCC0 1.0 Universal
AlphaFold DBprotein_get_structure — predicted modelsCC BY 4.0
ModelArchiveprotein_get_structureMA_* computed modelsCC BY 4.0
SWISS-MODELprotein_get_structurebest_available modelsCC BY-SA 4.0
BFVDprotein_get_structurebest_available modelsCC BY 4.0
UniProtprotein_get_annotationsCC BY 4.0
InterProprotein_get_annotations — domain/family dataCC0 1.0 Universal
GOprotein_get_annotations — GO termsCC BY 4.0

best_available federates predicted models through 3D-Beacons, so the attribution block credits the actual contributing provider (AlphaFold DB, SWISS-MODEL, BFVD, …); a provider without a curated license entry carries a See provider terms fallback pointing back to 3D-Beacons rather than a fabricated license. InterPro's own domain/family classifications are CC0; the GO terms carried alongside them are separately CC BY 4.0, so each is credited independently only when it actually contributes. Full citations for each source travel in the attribution block of the relevant tool responses. This covers upstream data licensing — the server's own code is licensed separately (see License).

License

Apache-2.0 — see LICENSE for details.

常见问题

io.github.cyanheads/protein-mcp-server 是什么?

用于获取和分析 3D 蛋白质结构数据的 MCP Server,支持 RCSB PDB、PDBe 与 UniProt。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描171.4k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描171.4k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描24.9k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
89.7k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
80.0k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
72.9k

评论