PubChem MCP server

Integrates with PubChem chemical database to provide compound search, structure analysis, property calculation, bioassay data, safety information, and cross-references for drug discovery, chemical research, and regulatory compliance workflows.
Back to servers
Provider
Augmented Nature
Release date
May 30, 2025
Stats
7 stars

The Unofficial PubChem MCP Server provides access to the PubChem chemical database through the Model Context Protocol (MCP). It offers tools for searching and retrieving data on over 110 million chemical compounds, including molecular properties, bioassay data, and chemical informatics capabilities.

Installation

To set up the PubChem MCP Server:

# Clone or create the server directory
cd pubchem-server

# Install dependencies
npm install

# Build the server
npm run build

# Run the server
npm start

Available Tools

Chemical Search & Retrieval

  • 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

  • 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

  • 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

  • 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

  • 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

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

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

Usage Examples

Basic Compound Search

// 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 can be integrated 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

When using the server, observe these PubChem API guidelines:

  • 5 requests per second
  • 400 requests per minute maximum
  • No API key required
  • Respectful usage encouraged

Example Workflows

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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later