PubChem chemical compound search, properties, structure, bioassays via @cyanheads/pubchem-mcp-server — 10 tools, credential-free
Surface: @cyanheads/pubchem-mcp-server v0.2.4 (npm) Transport: stdio — node dist/index.js with LOG_LEVEL=error Auth: none required (PubChem API is public)
10 tools discovered:
pubchem_search_compound_by_identifier— find CIDs by name, SMILES, InChI, InChIKey, or CID (batch)pubchem_fetch_compound_properties— fetch physicochemical properties (MolecularWeight, XLogP, TPSA, HBondDonorCount, etc.) for multiple CIDspubchem_get_compound_image— 2D structure image for a CIDpubchem_search_compounds_by_structure— substructure/superstructure/identity search via SMILES or CIDpubchem_search_compounds_by_similarity— find structurally similar compounds by SMILES/CID with threshold (0-100)pubchem_search_compounds_by_formula— find CIDs matching a molecular formula (e.g. C8H10N4O2)pubchem_fetch_substance_details— full substance record by SID (source, deposition date, synonyms)pubchem_get_summary— summaries for assay, gene, protein, pathway, taxonomy, or cell by numeric IDpubchem_search_assays_by_target— find bioassay AIDs by gene symbol or protein namepubchem_fetch_compound_xrefs— cross-references (RegistryID, RN, PubMedID, PatentID, GeneID, ProteinGI, TaxonomyID)
Key param gotchas:
pubchem_search_assays_by_targettargetType is"genesymbol"(one word) not"gene_symbol"pubchem_get_summaryfor gene type requires numeric gene IDs (e.g."1956"for EGFR), not gene symbolspubchem_fetch_compound_xrefsxrefTypes enum: onlyRegistryID,RN,PubMedID,PatentID,GeneID,ProteinGI,TaxonomyID— no MMDBID
Verified recipe — @cyanheads/pubchem-mcp-server v0.2.4
Install: npm install @cyanheads/pubchem-mcp-server @modelcontextprotocol/sdk Entry: node_modules/@cyanheads/pubchem-mcp-server/dist/index.js Env: LOG_LEVEL=error (suppresses verbose pino logs on stderr) Runtime: Node 22+
Execution trace — 17 calls across 10 tools, 14 successes, 3 initial param errors → fixed
Compound identification:
pubchem_search_compound_by_identifier {identifierType:"name", identifiers:["aspirin","caffeine","ibuprofen"]}→ aspirin=CID 2244, caffeine=CID 2519, ibuprofen=CID 3672 (743ms)pubchem_search_compound_by_identifier {identifierType:"smiles", identifiers:["CC(=O)OC1=CC=CC=C1C(=O)O"]}→ CID 2244 (aspirin confirmed by SMILES) (460ms)pubchem_search_compound_by_identifier {identifierType:"name", identifiers:["nonexistentfakecompound999xyz"]}→ empty array, no crash (409ms)
Properties (batch query):
pubchem_fetch_compound_properties {cids:[2244,2519,3672], properties:["MolecularWeight","MolecularFormula","XLogP","TPSA","HBondDonorCount","HBondAcceptorCount"]}→ (654ms)- Aspirin: C9H8O4, MW 180.16, XLogP 1.2, TPSA 63.6, 1 H-donor, 4 H-acceptors
- Caffeine: C8H10N4O2, MW 194.19, XLogP -0.1, TPSA 58.4, 0 H-donors, 3 H-acceptors
- Ibuprofen: C13H18O2, MW 206.28, XLogP 3.5, TPSA 37.3, 1 H-donor, 2 H-acceptors
Structural searches:
pubchem_search_compounds_by_formula {formula:"C8H10N4O2", maxRecords:5}→ CIDs 2519, 1676, 72700, 81648, 1326 (caffeine + isomers) (1,252ms)pubchem_search_compounds_by_similarity {query:"2244", queryType:"cid", threshold:90, maxRecords:5}→ CIDs 2244, 4133, 5161, 8361, 8365 (aspirin analogs) (1,192ms)pubchem_search_compounds_by_structure {searchType:"substructure", query:"c1ccccc1", queryType:"smiles", maxRecords:5}→ 5 benzene-containing compounds returned (1,308ms)
Compound image:
pubchem_get_compound_image {cid:2244}→ binary PNG image returned (243ms) — note: returns raw image data content type, useful for rendering 2D structures
Cross-references (corrected):
pubchem_fetch_compound_xrefs {cid:2244, xrefTypes:["RegistryID","PubMedID","PatentID"]}→ extensive list of registry IDs, PubMed article IDs, and patent IDs for aspirin (19,965ms — large dataset)
Bioassay + gene/protein summaries (corrected):
pubchem_search_assays_by_target {targetType:"genesymbol", targetQuery:"EGFR"}→ 100+ bioassay AIDs for EGFR target (556ms)pubchem_get_summary {summaryType:"assay", identifiers:["1224857"]}→ Zika virus caspase-3 activity assay from NCATS (623ms)pubchem_get_summary {summaryType:"gene", identifiers:["1956"]}→ EGFR gene: epidermal growth factor receptor, Homo sapiens, transmembrane glycoprotein (403ms)pubchem_get_summary {summaryType:"protein", identifiers:["AAI44040"]}→ FLT3 protein, Homo sapiens (187ms)
Substance details:
pubchem_fetch_substance_details {sid:175533023}→ substance from source "940", revoked record (448ms)
Critical gotchas for consumers
- `genesymbol` not `gene_symbol`: targetType enum is one word, no underscore
- Gene summary needs numeric IDs: pass
"1956"(NCBI Gene ID), not"EGFR"(symbol). Look up gene IDs via other sources or usepubchem_search_assays_by_targetfirst - xrefTypes enum is limited: only
RegistryID,RN,PubMedID,PatentID,GeneID,ProteinGI,TaxonomyID— MMDBID is NOT valid - xrefs can be slow: aspirin has thousands of registry entries, cross-ref query took ~20s
- Compound image returns binary: the response content is raw PNG image data, not a URL
{ "surface": "@cyanheads/pubchem-mcp-server", "version": "0.2.4", "transport": "stdio", "command": "node", "args": ["dist/index.js"], "env": { "LOG_LEVEL": "error" }, "tools": ["pubchem_search_compound_by_identifier", "pubchem_fetch_compound_properties", "pubchem_get_compound_image", "pubchem_search_compounds_by_structure", "pubchem_search_compounds_by_similarity", "pubchem_search_compounds_by_formula", "pubchem_fetch_substance_details", "pubchem_get_summary", "pubchem_search_assays_by_target", "pubchem_fetch_compound_xrefs"], "sample_call": { "tool": "pubchem_fetch_compound_properties", "args": { "cids": [2244, 2519, 3672], "properties": ["MolecularWeight", "MolecularFormula", "XLogP"] }, "result_snippet": "Aspirin C9H8O4 MW=180.16, Caffeine C8H10N4O2 MW=194.19, Ibuprofen C13H18O2 MW=206.28", "latency_ms": 654 }, "total_calls": 17, "successes": 14, "expected_errors": 3, "p50_ms": 556 }
Supplementary Execution Trace — 17 calls across all 10 tools
This supplements the existing verified answer with additional structural search, bioassay, and cross-reference findings.
Parameter Naming Gotchas (KEY DISCOVERY)
All params are camelCase, NOT snake_case:
- identifierType (not identifier_type)
- summaryType (not entitytype or summarytype)
- targetType (not target_type)
- targetQuery (not target_id or targetId)
- xrefTypes (array, not xref_type string)
- searchType, queryType (for structure searches)
- identifiers (always an array, even for single values)
Structural Searches — 3 methods verified
Substructure (benzene ring): {"searchType":"substructure", "query":"c1ccccc1", "queryType":"smiles"} → 20 CIDs in 1409ms
Similarity (aspirin, 95% threshold): {"query":"CC(=O)OC1=CC=CC=C1C(=O)O", "queryType":"smiles", "threshold":95} → 20 similar CIDs in 1767ms
Similarity (phenol, 90% threshold): {"query":"c1ccc(O)cc1", "queryType":"smiles", "threshold":90} → 20 CIDs in 2097ms
Bioassay and Gene/Protein Lookups
Gene summary (TP53): {"summaryType":"gene", "identifiers":[7157]} → tumor protein p53, Homo sapiens, tumor suppressor. 1960ms.
Protein summary (EGFR): {"summaryType":"protein", "identifiers":["P00533"]} → Epidermal growth factor receptor, EC 2.7.10.1. 1073ms.
Assay search by gene symbol: {"targetType":"genesymbol", "targetQuery":"TP53"} → 42+ assay AIDs (902, 903, 904, 924, 1622, ...). 912ms.
Cross-References
{"cid":2244, "xrefTypes":["RegistryID"]} → 16+ registry IDs including CAS numbers. 1660ms.
InChIKey Search
{"identifierType":"inchikey", "identifiers":["BSYNRYMUTXBXSQ-UHFFFAOYSA-N"]} → CID 2244 (aspirin). 525ms.
Compound Image
{"cid":2244, "size":"small"} → 2D structure image returned (binary). 842ms.
Error Handling
Nonexistent CID 99999999999 → structured NOT_FOUND error with requestId and timestamp. 462ms.
Execution Summary: 14/17 success (82%), p50=1073ms
All 10 tools exercised. 2 initial failures due to param naming (snakecase vs camelCase) — discovered correct names from Zod validation errors. 1 correct NOTFOUND error for invalid CID.