CCM
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Claude Code Marketplaces

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Skill index
  • MCP index
  • Marketplace index
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by mertbuilds.com

Independent project, not affiliated with Anthropic
cyanheads avatar

Pubchem Mcp Server

cyanheads/pubchem-mcp-server
910 toolsSTDIO, HTTPregistry active
Summary

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.

Install to Claude Code

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

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

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →

Tools

Verified live against the running server on Jun 10, 2026.

verified live10 tools
pubchem_search_compoundsSearch PubChem for chemical compounds by identifier (name, SMILES, or InChIKey, batched up to 25), molecular formula in Hill notation, substructure or superstructure containment, or 2D Tanimoto similarity. Optionally hydrate results with properties to avoid a follow-up pubchem...10 params

Search PubChem for chemical compounds by identifier (name, SMILES, or InChIKey, batched up to 25), molecular formula in Hill notation, substructure or superstructure containment, or 2D Tanimoto similarity. Optionally hydrate results with properties to avoid a follow-up pubchem...

Parameters* required
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", or "inchikey".one of name · smiles · inchikey
identifiersarray
Required for identifier search. Array of identifiers to resolve (1-25). Examples: ["aspirin", "ibuprofen"] for name, ["CC(=O)OC1=CC=CC=C1C(=O)O"] for SMILES, ["BSYNRYMUTXBXSQ-UHFFFAOYSA-N"] for inc...
maxResultsnumber
Maximum CIDs to return (1-200). Default: 20.default: 20
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 (e.g. "2244").
queryTypestring
Required for structure/similarity searches. Format of the query: "smiles" or "cid".one of smiles · cid
searchType*string
Search strategy. "identifier": name/SMILES/InChIKey lookup. "formula": molecular formula. "substructure": find compounds containing the query as a substructure. "superstructure": find compounds tha...one of identifier · formula · substructure · superstructure · similarity
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), all known synonyms, drug-likeness assessment (Lipinski/Veber...7 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), all known synonyms, drug-likeness assessment (Lipinski/Veber...

Parameters* required
cids*array
PubChem Compound IDs to fetch (1-100). Batched efficiently. Resolve from names/SMILES with pubchem_search_compounds.
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 — capped via maxDescriptions. Fetched only for t...default: false
includeDrugLikenessboolean
Compute drug-likeness assessment: Lipinski Rule of Five (MW, XLogP, HBD, HBA) and Veber rules (TPSA, rotatable bonds). No extra API calls — computed from properties.default: false
includeSynonymsboolean
Fetch all known names and synonyms (trade names, systematic names, registry numbers). One API call per CID — slower than the property batch for large CID lists.default: false
maxDescriptionsinteger
Max number of distinct description entries per compound (1-20). PubChem returns near-duplicate summaries from many depositors; we dedup and cap to keep responses focused. Default: 3.default: 3
propertiesarray
Properties to retrieve. Defaults to a core set: MolecularFormula, MolecularWeight, IUPACName, CanonicalSMILES, IsomericSMILES, InChIKey, XLogP, TPSA, HBondDonorCount, HBondAcceptorCount, RotatableB...
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 parsed atoms and bonds the model can reason over directly; format="sdf" returns the raw V2000 SDF text for passthrough to docking, rendering, or conformer tools....3 params

Get a compound's default 3D conformer — atomic coordinates and bonds — for one CID. format="json" (default) returns parsed atoms and bonds the model can reason over directly; format="sdf" returns the raw V2000 SDF text for passthrough to docking, rendering, or conformer tools....

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. Adds one extra API call. Default: false.default: false
pubchem_get_compound_xrefsGet external database cross-references for a compound: PubMed citations, patent IDs, gene/protein associations, registry numbers, and taxonomy IDs. Results are capped per type with total counts reported.3 params

Get external database cross-references for a compound: PubMed citations, patent IDs, gene/protein associations, registry numbers, and taxonomy IDs. Results are capped per type with total counts reported.

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
maxPerTypenumber
Max IDs to return per xref type (1-500). A compound may have thousands of PubMed references. Total count always reported. Default: 50.default: 50
xrefTypes*array
Cross-reference types to retrieve. String IDs: RegistryID (DSSTox/EPA registry numbers), RN (CAS numbers), PatentID. Numeric IDs: PubMedID, GeneID (NCBI Gene), ProteinGI (legacy NCBI Protein GI), T...
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. Data sourced from PubChem depositors — source attribu...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. Data sourced from PubChem depositors — source attribu...

Parameters* required
cids*array
PubChem Compound IDs to fetch safety data for (1-25). Resolve from names/SMILES with pubchem_search_compounds.
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), and quantitative values (IC50, EC50, Ki, etc.). Filter by outcome and/or a specific molecular target (N...5 params

Get a compound's bioactivity profile: which assays tested it, activity outcomes (Active/Inactive/Inconclusive), target identifiers (NCBI Gene ID, UniProt/GenBank accession), and quantitative values (IC50, EC50, Ki, etc.). Filter by outcome and/or a specific molecular target (N...

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
maxResultsnumber
Max assay results to return (1-100). Well-studied compounds have thousands of records. Default: 20.default: 20
outcomeFilterstring
Filter by activity outcome. "active" shows only assays where the compound showed activity — most useful for understanding biological profile. Default: "all".one of active · inactive · alldefault: all
targetAccessionstring
Filter to assays against this target protein accession (UniProt/GenBank), e.g. "P35354". Obtain accessions from pubchem_search_assays or the targetAccession field of an unfiltered result here.
targetGeneIdinteger
Filter to assays against this NCBI Gene ID. Obtain Gene IDs from pubchem_search_assays or the targetGeneId field of an unfiltered result here. Combine with outcomeFilter="active" to answer "is this...
pubchem_get_compound_interactionsGet a compound's interaction data: drug-drug interactions (DrugBank), drug-food interactions, and chemical-target interactions (binding/activity from BindingDB, ChEMBL, and others). Each entry carries its originating source. Richest for approved drugs; many compounds have no d...3 params

Get a compound's interaction data: drug-drug interactions (DrugBank), drug-food interactions, and chemical-target interactions (binding/activity from BindingDB, ChEMBL, and others). Each entry carries its originating source. Richest for approved drugs; many compounds have no d...

Parameters* required
cid*integer
PubChem Compound ID. Resolve from name/SMILES with pubchem_search_compounds.
kindsarray
Interaction kinds to fetch. "drug-drug" (interactions with other drugs), "drug-food" (dietary interactions), "target" (binding/activity against molecular targets). Default: ["drug-drug"].
maxEntriesinteger
Max entries per kind (1-50). Well-studied drugs have a long tail of interactions. Default: 10.default: 10
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 assay IDs (AIDs) which can be explored further with pubchem_get_summary.3 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 assay IDs (AIDs) which can be explored further with pubchem_get_summary.

Parameters* required
maxResultsnumber
Max AIDs to return (1-200). Popular targets may have thousands of assays. Default: 50.default: 50
targetQuery*string
Target identifier. Examples: "EGFR" (genesymbol), "Epidermal growth factor receptor" (proteinname), "1956" (geneid), "P00533" (proteinaccession).
targetType*string
Target identifier type. "genesymbol" and "proteinname" accept text names. "geneid" accepts NCBI Gene IDs. "proteinaccession" accepts UniProt accessions.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.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.

Parameters* required
entityType*string
Entity type. Determines ID format and returned fields.one of assay · gene · protein · taxonomy
identifiers*array
Entity identifiers (1-10). Type depends on entityType: - assay: AID (number), e.g. [1000] - gene: Gene ID (number), e.g. [1956] - protein: UniProt accession (string), e.g. ["P00533"] - taxonomy: Ta...

@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

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework

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


Overview

Chemical compound and bioassay data from PubChem's PUG REST and PUG View APIs. Search compounds by identifier, formula, or structure; fetch physicochemical properties, safety data, bioactivity, interactions, cross-references, and 3D structures; find bioassays by biological target. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.

Tools

ToolDescription
pubchem_search_compoundsSearch for compounds by name, SMILES, InChIKey, formula, substructure, superstructure, or 2D similarity, or list the compounds a bioassay found active.
pubchem_get_compound_detailsGet physicochemical properties, descriptions, synonyms, drug-likeness, and classification for compounds by CID.
pubchem_get_compound_imageFetch a 2D structure diagram (PNG) for a compound by CID.
pubchem_get_compound_3d_structureFetch a 3D conformer (atomic coordinates and bonds) for a compound by CID, as parsed JSON or raw SDF.
pubchem_get_compound_xrefsGet external database cross-references (PubMed, patents, genes, proteins, etc.).
pubchem_get_compound_safetyGet GHS hazard classification and safety data for one or more compounds by CID (batch).
pubchem_get_bioactivityGet a compound's bioactivity profile: assay results, targets, and activity values; filter by outcome or molecular target.
pubchem_get_compound_interactionsGet drug-drug, drug-food, and chemical-target interactions for a compound by CID.
pubchem_search_assaysFind bioassays by biological target (gene symbol, protein, Gene ID, UniProt accession).
pubchem_get_summaryGet summaries for PubChem entities: assays, genes, proteins, taxonomy.

Resources

Compound and assay records are also exposed as URI-templated resources, backed by the same client methods as the tools; many MCP clients are tool-only and never surface resources.

ResourceDescription
pubchem://compound/{cid}Core physicochemical properties (JSON).
pubchem://compound/{cid}/safetyGHS hazard classification (JSON).
pubchem://compound/{cid}/image2D structure diagram (PNG).
pubchem://compound/{cid}/xrefsExternal cross-references (JSON).
pubchem://compound/{cid}/bioactivityBioassay activity profile (JSON).
pubchem://assay/{aid}BioAssay summary (JSON).

Capability reference

pubchem_search_compounds tool

  • Six search strategies: identifier (name/SMILES/InChIKey, 25 looked up per call, the rest returned in unprocessed), formula (Hill notation, optional allowOtherElements), substructure/superstructure containment, 2D Tanimoto similarity (threshold 70-100, default 90), or assay (the compounds a bioassay marked active, or with activeOnly: false every compound it tested)
  • Each strategy needs its own fields — identifier: identifierType + identifiers; formula: formula; substructure/superstructure/similarity: query + queryType; assay: aid — and a missing or blank one is rejected before the upstream call
  • Caps at 200 CIDs per page (default 20; a larger maxResults is served at 200 and reported in cappedInputs); offset pages to a ceiling of 10,000 — identifier lookups resolve every match up front so paging is free, assay searches fetch only the requested page, while formula/structure/similarity searches cost more upstream per deep page
  • Assay mode reports the exact count of active (or tested) compounds as totalFound, answers an assay with no actives with an empty page and a notice, and fails a nonexistent AID as aid_not_found
  • Optional properties hydration avoids a follow-up pubchem_get_compound_details call
  • Identifier mode reports unresolvedIdentifiers for inputs that resolved to no CID — no PubChem match, or a SMILES PubChem cannot interpret — while the rest of the batch still resolves, plus notices when multiple inputs collide on one CID
  • A query PubChem cannot search on (malformed SMILES or formula, a * wildcard atom, a CID with no record) fails fast with a search_query_rejected hint naming what to fix
  • Reports an exact totalFound when the full match set was observed, or a totalFoundAtLeast floor when a bounded upstream search saturated

pubchem_get_compound_details tool

  • Up to 100 CIDs per call, with any past that returned in unprocessed for a follow-up call; 27 available properties, defaulting to a core set of 14 (formula, weight, IUPAC name, SMILES forms, InChIKey, XLogP, TPSA, H-bond/rotatable-bond counts, heavy atom count, charge, complexity)
  • Optional textual descriptions, paged via descriptionOffset/maxDescriptions (default 3, capped at 20 per page) — fetched only for the first 10 CIDs in the batch, remaining CIDs listed in skippedCids
  • Optional synonyms for every found CID, paged via synonymOffset/maxSynonyms (default 20, capped at 100 per page)
  • Optional drug-likeness assessment (Lipinski Rule of Five + Veber rules), computed from the returned properties at no extra latency
  • Optional pharmacological classification (FDA classes/mechanisms, MeSH classes, ATC codes) — same 10-CID fan-out cap as descriptions; each human ATC code carries its WHO name and levels 1-4 (anatomical group down to chemical subgroup)
  • Per-CID found: false distinguishes a nonexistent CID from a real compound PubChem simply has no data for

pubchem_get_compound_image tool

  • Single CID; size is "small" (100x100) or "large" (300x300, default)
  • Returns base64-encoded PNG plus width/height
  • Typed cid_not_found error when PubChem has no record for the CID

pubchem_get_compound_3d_structure tool

  • Single CID; format="json" (default) returns parsed atoms (element + x/y/z) and bonds, format="sdf" returns the raw V2000 SDF text
  • maxAtoms/maxBonds cap the JSON preview (default 200 each); atomCount/bondCount always report the full totals, with any capping disclosed via enrichment
  • includeRawSdf bypasses the default 500-line cap on the raw SDF text
  • Optional includeAlternateConformerIds lists conformer IDs beyond the default
  • Typed no_3d_structure error when PubChem has no computed 3D coordinates (large molecules, mixtures, some salts)

pubchem_get_compound_xrefs tool

  • Single CID; one or more xrefTypes — string IDs (RegistryID, RN for CAS numbers, PatentID) and numeric IDs (PubMedID, GeneID, ProteinGI, TaxonomyID)
  • Paged per type: maxPerType capped at 500 (default 50), with the same offset applied across every requested type
  • Each type reports its own totalAvailable and truncated flag
  • PubMedID comes highest first, so page one holds the most recently assigned PMIDs; GeneID, ProteinGI, and TaxonomyID come numerically ascending; string IDs keep PubChem's order
  • Empty-result notice distinguishes "this compound has none of the requested types" from a possibly-mistyped CID

pubchem_get_compound_safety tool

  • Batch of up to 25 CIDs per call; any past that are returned in unprocessed, in input order, for a follow-up call
  • Returns GHS signal word, pictograms, hazard statements (H-codes), and precautionary statements (P-codes) merged across sources; the signal word is the most severe any source assigns
  • classifications[] keeps each source's label whole — EU harmonised, the ECHA C&L aggregate, single-company ECHA notifications, NITE-CMC revisions — with its own signal word, pictograms, H-codes carrying ECHA notifier agreement ("37.7%"), and notification counts; source lists only the sources that deposited a classification
  • Per-CID status: ok, not_classified (every deposited classification is an ECHA "Not Classified" verdict — notifiers found no GHS hazard), no_ghs_data (compound exists, no deposited classification), or cid_not_found (no PubChem record at all) — kept distinct so a bad CID never reads as "no hazards on file"
  • Precautionary statements carry a decoded flag — false for codes needing label-specific fill text or outside the decoder table; the code itself is still authoritative

pubchem_get_bioactivity tool

  • Single CID; filter by outcomeFilter (active/inactive/all, default all) and/or targetGeneId/targetAccession
  • A target filter matches every identifier the compound's own assay table ties to it — Gene ID 5742, UniProt P23219 and RefSeq NP_542158 all reach the same COX-1 assays — so the answer doesn't depend on which identifier the caller holds; passing both matches either, and nothing when the table ties them to different targets. Accessions are uppercased before matching (a PDB chain ID is kept as given)
  • An assay that tests several targets keeps each one's outcome and values apart: the record reports the target the filter matched (else the first), and lists the rest under otherTargets
  • Caps at 100 results per page (default 20); offset reaches the rest
  • Reports totalAssays/activeCount/inactiveCount for the whole compound (a multi-target assay counts by its first listed target), plus filteredCount/returnedCount for the current page
  • Notices distinguish "no bioactivity data at all" from "the filter excluded everything" from "offset past the end"

pubchem_get_compound_interactions tool

  • Single CID; one or more kinds — drug-drug (DrugBank), drug-food, target (binding/activity from BindingDB, ChEMBL, and others); default ["drug-drug"]
  • maxEntries per kind per page (capped at 50, default 10); offset counts source records rather than returned entries, capped at 2,147,483,646
  • Each kind pages independently — paging[] reports per-kind totalRecords/nextOffset/truncated; the top-level nextOffset is populated only when exactly one requested kind still has records left
  • A kind that fails to retrieve is named in failedKinds without failing the kinds that succeeded
  • drug-drug and target come from PubChem's SDQ service, which can refuse automated requests; a refusal (an HTML page, a non-SDQ answer) fails the kind instead of reading as zero records, and the notice says a retry will not help. Per-target activity is also available from pubchem_get_bioactivity. drug-food comes from PUG View

pubchem_search_assays tool

  • Search by targetType: genesymbol/proteinname (text), geneid (NCBI Gene ID), proteinaccession (UniProt)
  • Caps at 200 AIDs per page (default 50); offset pages to the total found
  • Rejects a blank targetQuery and a non-numeric geneid query before the upstream call
  • Reports totalFound across all pages and distinguishes "no match" from "offset past the end"

pubchem_get_summary tool

  • entityType: assay (AID), gene (NCBI Gene ID), protein (UniProt accession), or taxonomy (Tax ID); up to 10 identifiers per call
  • A comma-joined string is split into one identifier per piece, trimmed; pieces past the first 10 are returned in unprocessed, in input order, for a follow-up call, and more than 1000 pieces in all fails the call as too_many_identifiers
  • AIDs, Gene IDs, and Tax IDs must be positive integers ("01000" reads as 1000); any other piece gets an invalid: true row and is never sent to PubChem, and the call fails as invalid_identifier only when no piece is usable
  • Per-identifier found flag; populated fields depend on entityType (taxonomy includes an ordered lineage, gene includes symbol/taxonomy, assay includes method, the first 25 targets with targetCount, tested/active compound counts, and lastDataChange)
  • Notice names invalid identifiers and reports how many were not found and which ID type entityType expects; cappedInputs points at unprocessed when the cap was reached

pubchem://compound/{cid} resource

  • Core physicochemical properties (the same default 14-property set as pubchem_get_compound_details), as application/json
  • Throws a typed not-found when the CID doesn't exist in PubChem
  • Use pubchem_get_compound_details to select specific properties or add descriptions, synonyms, drug-likeness, and classification

pubchem://compound/{cid}/safety resource

  • GHS hazard classification as application/json, including the per-source ghs.classifications and the contributor source list
  • status (ok/not_classified/no_ghs_data/cid_not_found) is the only signal distinguishing a bad CID from a compound with no deposited classification — a resource read has no notice surface

pubchem://compound/{cid}/image resource

  • 2D structure diagram, 300x300 PNG, returned as a base64 blob
  • Use pubchem_get_compound_image for the 100x100 size option

pubchem://compound/{cid}/xrefs resource

  • Focused default set — RN (CAS), RegistryID, PubMedID — up to 25 IDs per type, as application/json; the PubMed IDs are the 25 highest (most recently assigned), highest first
  • Use pubchem_get_compound_xrefs for the full set of xref types, a higher per-type cap, and offset paging

pubchem://compound/{cid}/bioactivity resource

  • Up to 25 assays as application/json, plus totalAssays/activeCount for the whole compound; a multi-target assay lists its further targets under otherTargets
  • Use pubchem_get_bioactivity to filter by outcome or target, raise the cap, or page with offset

pubchem://assay/{aid} resource

  • BioAssay summary as application/json — name, description, source, protocol, substance counts
  • Throws a typed not-found when the AID doesn't exist

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

PubChem-specific:

  • Covers PUG REST (search, properties, cross-references, bioactivity), PUG View (textual descriptions, GHS classification, pharmacological classification, drug-food interactions), and SDQ (drug-drug and target interactions) endpoints
  • Rate-limited client (5 req/s) with automatic request queuing, and one retry on 5xx errors, network failures, attempt timeouts, and unreadable response bodies — after 1 s, or after the Retry-After PubChem sends when it is 30 s or less and fits the call's remaining time (a longer one fails at once)
  • One 50 s budget per tool call or resource read covers every PubChem request it makes — queue waits, each attempt's headers and body, and retry backoffs — so a slow or hung upstream fails the call as Timeout before an MCP client's default 60 s request timeout
  • A cancelled tool call or resource read stops its PubChem work — queued requests, in-flight fetches, response bodies still arriving, retry backoffs, and async-search polling — and fails with RequestCancelled
  • Hand-rolled V2000 SDF parser for 3D conformer atoms and bonds; drug-likeness (Lipinski/Veber) computed from already-fetched properties, adding no extra latency
  • All tools are read-only and idempotent — no API keys required, PubChem's API is freely accessible

Agent-friendly output:

  • Discriminated output contracts — per-CID status (ok / not_classified / no_ghs_data / cid_not_found) and found flags let callers branch on data instead of matching an error string
  • Graceful partial failure — batch tools return per-item results alongside unresolvedIdentifiers, skippedCids, and failedKinds rather than failing the whole call
  • Response shaping — truncation disclosure (truncated, shown/cap, nextOffset) on every capped list; an ID batch or page size past its per-call cap is served up to the cap instead of rejected, with the clamp reported in cappedInputs and any unserved IDs in unprocessed; plus a totalFoundAtLeast floor in place of a count when an upstream search saturates
  • Typed error reasons — validation and not-found failures declare a reason (e.g. cid_not_found, missing_identifier_args, invalid_cid_query) with actionable recovery text, not generic messages

Getting started

Public Hosted Instance

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

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

Self-Hosted / Local

Add the following to your MCP client configuration file.

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

Or with npx (no Bun required):

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

Or with Docker:

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

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

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

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • No API keys required — PubChem's API is freely accessible.

Installation

  1. Clone the repository:
git clone https://github.com/cyanheads/pubchem-mcp-server.git
  1. Navigate into the directory:
cd pubchem-mcp-server
  1. Install dependencies:
bun install
  1. Configure environment (optional):
cp .env.example .env
# edit .env to override transport, session mode, storage, or logging defaults

Configuration

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for HTTP server.3010
MCP_HTTP_HOSTHost for HTTP server.127.0.0.1
MCP_SESSION_MODEstateless, stateful, or auto. PubChem needs no multi-round-trip input, so the server declares stateless; the example and Docker set it to match.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
STORAGE_PROVIDER_TYPEStorage backend.in-memory
OTEL_ENABLEDEnable OpenTelemetry.false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

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

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

Docker

docker build -t pubchem-mcp-server .
docker run --rm -p 3010:3010 pubchem-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/pubchem-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 PubChem client.
src/mcp-server/tools/definitions/Tool definitions (*.tool.ts).
src/mcp-server/resources/definitions/Resource definitions (*.resource.ts).
src/services/pubchem/PubChem API client — rate limiting, retry, and response/SDF parsing.
scripts/Build, clean, devcheck, and tree generation scripts.
tests/Unit and integration tests.

Development guide

See CLAUDE.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
  • Wrap external API calls: validate the raw PubChem response → normalize to a domain type → return the output schema; never fabricate missing fields
  • Register new tools and resources in the index.ts barrel files

Contributing

Issues are welcome. Run checks before submitting:

bun run devcheck
bun run test

License

Apache-2.0 — see LICENSE for details.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Lid closed, agents working
Lid closed, agents working
Keeps your Mac awake while Claude Code, Codex or Cursor works. Lets it sleep when they are done.
Try free for 7 days →
Block distraction from your iPhone for freeBlock distraction from your iPhone for free
Block distraction from your iPhone for free
Block distracting apps from your iPhone permanently without a 3rd party app. Free and open source.
Block now (100% free) →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →

Configuration

MCP_LOG_LEVELdefault: info

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

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

Categories
Search & Web CrawlingData & Analytics
Registryactive
Package@cyanheads/pubchem-mcp-server
TransportSTDIO, HTTP
Tools verifiedJun 10, 2026
UpdatedJun 2, 2026
View on GitHub

More from cyanheads

  • Cdc Health Mcp Server3
  • Met Museum Mcp Server3
  • Mcp Ts Core145
  • Courtlistener Mcp Server2
  • Open Meteo Mcp Server2
  • Treasury Fiscaldata Mcp Server2
  • Usaspending Mcp Server2
  • Worldbank Mcp Server2
  • Bls Labor Mcp Server1
  • Cpsc Recalls Mcp Server1
  • Devops Status Mcp Server1
  • Earthquake Mcp Server1
  • Eia Energy Mcp Server1
  • Eurostat Mcp Server1
  • Fcc Broadband Mcp Server1
  • Gdelt Mcp Server1
  • Onebusaway Mcp Server1
  • Openfda Mcp Server1
  • Openfec Mcp Server1
  • Openfoodfacts Mcp Server1
  • Openlibrary Mcp Server1
  • Openstates Mcp Server1
  • Orcid Mcp Server1
  • Reliefweb Mcp Server1

Related Search & Web Crawling MCP Servers

View all →
aicayzer avatar
Companies House

io.github.aicayzer/companies-house

MCP server and CLI for the UK Companies House API. Search, filings, officers, due diligence.
9
embassy-of-the-free-mind avatar
Source Library

io.github.embassy-of-the-free-mind/source-library

Search 22,000+ rare pre-modern texts with AI English translations, summaries, and 73K+ images.
9
embassy-of-the-free-mind avatar
Source Library

io.github.embassy-of-the-free-mind/sourcelibrary

Search 15K rare pre-modern texts translated to English: philosophy, religion, science, literature.
9
lvpiggyqq avatar
Xcatcher

io.github.lvpiggyqq/xcatcher

High-throughput X/Twitter crawl via tasks; download XLSX; x402 USDC Base/Solana top-ups.
9
papersflow-ai avatar
PapersFlow

io.github.papersflow-ai/papersflow

Academic research MCP server for paper search, citation checks, graphs, and deep research.
9
seatable avatar
Seatable

io.github.seatable/seatable

MCP server for SeaTable — read, write, search, link, and query data in your bases
9