cyanheads avatar

Pubchem Mcp Server

cyanheads/pubchem-mcp-server

Wraps the PubChem REST APIs to let Claude search chemical compounds, pull properties, safety data, bioactivity profiles, and cross-references without leaving the conversation. You get 10 tools covering identifier lookup (name, SMILES, InChIKey), substructure and similarity searches, GHS hazard classification, drug interaction data, and BioAssay queries. Results include molecular descriptors, 2D/3D structures, pharmacological classifications, and links to external databases like DrugBank and ChEMBL. Ships with both stdio and a public HTTP endpoint at pubchem.caseyjhand.com, so you can skip the local install. Built on the author's mcp-ts-core framework with rate limiting and retry logic baked in. Useful for chemistry research, drug discovery workflows, or any task that needs programmatic access to one of the largest open chemical databases.

GitHub stars
13
tools
10
transport
STDIO, HTTP
env vars
7
last updated
Nov 11, 2026

Install

From registry metadata
$ npx add-mcp https://pubchem.caseyjhand.com/mcp --name pubchem

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http pubchem https://pubchem.caseyjhand.com/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 10 tools

Verified live against the running server on Nov 6, 2026.

pubchem_search_compoundsSearch 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, or the compounds a bioassay (AID) found active or tested. Returns...13 params

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, or the compounds a bioassay (AID) found active or tested. Returns...

Parameters* required
activeOnlyboolean
Assay search only. When true (default), lists only the compounds the assay marked active; false lists every compound it tested.default: true
aidinteger
Required for assay search. PubChem Assay ID (AID) whose compounds to list, from 1 to 2147483647, e.g. 1000. Find AIDs for a biological target with pubchem_search_assays.
allowOtherElementsboolean
Formula search only. When true, includes compounds with additional elements beyond the formula.default: false
formulastring
Required for formula search. Molecular formula in Hill notation (e.g. "C6H12O6", "CaH2O2").
identifierTypestring
Required for identifier search. Type of chemical identifier: "name", "smiles", "inchi" (a full InChI string, case-sensitive), or "inchikey".one of name · smiles · inchi · inchikey
identifiersarray
Required for identifier search. Array of identifiers to resolve. The per-call cap is 25: the first 25 are looked up, and any past that (up to 1000 in all) are returned in unprocessed, in input orde...
maxResultsinteger
Maximum CIDs to return per page. The per-call cap is 200: a larger value (up to 1000) returns a page of 200 and is reported in cappedInputs. Use offset to reach matches past this page. Default: 20.default: 20
offsetinteger
Zero-based index of the first CID to return. Pass the nextOffset from a previous call to read the following page. Identifier lookups resolve every match up front, so paging them is free, and assay...default: 0
propertiesarray
Optional: fetch these properties for each result, avoiding a follow-up details call. E.g. ["MolecularFormula", "MolecularWeight", "CanonicalSMILES"].
querystring
Required for substructure/superstructure/similarity searches. A SMILES string (e.g. "CC(=O)O") or PubChem CID as a string from 1 to 2147483647 (e.g. "2244").
queryTypestring
Required for structure/similarity searches. Format of the query: "smiles" or "cid".one of smiles · cid
searchType*string
Search strategy; each mode needs its own fields. "identifier": name/SMILES/InChI/InChIKey lookup — requires identifierType and identifiers. "formula": molecular formula — requires formula. "substru...one of identifier · formula · substructure · superstructure · similarity · assay
thresholdnumber
Similarity search only. Minimum Tanimoto similarity (70-100). 90+ for close analogs, 70-80 for scaffold hops. Default: 90.default: 90
pubchem_get_compound_detailsGet 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 rule...10 params

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 rule...

Parameters* required
cids*array
PubChem Compound IDs to fetch. The per-call cap is 100: the first 100 are fetched, and any past that (up to 1000 in all) are returned in unprocessed, in input order, and reported in cappedInputs. R...
descriptionOffsetinteger
Zero-based index of the first description to return within each compound's description list. The same offset is applied to every compound in the batch. Pass the nextDescriptionOffset from a previou...default: 0
includeClassificationboolean
Include pharmacological classification: FDA Established Pharmacologic Classes, mechanisms of action, MeSH classes, and ATC codes. Fetched only for the first 10 CIDs in the batch; remaining CIDs ret...default: false
includeDescriptionboolean
Include textual descriptions (pharmacology, mechanism, therapeutic use) attributed by source. Well-studied compounds have many overlapping summaries — paged via descriptionOffset/maxDescriptions. F...default: false
includeDrugLikenessboolean
Compute drug-likeness assessment: Lipinski Rule of Five (MW, XLogP, HBD, HBA) and Veber rules (TPSA, rotatable bonds). Computed from the returned properties, so it adds no latency.default: false
includeSynonymsboolean
Fetch known names and synonyms (trade names, systematic names, registry numbers), paged via synonymOffset/maxSynonyms. Fetched for every found CID in the batch. Slower for large CID lists.default: false
maxDescriptionsinteger
Max number of distinct description entries per compound per page. The per-call cap is 20: a larger value (up to 1000) returns 20 per compound and is reported in cappedInputs. PubChem returns near-d...default: 3
maxSynonymsinteger
Max synonyms returned per compound per page. The per-call cap is 100: a larger value (up to 1000) returns 100 per compound and is reported in cappedInputs. PubChem lists hundreds for common drugs;...default: 20
propertiesarray
Properties to retrieve. Defaults to a core set: MolecularFormula, MolecularWeight, IUPACName, CanonicalSMILES, IsomericSMILES, InChIKey, XLogP, TPSA, HBondDonorCount, HBondAcceptorCount, RotatableB...
synonymOffsetinteger
Zero-based index of the first synonym to return within each compound's synonym list. The same offset is applied to every compound in the batch. Pass the nextSynonymOffset from a previous call to re...default: 0
pubchem_get_compound_imageFetch a 2D structure diagram (PNG image) for a compound by CID.2 params

Fetch a 2D structure diagram (PNG image) for a compound by CID.

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
sizestring
Image size: "small" (100x100) or "large" (300x300). Default: "large".one of small · largedefault: large
pubchem_get_compound_3d_structureGet a compound's default 3D conformer — atomic coordinates and bonds — for one CID. 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...6 params

Get a compound's default 3D conformer — atomic coordinates and bonds — for one CID. 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...

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
formatstring
Output format. "json" (default) returns parsed atoms and bonds. "sdf" returns the raw V2000 SDF text for passthrough to other tools.one of sdf · jsondefault: json
includeAlternateConformerIdsboolean
List the IDs of additional computed conformers beyond the default. Slower than the default response. Default: false.default: false
includeRawSdfboolean
For format="sdf", return the complete raw V2000 SDF even when it exceeds the safe line cap. Default false: an SDF longer than 500 lines is line-capped with disclosure. No effect when format="json".default: false
maxAtomsinteger
Cap the atoms returned in the format="json" preview. atomCount always reports the full total; omitted rows are disclosed via the truncated/shownAtoms enrichment. Defaults to the first 200 atoms.
maxBondsinteger
Cap the bonds returned in the format="json" preview. bondCount always reports the full total; omitted rows are disclosed via the truncated/shownBonds enrichment. Defaults to the first 200 bonds.
pubchem_get_compound_xrefsGet 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 th...4 params

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 th...

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
maxPerTypeinteger
Max IDs to return per xref type per page. The per-call cap is 500: a larger value (up to 1000) returns 500 per type and is reported in cappedInputs. A compound may have thousands of PubMed referenc...default: 50
offsetinteger
Zero-based index of the first ID to return within each xref type. The same offset is applied to every requested type. Pass the nextOffset from a previous call to read the following page. Default: 0.default: 0
xrefTypes*array
Cross-reference types to retrieve. String IDs: CAS (the CAS Registry Numbers deposited for this compound, most-attested first, each with the number of source records that deposited it — the first i...
pubchem_get_compound_safetyGet 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 classif...1 params

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 classif...

Parameters* required
cids*array
PubChem Compound IDs to fetch safety data for. The per-call cap is 25: the first 25 are looked up, and any past that (up to 1000 in all) are returned in unprocessed, in input order, and reported in...
pubchem_get_bioactivityGet 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)...7 params

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)...

Parameters* required
assayTypearray
Keep only assays of these types: "confirmatory" (dose-response and other follow-up assays), "screening" (primary high-throughput screens), "summary" (records summarizing a project's assays), "other...
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
maxResultsinteger
Max assay results to return per page. The per-call cap is 100: a larger value (up to 1000) returns a page of 100 and is reported in cappedInputs. Well-studied compounds have thousands of records; u...default: 20
offsetinteger
Zero-based index of the first assay to return, applied after the outcome and target filters. Pass the nextOffset from a previous call to read the following page. Default: 0.default: 0
outcomeFilterstring
Filter by activity outcome against each assay's reported target: the target a target filter matched, else the first target the assay lists. For a multi-target assay, outcomes against its other targ...one of active · inactive · alldefault: all
targetAccessionstring
Filter to assays against this target protein accession (UniProt/RefSeq/GenBank/PDB chain), e.g. "P35354", including assays recorded only under a Gene ID or another accession this compound's assay t...
targetGeneIdinteger
Filter to assays against this NCBI Gene ID (1 to 2147483647), including assays recorded only under a protein accession this compound's assay table pairs with the Gene ID (e.g. 5742 also reaches row...
pubchem_get_compound_interactionsGet 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 or...4 params

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 or...

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
kindsarray
Interaction kinds to fetch. "drug-food" (dietary interactions, from PUG View), "target" (molecular targets from the compound's assay summary: one entry per Gene ID with the accessions the table pai...
maxEntriesinteger
Max entries per kind per page. The per-call cap is 50: a larger value (up to 1000) reads a page of 50 per kind and is reported in cappedInputs. Well-studied drugs have a long tail of interactions;...default: 10
offsetinteger
Zero-based start position within each requested kind, counted in records (molecular targets, for target) rather than returned entries. The same offset applies to every kind in the call, and the kin...default: 0
pubchem_search_assaysFind 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.4 params

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.

Parameters* required
maxResultsinteger
Max AIDs to return per page. The per-call cap is 200: a larger value (up to 1000) returns a page of 200 and is reported in cappedInputs. Popular targets may have thousands of assays; use offset to...default: 50
offsetinteger
Zero-based index of the first AID to return. Pass the nextOffset from a previous call to read the following page. Default: 0.default: 0
targetQuery*string
Target identifier. Examples: "EGFR" (genesymbol), "Epidermal growth factor receptor" (proteinname), "1956" (geneid), "P00533" (proteinaccession; uppercased before lookup, except a PDB chain ID such...
targetType*string
Target identifier type. "genesymbol" and "proteinname" accept text names; a genesymbol matches the symbol case-insensitively across species, so a human symbol also returns assays on other species'...one of genesymbol · proteinname · geneid · proteinaccession
pubchem_get_summaryGet 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.2 params

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.

Parameters* required
entityType*string
Entity type. Determines ID format and returned fields.one of assay · gene · protein · taxonomy
identifiers*array
Entity identifiers. A comma-joined string is split into one identifier per piece, with whitespace trimmed. The per-call cap is 10 pieces: the first 10 are looked up, and any past that are returned...

Sponsors

Configuration

MCP_LOG_LEVELdefault: info

Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').

MCP_TRANSPORT_TYPEdefault: http

Selects the HTTP transport.

MCP_SESSION_MODEdefault: stateless

HTTP session mode: stateless, stateful, or auto. Stateless is sufficient for PubChem; auto resolves to stateful.

MCP_HTTP_HOSTdefault: 127.0.0.1

The hostname for the HTTP server.

MCP_HTTP_PORTdefault: 3010

The port to run the HTTP server on.

MCP_HTTP_ENDPOINT_PATHdefault: /mcp

The endpoint path for the MCP server.

MCP_AUTH_MODEdefault: none

Authentication mode to use: 'none', 'jwt', or 'oauth'.

Readme

@cyanheads/pubchem-mcp-server

Search the PubChem chemical database for compounds, properties, safety data, bioactivity, cross-references, and entity summaries via MCP. STDIO or Streamable HTTP.

10 Tools • 6 Resources • 1 Skill

Details

Repository
github.com/cyanheads/pubchem-mcp-server
Categories
Search & Web Crawling, Data & Analytics
Package
@cyanheads/pubchem-mcp-server
Transport
STDIO, HTTP
Registry
MCP registry, active
Resources
1
Tools verified
Nov 6, 2026

More from cyanheads

Related Search & Web Crawling MCP servers

View all
1destrayon avatarConnapsedestrayon/connapseSelf-hosted knowledge backend for AI agents with hybrid search and MCP tools13stars
2geiserx avatarTelegram Archivegeiserx/telegram-archive-mcpSearch and read your archived Telegram chats and messages13stars
3bolnet avatarMemwrightbolnet/agent-memoryEmbedded memory for AI agents with SQLite, pgvector, and Neo4j graph search.0stars
4houtini-ai avatarGoogle Knowledge Graphhoutini-ai/google-knowledge-graph-mcpSearch Google's Knowledge Graph for structured information about real-world entities13stars
5oleksandrkucherenko avatarObsidian Vault MCP Serveroleksandrkucherenko/mcp-obsidian-via-restAccess Obsidian vaults via Local REST API - read, search, and interact with notes13stars
6drolosoft avatargo-docs-mcpdrolosoft/go-docs-mcpLets your AI read PDF, Office files, EPUB, HTML, Jupyter and images, with OCR, search and paging.12stars