Skip to main content
Glama

Versión Framework SDK MCP Licencia TypeScript Bun

Servidor público alojado: https://pubchem.caseyjhand.com/mcp


Herramientas

Ocho herramientas para consultar la base de datos de información química de PubChem:

Nombre de la herramienta

Descripción

pubchem_search_compounds

Busca compuestos por nombre, SMILES, InChIKey, fórmula, subestructura, superestructura o similitud 2D.

pubchem_get_compound_details

Obtiene propiedades fisicoquímicas, descripciones, sinónimos, similitud con fármacos y clasificación de compuestos por CID.

pubchem_get_compound_image

Obtiene un diagrama de estructura 2D (PNG) para un compuesto por CID.

pubchem_get_compound_safety

Obtiene la clasificación de peligros GHS y datos de seguridad para un compuesto.

pubchem_get_compound_xrefs

Obtiene referencias cruzadas de bases de datos externas (PubMed, patentes, genes, proteínas, etc.).

pubchem_get_bioactivity

Obtiene el perfil de bioactividad de un compuesto: resultados de ensayos, objetivos y valores de actividad.

pubchem_search_assays

Encuentra bioensayos por objetivo biológico (símbolo de gen, proteína, ID de gen, acceso UniProt).

pubchem_get_summary

Obtiene resúmenes para entidades de PubChem: ensayos, genes, proteínas, taxonomía.

pubchem_search_compounds

Busca compuestos químicos en PubChem a través de cinco modos de búsqueda.

  • Búsqueda por identificador — resuelve nombres de compuestos, SMILES o InChIKeys a CIDs (lotes de hasta 25)

  • Búsqueda por fórmula — encuentra compuestos por fórmula molecular en notación de Hill

  • Subestructura/superestructura — encuentra compuestos que contienen o están contenidos dentro de una estructura de consulta

  • Similitud 2D — encuentra compuestos estructuralmente similares mediante la similitud de Tanimoto (umbral configurable)

  • Opcionalmente, hidrata los resultados con propiedades para evitar una llamada de detalles posterior


pubchem_get_compound_details

Obtén información detallada del compuesto por CID.

  • Agrupa hasta 100 CIDs en una sola solicitud

  • 27 propiedades disponibles: peso molecular, SMILES, InChIKey, XLogP, TPSA, complejidad, conteos estéreo y más

  • Opcionalmente incluye descripciones textuales (farmacología, mecanismo, uso terapéutico) de PUG View

  • Opcionalmente incluye todos los sinónimos conocidos (nombres comerciales, nombres sistemáticos, números de registro)

  • Opcionalmente calcula la evaluación de similitud con fármacos (Regla de los cinco de Lipinski + reglas de Veber) a partir de las propiedades obtenidas

  • Opcionalmente obtiene la clasificación farmacológica (clases de la FDA, mecanismos de acción, clases MeSH, códigos ATC)

pubchem_get_bioactivity

Obtén el perfil de bioactividad de un compuesto desde PubChem BioAssay.

  • Devuelve resultados de ensayos (Activo/Inactivo/Inconcluso), información de objetivos (accesos a proteínas, IDs de genes NCBI) y valores cuantitativos (IC50, EC50, Ki)

  • Filtra por resultado para centrarse en resultados activos

  • Límite de 100 resultados por solicitud (los compuestos bien estudiados pueden tener miles)

pubchem_get_summary

Obtén resúmenes descriptivos para cuatro tipos de entidades de PubChem.

  • Ensayos (AID), genes (ID de gen), proteínas (acceso UniProt), taxonomía (ID de taxonomía)

  • Hasta 10 entidades por llamada

  • Extracción de campos específica por tipo para una salida limpia y estructurada

Related MCP server: PubChem MCP Server

Características

Construido sobre @cyanheads/mcp-ts-core:

  • Definiciones de herramientas declarativas — un solo archivo por herramienta, el framework maneja el registro y la validación

  • Manejo de errores unificado en todas las herramientas

  • Autenticación conectable (none, jwt, oauth)

  • Backends de almacenamiento intercambiables: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1

  • Registro estructurado con rastreo opcional de OpenTelemetry

  • Se ejecuta localmente (stdio/HTTP) o contenedorizado mediante Docker

Específico de PubChem:

  • Cliente con límite de tasa para APIs PUG REST y PUG View (5 req/s con cola automática)

  • Reintento con retroceso exponencial en errores 5xx y fallos de red

  • Todas las herramientas son de solo lectura e idempotentes — no se requieren claves de API

Primeros pasos

Instancia pública alojada

Una instancia pública está disponible en https://pubchem.caseyjhand.com/mcp — no requiere instalación. Apunta cualquier cliente MCP a ella mediante HTTP transmitible:

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

Autoalojado / Local

Añádelo a la configuración de tu cliente MCP (ej. claude_desktop_config.json):

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

Requisitos previos

Instalación

  1. Clona el repositorio:

git clone https://github.com/cyanheads/pubchem-mcp-server.git
  1. Navega al directorio:

cd pubchem-mcp-server
  1. Instala las dependencias:

bun install

Configuración

No se requieren claves de API — la API de PubChem es de libre acceso.

Variable

Descripción

Predeterminado

MCP_TRANSPORT_TYPE

Transporte: stdio o http.

stdio

MCP_HTTP_PORT

Puerto para el servidor HTTP.

3010

MCP_HTTP_HOST

Host para el servidor HTTP.

localhost

MCP_AUTH_MODE

Modo de autenticación: none, jwt o oauth.

none

MCP_LOG_LEVEL

Nivel de registro (RFC 5424).

info

STORAGE_PROVIDER_TYPE

Backend de almacenamiento.

in-memory

OTEL_ENABLED

Habilitar OpenTelemetry.

false

Ejecución del servidor

Desarrollo local

  • Compilar y ejecutar:

    bun run rebuild
    bun run start:stdio   # or start:http
  • Ejecutar comprobaciones y pruebas:

    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-server

Estructura del proyecto

Directorio

Propósito

src/mcp-server/tools/definitions/

Definiciones de herramientas (*.tool.ts).

src/services/pubchem/

Cliente de API de PubChem con límite de tasa y análisis de respuesta.

scripts/

Scripts de compilación, limpieza, comprobación de desarrollo y generación de árbol.

Guía de desarrollo

Consulta CLAUDE.md para conocer las directrices de desarrollo y las reglas arquitectónicas. La versión corta:

  • Los manejadores lanzan errores, el framework los captura — no usar try/catch en la lógica de la herramienta

  • Usa ctx.log para el registro específico del dominio

  • Registra nuevas herramientas en el archivo barril index.ts

Contribución

Las incidencias y solicitudes de extracción (pull requests) son bienvenidas. Ejecuta las comprobaciones antes de enviar:

bun run devcheck
bun run test

Licencia

Apache-2.0 — consulta LICENSE para más detalles.

Available Tools

10 tools
pubchem_get_bioactivityGet BioactivityA
Read-onlyIdempotent
Inspect

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 StructureA
Read-onlyIdempotent
Inspect

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 DetailsA
Read-onlyIdempotent
Inspect

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 ImageA
Read-onlyIdempotent
Inspect

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 InteractionsA
Read-onlyIdempotent
Inspect

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 SafetyA
Read-onlyIdempotent
Inspect

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-ReferencesA
Read-onlyIdempotent
Inspect

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 SummaryA
Read-onlyIdempotent
Inspect

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 AssaysA
Read-onlyIdempotent
Inspect

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 CompoundsA
Read-onlyIdempotent
Inspect

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

    A4.1/5.0

    Scored across 10 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      30
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
      -
    • F
      license
      B
      quality
      D
      maintenance
      Extracts 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.
      3
      11
      -