Skip to main content
Glama

PubChem MCP Server Logo

Unofficial PubChem MCP Server

A comprehensive Model Context Protocol (MCP) server for accessing the PubChem chemical database. This server provides access to over 110 million chemical compounds with extensive molecular properties, bioassay data, and chemical informatics tools.

Features

๐Ÿ” Chemical Search & Retrieval (6 tools)

  • search_compounds - Search by name, CAS number, formula, or identifier

  • get_compound_info - Detailed compound information by CID

  • search_by_smiles - Exact SMILES string matching

  • search_by_inchi - InChI/InChI key search

  • search_by_cas_number - CAS Registry Number lookup

  • get_compound_synonyms - All names and synonyms

๐Ÿงฌ Structure Analysis & Similarity (5 tools)

  • search_similar_compounds - Tanimoto similarity search

  • substructure_search - Find compounds containing substructures

  • superstructure_search - Find larger compounds containing query

  • get_3d_conformers - 3D structural information

  • analyze_stereochemistry - Chirality and isomer analysis

โš—๏ธ Chemical Properties & Descriptors (6 tools)

  • get_compound_properties - Molecular weight, logP, TPSA, etc.

  • calculate_descriptors - Comprehensive molecular descriptors

  • predict_admet_properties - ADMET predictions

  • assess_drug_likeness - Lipinski Rule of Five analysis

  • analyze_molecular_complexity - Synthetic accessibility

  • get_pharmacophore_features - Pharmacophore mapping

๐Ÿงช Bioassay & Activity Data (5 tools)

  • search_bioassays - Find biological assays

  • get_assay_info - Detailed assay protocols

  • get_compound_bioactivities - All activity data for compounds

  • search_by_target - Find compounds tested against targets

  • compare_activity_profiles - Cross-compound comparisons

โš ๏ธ Safety & Toxicity (4 tools)

  • get_safety_data - GHS hazard classifications

  • get_toxicity_info - LD50, carcinogenicity data

  • assess_environmental_fate - Biodegradation analysis

  • get_regulatory_info - FDA, EPA regulations

๐Ÿ”— Cross-References & Integration (4 tools)

  • get_external_references - Links to ChEMBL, DrugBank, etc.

  • search_patents - Chemical patent information

  • get_literature_references - PubMed citations

  • batch_compound_lookup - Bulk processing (up to 200 compounds)

Related MCP server: PubChem Chemical Safety MCP Server

Resource Templates

Access PubChem data through URI patterns:

  • pubchem://compound/{cid} - Complete compound data

  • pubchem://structure/{cid} - 2D/3D structure information

  • pubchem://properties/{cid} - Molecular properties

  • pubchem://bioassay/{aid} - Bioassay data

  • pubchem://similarity/{smiles} - Similarity search results

  • pubchem://safety/{cid} - Safety and toxicity data

Installation

# Clone or create the server directory
cd pubchem-server

# Install dependencies
npm install

# Build the server
npm run build

# Run the server
npm start

Usage

// Search for compounds by name
{
  "tool": "search_compounds",
  "arguments": {
    "query": "aspirin",
    "max_records": 10
  }
}

// Get detailed compound information
{
  "tool": "get_compound_info",
  "arguments": {
    "cid": 2244
  }
}

Structure Analysis

// Find similar compounds
{
  "tool": "search_similar_compounds",
  "arguments": {
    "smiles": "CC(=O)OC1=CC=CC=C1C(=O)O",
    "threshold": 85,
    "max_records": 50
  }
}

// Analyze molecular properties
{
  "tool": "get_compound_properties",
  "arguments": {
    "cid": 2244,
    "properties": ["MolecularWeight", "XLogP", "TPSA"]
  }
}

Bioactivity Analysis

// Get bioassay information
{
  "tool": "get_assay_info",
  "arguments": {
    "aid": 1159607
  }
}

// Search compounds by target
{
  "tool": "search_by_target",
  "arguments": {
    "target": "cyclooxygenase",
    "max_records": 100
  }
}

Safety Information

// Get safety classifications
{
  "tool": "get_safety_data",
  "arguments": {
    "cid": 2244
  }
}

Batch Processing

// Process multiple compounds
{
  "tool": "batch_compound_lookup",
  "arguments": {
    "cids": [2244, 5090, 3672],
    "operation": "property"
  }
}

Integration with Other MCP Servers

This PubChem server integrates perfectly with other chemical/biological databases:

Complete Chemical Informatics Pipeline

1. Target Discovery: UniProt โ†’ STRING โ†’ AlphaFold
2. Chemical Discovery: PubChem โ† โ†’ ChEMBL
3. Complete Workflow: Protein โ†’ Structure โ†’ Interactions โ†’ Small Molecules โ†’ Bioactivity

Cross-Database Workflows

  • UniProt โ†’ PubChem: Find protein targets โ†’ Find small molecule ligands

  • PubChem โ†’ ChEMBL: Discover compounds โ†’ Analyze bioactivity data

  • STRING โ†’ PubChem: Protein interactions โ†’ Chemical modulators

API Rate Limits

PubChem API guidelines:

  • 5 requests per second

  • 400 requests per minute maximum

  • No API key required

  • Respectful usage encouraged

Data Sources

  • 110+ million compounds with full chemical data

  • 1.5+ million bioassays with biological activity

  • Chemical properties and computed descriptors

  • 3D conformers and structural data

  • Safety classifications and toxicity information

  • Cross-references to 500+ external databases

Error Handling

The server includes comprehensive error handling:

  • Invalid compound IDs return clear error messages

  • API timeouts are handled gracefully

  • Rate limiting compliance built-in

  • TypeScript validation for all inputs

Contributing

This server uses:

  • TypeScript for type safety

  • Axios for HTTP requests

  • MCP SDK for protocol compliance

  • PubChem REST API for data access

License

MIT License - See LICENSE file for details.

Support

For issues with:

  • Server functionality: Check error messages and API responses

  • PubChem API: Refer to official PubChem documentation

  • Chemical data: Validate compound identifiers and search terms

Examples

Drug Discovery Workflow

// 1. Search for anti-inflammatory compounds
{
  "tool": "search_compounds",
  "arguments": {
    "query": "anti-inflammatory",
    "max_records": 100
  }
}

// 2. Analyze drug-likeness
{
  "tool": "assess_drug_likeness",
  "arguments": {
    "cid": 2244
  }
}

// 3. Check safety profile
{
  "tool": "get_safety_data",
  "arguments": {
    "cid": 2244
  }
}

// 4. Find bioactivity data
{
  "tool": "search_by_target",
  "arguments": {
    "target": "COX-2",
    "activity_type": "IC50"
  }
}

Chemical Similarity Analysis

// 1. Find similar compounds
{
  "tool": "search_similar_compounds",
  "arguments": {
    "smiles": "your_query_smiles",
    "threshold": 90
  }
}

// 2. Compare molecular properties
{
  "tool": "batch_compound_lookup",
  "arguments": {
    "cids": [1234, 5678, 9012],
    "operation": "property"
  }
}

// 3. Analyze structural features
{
  "tool": "analyze_stereochemistry",
  "arguments": {
    "cid": 1234
  }
}

Architecture

The server is built with a modular architecture:

  • Type-safe validation for all API inputs

  • Comprehensive error handling with clear messages

  • Efficient batch processing for multiple compounds

  • Resource templates for direct data access

  • Integration-ready for multi-database workflows

This makes it the most comprehensive chemical informatics MCP server available!

Citation

If you use this project in your research or publications, please cite it as follows:

author = {Moudather Chelbi},
title = {PubChem MCP Server},
year = {2025},
howpublished = {https://github.com/Augmented-Nature/PubChem-MCP-Server},
note = {Accessed: 2025-06-29}

Available Tools

30 tools
analyze_molecular_complexityC

Analyze molecular complexity and synthetic accessibility

Inputs: cid (required).

analyze_stereochemistryC

Analyze stereochemistry, chirality, and isomer information

Inputs: cid (required).

assess_drug_likenessC

Assess drug-likeness using Lipinski Rule of Five, Veber rules, and PAINS filters

Inputs: cid, smiles.

assess_environmental_fateC

Assess environmental fate including biodegradation and bioaccumulation

Inputs: cid (required).

batch_compound_lookupC

Process multiple compound IDs efficiently

Inputs: cids (required), operation.

calculate_descriptorsC

Calculate comprehensive molecular descriptors and fingerprints

Inputs: cid (required), descriptor_type.

compare_activity_profilesC

Compare bioactivity profiles across multiple compounds

Inputs: cids (required), activity_type.

get_3d_conformersC

Get 3D conformer data and structural information

Inputs: cid (required), conformer_type.

get_assay_infoC

Get detailed information for a specific bioassay by AID

Inputs: aid (required).

get_compound_bioactivitiesC

Get all bioassay results and activities for a compound

Inputs: cid (required), activity_outcome.

get_compound_infoC

Get detailed information for a specific compound by PubChem CID

Inputs: cid (required), format.

get_compound_propertiesC

Get molecular properties (MW, logP, TPSA, etc.)

Inputs: cid (required), properties.

get_compound_synonymsB

Get all names and synonyms for a compound

Inputs: cid (required).

get_external_referencesC

Get links to external databases (ChEMBL, DrugBank, KEGG, etc.)

Inputs: cid (required).

get_literature_referencesC

Get PubMed citations and scientific literature references

Inputs: cid (required).

get_pharmacophore_featuresC

Get pharmacophore features and binding site information

Inputs: cid (required).

get_regulatory_infoC

Get regulatory information from FDA, EPA, and international agencies

Inputs: cid (required).

get_safety_dataC

Get GHS hazard classifications and safety information

Inputs: cid (required).

get_toxicity_infoB

Get toxicity data including LD50, carcinogenicity, and mutagenicity

Inputs: cid (required).

predict_admet_propertiesC

Predict ADMET properties (Absorption, Distribution, Metabolism, Excretion, Toxicity)

Inputs: cid, smiles.

search_bioassaysC

Search for biological assays by target, description, or source

Inputs: query, target, source, max_records.

search_by_cas_numberC

Search for compounds by CAS Registry Number

Inputs: cas_number (required).

search_by_inchiB

Search for compounds by InChI or InChI key

Inputs: inchi (required).

search_by_smilesC

Search for compounds by SMILES string (exact match)

Inputs: smiles (required).

search_by_targetC

Find compounds tested against a specific biological target

Inputs: target (required), activity_type, max_records.

search_compoundsC

Search PubChem database for compounds by name, CAS number, formula, or identifier

Inputs: query (required), search_type, max_records.

search_patentsC

Search for chemical patents and intellectual property information

Inputs: cid, query.

search_similar_compoundsC

Find chemically similar compounds using Tanimoto similarity

Inputs: smiles (required), threshold, max_records.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    B3.2/5.0

    Scored across 30 tools

    Disambiguation4/5

    Most tools have distinct purposes with clear boundaries, such as 'get_compound_info' for general data versus 'get_compound_properties' for molecular metrics. However, some overlap exists, like 'search_by_smiles' and 'substructure_search' both involving SMILES queries, which could cause minor confusion without careful reading of descriptions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as 'analyze_molecular_complexity', 'calculate_descriptors', and 'search_compounds'. This uniformity makes the set predictable and easy to navigate, with no deviations in style or structure.

    Tool Count3/5

    With 30 tools, the count is borderline high for a PubChem server, as it might overwhelm agents with many specialized functions. While it covers extensive chemical data needs, a more focused set of 15-25 tools could improve usability without sacrificing core functionality.

    Completeness5/5

    The tool set provides comprehensive coverage for chemical data retrieval and analysis, including search, retrieval, analysis, and prediction tools. It supports full CRUD-like workflows for compounds, assays, and properties, with no obvious gaps that would hinder agent operations in this domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables users to retrieve chemical safety information including compound properties, GHS safety classifications, and toxicity data from PubChem database using compound names or CIDs. Supports batch queries with caching for efficient chemical safety research and analysis.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents and applications to search, retrieve, and analyze chemical compounds, substances, and bioassays from PubChem's vast chemical information database through comprehensive tools for chemical research and discovery.
      10
      397 npm
      13
      Apache 2.0
    • 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
      -