RCSB PDB MCP Server: 3D Structures and Data
Explore the MCP server for RCSB PDB to access 3D protein structures, experimental data, and structural bioinformatics resources.
npx -y @QuentinCody/rcsb-pdb-mcp-serverOverview
The RCSB PDB MCP Server provides a Model Context Protocol (MCP) implementation that bundles RCSB Protein Data Bank (PDB) assets into machine-consumable resources. It exposes protein 3D structures, experimental files (structure factors, electron density maps), validation reports, and related annotation in a consistent JSON resource format so downstream agents and large language models can request and ingest structural context on demand.
This server is useful for developers building retrieval-augmented workflows, automated structural analysis pipelines, or LLM integrations that need authoritative structural biology files and metadata. By packaging PDB artifacts as MCP-compatible resources, the server simplifies discovery, resolution, and streaming of structure-related data without having to manually traverse heterogeneous RCSB endpoints or file formats.
Features
- MCP-compatible endpoints that deliver structured model context for PDB entries
- Resource bundling of structure files (mmCIF/PDB), maps, structure factors, and validation reports
- Metadata-rich responses (experimental method, resolution, authors, release date)
- Support for direct file download URLs and optional streaming/proxying
- Caching and configurable TTL for backend requests to RCSB APIs
- Lightweight, container-friendly implementation suitable for local or cloud deployment
- CORS enabled for browser-based integrations and simple auth support for private deployments
Installation / Configuration
Clone the repository and run locally with Node.js, or build a Docker image.
Example: clone + Node (recommended for development)
# Create .env or export environment variables (examples below)
Example: build and run with Docker
Typical environment variables
PORT=8080 # server listen port
CACHE_TTL=3600 # seconds to cache backend responses
RCSB_API_BASE=https://data.rcsb.org
ENABLE_CORS=true
LOG_LEVEL=info
Notes:
- Configure TLS/HTTPS via a reverse proxy (nginx, Traefik) in production.
- The server uses the RCSB public APIs; no API key is required for read-only access. If you proxy through a corporate gateway, set RCSB_API_BASE to the internal endpoint.
Available Resources
The server exposes a consistent resource model. Each resource in the MCP response typically contains: id, type, mime_type, uri, size (optional), and metadata (key/value pairs).
Common resource types and examples:
| Resource name | MIME type | Typical file extension |
|---|---|---|
| atomic model (mmCIF) | chemical/x-mmcif | .cif |
| legacy PDB | chemical/x-pdb | .pdb |
| structure factors | application/octet-stream | .mtz, .sf |
| electron density map | application/octet-stream | .map, .ccp4 |
| EM map | application/octet-stream | .map, .mrc |
| validation report | application/pdf or application/json | .pdf, .json |
| sequence (FASTA) | text/plain | .fasta |
| ligand/SDF | chemical/x-mdl-sdf | .sdf |
Example simplified MCP resource (JSON)
Use Cases
Retrieve model context for an LLM assistant
- The assistant requests MCP context for a PDB ID, receives a bundle of resources (mmCIF, validation JSON, sequence) and uses metadata to prioritize content for answering structural questions.
Example curl (resolve PDB entry, returns MCP resource list)
Download and analyze the mmCIF programmatically
- Use the provided resource URI to stream the mmCIF into a parser (BioPython/MDAnalysis) for automated feature extraction.
Python example:
= = = = . # parse data with your preferred librarySearch-driven workflows
- Combine a search frontend with the MCP server: query RCSB for matches (ligand, resolution, polymer type), then call the MCP resolve endpoint for each result to obtain context for downstream analysis or visualization.
Integration Tips
- Use caching when resolving many entries to avoid hammering the RCSB APIs.
- For large files (EM maps, structure factors), prefer streaming or signed temporary URLs; the server supports returning direct download links to RCSB file servers.
- Keep resource metadata minimal but consistent so downstream consumers can filter by experimental method, resolution, or release date.
Repository and source code: https://github.com/QuentinCody/rcsb-pdb-mcp-server
This server is intended for developers integrating structural data into model-driven applications and agents; it provides a predictable, machine-oriented view over the RCSB PDB ecosystem.