MCP.so
Sign In
Servers

PubChem MCP Server

@PhelanShao

Enables large language models to correctly query molecular databases and generate structure files

Overview

What is PubChem MCP Server?

PubChem MCP Server is a Python implementation of a Model Context Protocol (MCP) server that allows AI models to query chemical compound information from the PubChem database. It provides easy access to compound properties, 2D structures, and 3D molecular coordinates through a standard MCP interface.

How to use PubChem MCP Server?

Install from source with pip install -e . (optionally pip install -e ".[rdkit]" for enhanced 3D handling). Configure the server in your MCP settings file by providing the path to mcp_server.py and listing the tools get_pubchem_data and download_structure under autoApprove. Then invoke the tools by passing a compound name or PubChem CID as the query parameter.

Key features of PubChem MCP Server

  • Query compounds by name or PubChem CID
  • Retrieve IUPAC name, molecular formula, weight, SMILES, InChI, InChIKey
  • Output in JSON (default), CSV, or XYZ (3D) format
  • Built-in in-memory caching for API responses
  • Automatic retry mechanism for API reliability
  • Fallback 3D structure generation if PubChem 3D unavailable

Use cases of PubChem MCP Server

  • Query chemical compound properties directly from an AI assistant
  • Retrieve standard identifiers (SMILES, InChI, InChIKey) for cheminformatics workflows
  • Download structure files (SDF, MOL, SMI) for a given PubChem CID
  • Obtain 3D molecular coordinates for visualization or modeling
  • Integrate chemical data lookup into automated research pipelines

FAQ from PubChem MCP Server

What are the runtime requirements?

Python 3.8+ and the Requests library are required. RDKit is optional but recommended for enhanced 3D structure handling.

What output formats are supported?

The get_pubchem_data tool supports JSON, CSV, and XYZ (3D) output. The download_structure tool supports SDF, MOL, and SMI file formats.

How does caching work?

API responses are cached in memory for faster repeat queries. 3D structure data is persisted on disk in ~/.pubchem-mcp/cache/.

How do I configure the server for use with an AI model?

Add an entry to your MCP configuration file with command: "python3", args: ["/path/to/mcp_server.py"], and list get_pubchem_data and download_structure under autoApprove.

What happens if 3D structure data is not available from PubChem?

The server includes a fallback that generates a 3D structure locally when PubChem itself does not provide one.

More from Other