pubchem-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOGS_DIR | No | Directory for log file storage (if LOG_OUTPUT_MODE=file). | logs/ |
| MCP_AUTH_MODE | No | Authentication mode for HTTP: jwt or oauth. | jwt |
| MCP_HTTP_HOST | No | Host address for the HTTP server (if MCP_TRANSPORT_TYPE=http). | 127.0.0.1 |
| MCP_HTTP_PORT | No | Port for the HTTP server (if MCP_TRANSPORT_TYPE=http). | 3010 |
| MCP_LOG_LEVEL | No | Logging level (debug, info, notice, warning, error, crit, alert, emerg). | info |
| LOG_OUTPUT_MODE | No | Logging output mode: file or stdout. | file |
| MCP_TRANSPORT_TYPE | No | Transport mechanism: stdio or http. | stdio |
| MCP_ALLOWED_ORIGINS | No | Comma-separated list of allowed origins for CORS (if MCP_TRANSPORT_TYPE=http). | |
| MCP_AUTH_SECRET_KEY | No | Required for jwt auth. Minimum 32-character secret key for JWT authentication. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Use the pubchem_* tools to query PubChem's chemical database. Compounds are addressed by CID, assays by AID. Most flows start at pubchem_search_compounds (name, SMILES, InChI, InChIKey, formula, substructure, superstructure, 2D similarity, an accurate mass or molecular weight range, or an assay's compounds by AID → CIDs), then call per-CID tools for details, safety, image, cross-references, bioactivity, interactions (drug-food, or kinds: ["target"] for the targets its assays name), or 3D structure. To find assays for a biological target, chain pubchem_search_assays (gene/protein → AIDs) into pubchem_get_summary (entityType: assay) for each AID's method, targets, and compound counts, then list an assay's active compounds with pubchem_search_compounds (searchType: assay, aid); to see which targets a compound is active against, call pubchem_get_compound_interactions with kinds: ["target"]; to check one target, call pubchem_get_bioactivity with a cid plus targetGeneId/targetAccession. pubchem_get_summary covers assay/gene/protein/taxonomy entity lookups. Compound and assay records are also exposed as URI-addressable resources (e.g. pubchem://compound/{cid}, pubchem://assay/{aid}).
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": true,
"listChanged": true
} |
| extensions | {
"io.modelcontextprotocol/skills": {
"directoryRead": true
}
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pubchem_search_compoundsA | Search PubChem for chemical compounds by identifier (name, SMILES, InChI, or InChIKey, up to 25 per call), molecular formula in Hill notation, substructure or superstructure containment, 2D Tanimoto similarity, the compounds a bioassay (AID) found active or tested, or an accurate mass or molecular weight range. Returns a page of CIDs, each similarity hit with its Tanimoto score — reach matches past maxResults with offset. Optionally hydrate results with properties to avoid a follow-up pubchem_get_compound_details call. |
| pubchem_get_compound_detailsA | Get detailed compound information by CID. Returns physicochemical properties (molecular weight, SMILES, InChIKey, XLogP, TPSA, etc.), optionally with a textual description (pharmacology, mechanism, therapeutic use), known synonyms, drug-likeness assessment (Lipinski/Veber rules), and/or pharmacological classification (FDA classes, MeSH classes, ATC codes). Fetches up to 100 CIDs per call; CIDs past that are returned in unprocessed for a follow-up call. |
| pubchem_get_compound_imageA | Fetch a 2D structure diagram (PNG image) for a compound by CID. |
| pubchem_get_compound_3d_structureA | Get one 3D conformer of a compound — atomic coordinates and bonds — for one CID: its default conformer, or the one conformerId names. format="json" (default) returns atoms and bonds parsed into structured fields; format="sdf" returns the raw V2000 SDF text for passthrough to docking, rendering, or conformer tools. Optionally lists the compound's other conformer IDs, each one a value for conformerId. Not every compound has computed 3D coordinates (large molecules, mixtures, and some salts do not). |
| pubchem_get_compound_xrefsA | Get external database cross-references for a compound: PubMed citations, patent IDs, gene associations, CAS and EC numbers with the number of source records that deposited each, other registry numbers, and taxonomy IDs. Results are paged per type — capped at maxPerType with the total count reported; reach the IDs past a page with offset. PubMed IDs come highest (most recently assigned) first and the other numeric types in ascending order; CAS and EC come most-attested first; the other string IDs keep PubChem's order. A type that fails to load is named in failedTypes while the others still return; the call fails only when a type fails and no type other than ProteinGI (which PubChem no longer serves) loads. |
| pubchem_get_compound_safetyA | Get GHS (Globally Harmonized System) hazard classification and safety data for one or more compounds by CID. Returns signal word, pictograms, hazard statements (H-codes), and precautionary statements (P-codes) per compound, merged across sources, plus each source's own classification — its signal word, pictograms, H-codes with ECHA notifier agreement percentages, and notification counts — since sources often disagree. Reports ECHA "Not Classified" verdicts as their own status. |
| pubchem_get_bioactivityA | Get a compound's bioactivity profile: which assays tested it, activity outcomes (Active/Inactive/Inconclusive), target identifiers (NCBI Gene ID, UniProt/GenBank accession), quantitative values (IC50, EC50, Ki, etc.), each assay's type (confirmatory, screening, summary, other), and the PubMed IDs it cites. Filter by outcome, a specific molecular target (NCBI Gene ID or protein accession), assay type, and/or activity name (e.g. IC50) to focus the profile, and rank by potency within the named measurements — e.g. "is this compound active against target T in confirmatory assays?" or "what is its lowest IC50 against T?". |
| pubchem_get_compound_interactionsA | Get a compound's interaction data: drug-food interactions, and the molecular targets its bioassays name — one entry per target as kinds defines it, with its assay counts by outcome and most potent active value, Active targets first, most potent first. Each entry carries its originating source. Results are paged per kind, with the record total and the next offset reported for each. Drug-food coverage is richest for approved drugs; target covers any compound PubChem has assay data for, and pubchem_get_bioactivity lists one target's assays when given the entry's GeneID or accession. Drug-drug interactions (DrugBank) are unavailable while PubChem's SDQ service refuses automated requests: an explicit drug-drug request is reported in failedKinds while the other kinds still return. |
| pubchem_search_assaysA | Find PubChem bioassays associated with a biological target. Search by gene symbol (e.g. "EGFR"), protein name, NCBI Gene ID, or UniProt accession. Returns a page of assay IDs (AIDs) — page past maxResults with offset — which can be explored further with pubchem_get_summary. |
| pubchem_get_summaryA | Get descriptive summaries for PubChem entities by ID. Supports assays (AID), genes (Gene ID), proteins (UniProt accession), and taxonomy (Tax ID). Up to 10 per call; identifiers past that are returned in unprocessed for a follow-up call. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| pubchem-guide | Gates and identifier chains for the pubchem_* tools — salt vs parent CIDs, where Gene IDs and accessions come from, why gene-symbol, Gene ID, and accession searches disagree, and how to read PubChem activity labels, potency values, and GHS data without over-concluding. Use when answering a compound identity, hazard, mechanism, potency, or target-assay question through pubchem_*. |
TDQS
Scored across 10 tools
Each tool targets a distinct facet of PubChem data (search, details, 3D conformer, image, safety, xrefs, bioactivity, interactions, assay search, summaries), and the descriptions explicitly disambiguate the closest pairs: bioactivity is per-assay/per-target measurement data while interactions is per-target aggregation plus drug-food data. The main soft overlaps are pubchem_search_assays vs. pubchem_get_summary (AID) and the optional property hydration in pubchem_search_compounds vs. pubchem_get_compound_details, but these are explained clearly enough to guide selection.
All tools share a pubchem_ prefix and use verb_noun form (search_/get_), which is highly predictable. There are minor deviations: most follow get_compound_X but pubchem_get_bioactivity drops the compound_ segment, and pubchem_get_summary names no resource at all, so the resource is not always inferable from the name alone.
Ten tools is squarely in the well-scoped range for a chemical database server, and each one covers a distinct data type (search, properties, 3D, image, safety, xrefs, bioactivity, interactions, assays, summaries) without redundant entries.
The surface covers the full compound lifecycle: discovery (search by name/SMILES/formula/similarity/substructure), enrichment (properties, synonyms, drug-likeness, classification), structure (2D image, 3D conformer), safety, cross-references, bioactivity, target interactions, and assay lookup. No obvious dead ends for the stated PubChem domain; the only gap is a dedicated assay-detail tool, which pubchem_get_summary partially fills.