pubchem-mcp-server
Öffentlich gehosteter Server: https://pubchem.caseyjhand.com/mcp
Tools
Acht Tools zur Abfrage der chemischen Informationsdatenbank von PubChem:
Tool-Name | Beschreibung |
| Suche nach Verbindungen anhand von Name, SMILES, InChIKey, Formel, Substruktur, Superstruktur oder 2D-Ähnlichkeit. |
| Abrufen von physikochemischen Eigenschaften, Beschreibungen, Synonymen, Arzneimittelähnlichkeit und Klassifizierung für Verbindungen per CID. |
| Abrufen eines 2D-Strukturdiagramms (PNG) für eine Verbindung per CID. |
| Abrufen der GHS-Gefahreneinstufung und Sicherheitsdaten für eine Verbindung. |
| Abrufen von Querverweisen zu externen Datenbanken (PubMed, Patente, Gene, Proteine usw.). |
| Abrufen des Bioaktivitätsprofils einer Verbindung: Assay-Ergebnisse, Ziele und Aktivitätswerte. |
| Finden von Bioassays nach biologischem Ziel (Gensymbol, Protein, Gen-ID, UniProt-Zugangsnummer). |
| Abrufen von Zusammenfassungen für PubChem-Entitäten: Assays, Gene, Proteine, Taxonomie. |
pubchem_search_compounds
Durchsuchen Sie PubChem nach chemischen Verbindungen über fünf Suchmodi.
Identifikator-Suche — Auflösung von Verbindungsnamen, SMILES oder InChIKeys in CIDs (Batch bis zu 25)
Formelsuche — Finden von Verbindungen anhand der Summenformel in Hill-Notation
Substruktur/Superstruktur — Finden von Verbindungen, die eine Suchstruktur enthalten oder in ihr enthalten sind
2D-Ähnlichkeit — Finden strukturell ähnlicher Verbindungen mittels Tanimoto-Ähnlichkeit (konfigurierbarer Schwellenwert)
Optionale Anreicherung der Ergebnisse mit Eigenschaften, um einen zusätzlichen Detailabruf zu vermeiden
pubchem_get_compound_details
Abrufen detaillierter Verbindungsinformationen per CID.
Batch-Verarbeitung von bis zu 100 CIDs in einer einzigen Anfrage
27 verfügbare Eigenschaften: Molekulargewicht, SMILES, InChIKey, XLogP, TPSA, Komplexität, Stereozahlen und mehr
Optional inklusive Textbeschreibungen (Pharmakologie, Mechanismus, therapeutische Verwendung) aus PUG View
Optional inklusive aller bekannten Synonyme (Handelsnamen, systematische Namen, Registriernummern)
Optionale Berechnung der Arzneimittelähnlichkeit (Lipinski-Regel der Fünf + Veber-Regeln) aus den abgerufenen Eigenschaften
Optionales Abrufen der pharmakologischen Klassifizierung (FDA-Klassen, Wirkmechanismen, MeSH-Klassen, ATC-Codes)
pubchem_get_bioactivity
Abrufen des Bioaktivitätsprofils einer Verbindung aus PubChem BioAssay.
Gibt Assay-Ergebnisse (Aktiv/Inaktiv/Nicht schlüssig), Zielinformationen (Protein-Zugangsnummern, NCBI-Gen-IDs) und quantitative Werte (IC50, EC50, Ki) zurück
Filterung nach Ergebnis, um sich auf aktive Ergebnisse zu konzentrieren
Begrenzt auf 100 Ergebnisse pro Anfrage (gut untersuchte Verbindungen können Tausende haben)
pubchem_get_summary
Abrufen beschreibender Zusammenfassungen für vier PubChem-Entitätstypen.
Assays (AID), Gene (Gen-ID), Proteine (UniProt-Zugangsnummer), Taxonomie (Tax-ID)
Bis zu 10 Entitäten pro Aufruf
Typspezifische Extraktion von Feldern für eine saubere, strukturierte Ausgabe
Related MCP server: PubChem MCP Server
Funktionen
Aufgebaut auf @cyanheads/mcp-ts-core:
Deklarative Tool-Definitionen — eine Datei pro Tool, das Framework übernimmt Registrierung und Validierung
Einheitliche Fehlerbehandlung über alle Tools hinweg
Steckbare Authentifizierung (
none,jwt,oauth)Austauschbare Speicher-Backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Strukturiertes Logging mit optionalem OpenTelemetry-Tracing
Läuft lokal (stdio/HTTP) oder containerisiert via Docker
PubChem-spezifisch:
Ratenbegrenzter Client für PUG REST und PUG View APIs (5 Anfragen/s mit automatischer Warteschlange)
Wiederholungsversuche mit exponentiellem Backoff bei 5xx-Fehlern und Netzwerkfehlern
Alle Tools sind schreibgeschützt und idempotent — keine API-Schlüssel erforderlich
Erste Schritte
Öffentlich gehostete Instanz
Eine öffentliche Instanz ist unter https://pubchem.caseyjhand.com/mcp verfügbar — keine Installation erforderlich. Verweisen Sie jeden MCP-Client über Streamable HTTP darauf:
{
"mcpServers": {
"pubchem": {
"type": "streamable-http",
"url": "https://pubchem.caseyjhand.com/mcp"
}
}
}Selbst gehostet / Lokal
Fügen Sie dies Ihrer MCP-Client-Konfiguration hinzu (z. B. claude_desktop_config.json):
{
"mcpServers": {
"pubchem": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/pubchem-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio"
}
}
}
}Voraussetzungen
Bun v1.2.0 oder höher (oder Node.js v22+)
Installation
Repository klonen:
git clone https://github.com/cyanheads/pubchem-mcp-server.gitIn das Verzeichnis navigieren:
cd pubchem-mcp-serverAbhängigkeiten installieren:
bun installKonfiguration
Es sind keine API-Schlüssel erforderlich — die API von PubChem ist frei zugänglich.
Variable | Beschreibung | Standard |
| Transport: |
|
| Port für den HTTP-Server. |
|
| Host für den HTTP-Server. |
|
| Auth-Modus: |
|
| Log-Level (RFC 5424). |
|
| Speicher-Backend. |
|
| OpenTelemetry aktivieren. |
|
Ausführen des Servers
Lokale Entwicklung
Bauen und ausführen:
bun run rebuild bun run start:stdio # or start:httpPrüfungen und Tests ausführen:
bun run devcheck # Lints, formats, type-checks bun run test # Runs test suite
Docker
docker build -t pubchem-mcp-server .
docker run -p 3010:3010 pubchem-mcp-serverProjektstruktur
Verzeichnis | Zweck |
| Tool-Definitionen ( |
| PubChem API-Client mit Ratenbegrenzung und Antwort-Parsing. |
| Skripte für Build, Clean, Devcheck und Baumgenerierung. |
Entwicklungsleitfaden
Siehe CLAUDE.md für Entwicklungsrichtlinien und architektonische Regeln. Die Kurzfassung:
Handler werfen Fehler, das Framework fängt sie ab — kein
try/catchin der Tool-LogikVerwenden Sie
ctx.logfür domänenspezifisches LoggingRegistrieren Sie neue Tools in der
index.tsBarrel-Datei
Mitwirken
Probleme und Pull Requests sind willkommen. Führen Sie vor dem Einreichen die Prüfungen aus:
bun run devcheck
bun run testLizenz
Apache-2.0 — siehe LICENSE für Details.
Available Tools
10 toolspubchem_get_bioactivityGet BioactivityARead-onlyIdempotentInspect
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?".
Inputs: cid (required), sort, offset, assayType, +5 more. Returns: cap, cid, sort, error, +16 more
pubchem_get_compound_3d_structureGet Compound 3D StructureARead-onlyIdempotentInspect
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).
Inputs: cid (required), format, maxAtoms, maxBonds, +3 more. Returns: cid, sdf, atoms, bonds, +12 more
pubchem_get_compound_detailsGet Compound DetailsARead-onlyIdempotentInspect
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.
Inputs: cids (required), properties, maxSynonyms, synonymOffset, +6 more. Returns: error, notice, compounds, truncated, +8 more
pubchem_get_compound_imageGet Compound ImageARead-onlyIdempotentInspect
Fetch a 2D structure diagram (PNG image) for a compound by CID.
Inputs: cid (required), size. Returns: cid, error, width, height, +2 more
pubchem_get_compound_interactionsGet Compound InteractionsARead-onlyIdempotentInspect
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.
Inputs: cid (required), kinds, offset, maxEntries. Returns: cid, error, notice, offset, +8 more
pubchem_get_compound_safetyGet Compound SafetyARead-onlyIdempotentInspect
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.
Inputs: cids (required). Returns: error, notice, results, unprocessed, +3 more
pubchem_get_compound_xrefsGet Compound Cross-ReferencesARead-onlyIdempotentInspect
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.
Inputs: cid (required), xrefTypes (required), offset, maxPerType. Returns: cid, error, xrefs, notice, +5 more
pubchem_get_summaryGet Entity SummaryARead-onlyIdempotentInspect
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.
Inputs: entityType (required), identifiers (required). Returns: error, notice, summaries, entityType, +4 more
pubchem_search_assaysSearch AssaysARead-onlyIdempotentInspect
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.
Inputs: targetType (required), targetQuery (required), offset, maxResults. Returns: cap, aids, error, shown, +8 more
pubchem_search_compoundsSearch CompoundsARead-onlyIdempotentInspect
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.
Inputs: searchType (required), aid, query, offset, +12 more. Returns: cap, error, shown, notice, +11 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
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.
Maintenance
Related MCP Connectors
Link compounds to protein targets, rank bioactivity, and look up drug mechanisms and indications.
FTIR spectral search and material identification for AI agents via MCP.
Connect AI clients to biomedical data and tools.
Web knowledge fetching tools for your agent.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables comprehensive access to PubChem's chemical database with over 110 million compounds. Supports chemical searches, structure analysis, bioactivity data, safety information, and molecular property calculations through 30 specialized tools.30MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and retrieve chemical compound information, structures, and physical properties from the PubChem database. It supports querying via compound names, SMILES notation, or CIDs to provide detailed molecular data for chemical analysis.5-
- FlicenseBqualityDmaintenanceExtracts basic chemical information and drug data from the PubChem API. It enables users to retrieve molecular details such as SMILES, IUPAC names, molecular formulas, and synonyms for specific compounds.311-
- AlicenseNot gradedqualityCmaintenanceProvides access to the NIH PubChem chemistry compound database, enabling queries for compound synonyms and other data through natural language.76 npmMIT