Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PubChem MCP Serverfind the molecular weight and physical properties of caffeine"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PubChem MCP Server
๐งช Enable AI assistants to search and access chemical compound information through a simple MCP interface.
The PubChem MCP Server provides a bridge between AI assistants and PubChem's chemical database through the Model Context Protocol (MCP). It allows AI models to search for chemical compounds and access their detailed information in a programmatic way.
๐ค Contribute โข ๐ Report Bug
โจ Core Features
๐ Compound Search: Query PubChem compounds by name, SMILES, or CID โ
๐งช Chemical Structure: Access molecular structures and identifiers โ
๐ Property Data: Retrieve detailed chemical and physical properties โ
๐ฌ Advanced Search: Combine multiple parameters for precise queries โ
๐งฌ Molecular Visualization: Generate and display molecular structures ๐
๐ Property Analysis: Compare properties across multiple compounds ๐
๐๏ธ Local Storage: Save frequently used compounds for faster access ๐
๐ Chemistry Prompts: Specialized prompts for chemical analysis ๐
๐ Quick Start
Installing via Smithery
To install PubChem Server for Claude Desktop automatically via Smithery:
Claude
Cursor
Paste the following into Settings โ Cursor Settings โ MCP โ Add new server:
Mac/Linux
Windsurf
CLine
Installing Manually
Install using uv:
For development:
๐ Usage
Start the MCP server:
Once the server is running, you can use the provided MCP tools in your AI assistant or application. Here are some examples of how to use the tools:
Example 1: Search for compounds by name
Example 2: Search for compounds by SMILES notation
Example 3: Get detailed information for a specific compound
Example 4: Perform an advanced search with multiple parameters
These examples demonstrate how to use the four main tools provided by the PubChem MCP Server. Adjust the parameters as needed for your specific use case.
๐ MCP Tools
The PubChem MCP Server provides the following tools:
search_pubchem_by_name
Search for chemical compounds on PubChem using a compound name.
Parameters:
name(str): Name of the chemical compoundmax_results(int, optional): Maximum number of results to return (default: 5)
Returns: List of dictionaries containing compound information
search_pubchem_by_smiles
Search for chemical compounds on PubChem using a SMILES string.
Parameters:
smiles(str): SMILES notation of the chemical compoundmax_results(int, optional): Maximum number of results to return (default: 5)
Returns: List of dictionaries containing compound information
get_pubchem_compound_by_cid
Fetch detailed information about a chemical compound using its PubChem CID.
Parameters:
cid(int): PubChem Compound ID (CID)
Returns: Dictionary containing compound information
search_pubchem_advanced
Perform an advanced search for compounds on PubChem.
Parameters:
name(str, optional): Name of the chemical compoundsmiles(str, optional): SMILES notation of the chemical compoundformula(str, optional): Molecular formulacid(int, optional): PubChem Compound IDmax_results(int, optional): Maximum number of results to return (default: 5)
Returns: List of dictionaries containing compound information
Usage with Claude Desktop
Add this configuration to your claude_desktop_config.json:
(Mac OS)
(Windows version):
Using with Cline
After restarting Claude Desktop, the following capabilities will be available:
Searching Compounds
You can ask Claude to search for chemical compounds using queries like:
The search will return basic information about matching compounds including:
โข Compound name
โข CID (PubChem Compound ID)
โข Molecular formula
โข Molecular weight
Getting Compound Details
Once you have a CID, you can ask for more details:
This will return:
โข IUPAC name
โข Molecular formula
โข Molecular weight
โข SMILES notation
โข InChI and InChIKey
โข Physical and chemical properties
โข Synonyms
๐ TODO
visualize_compound
Generate and display a 2D or 3D visualization of a chemical compound.
compare_compounds
Compare properties and structures of multiple compounds.
save_compound
Save a compound locally for faster access.
list_saved_compounds
List all saved compounds.
๐ Chemistry Prompts
The server will offer specialized prompts to help analyze chemical compounds:
Compound Analysis Prompt
A comprehensive workflow for analyzing chemical compounds that only requires a compound ID:
This prompt will include:
Detailed instructions for using available tools
A systematic workflow for compound analysis
Comprehensive analysis structure covering:
Chemical structure and properties
Pharmacological properties
Biological activities
Applications and uses
Safety and toxicity information
Related compounds
๐ Project Structure
pubchem_server.py: The main MCP server implementation using FastMCPpubchem_search.py: Contains example code for searching PubChem
๐ง Dependencies
Python 3.10+
FastMCP
asyncio
logging
pubchempy (for PubChem API access)
pandas (for data handling)
You can install the required dependencies using:
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License.
โ ๏ธ Disclaimer
This tool is for research purposes only. Please respect PubChem's terms of service and use this tool responsibly.