PubChem
🧪 Enable AI assistants to search and access chemical compound information through a simple MCP interface.
claude mcp add --transport stdio jackkuo666-pubchem-mcp-server python -m pubchem-mcp-server
How to use
The PubChem MCP Server provides a bridge between AI assistants and PubChem's chemical database using the Model Context Protocol (MCP). It exposes a set of tools that let you search for chemical compounds by name or SMILES, fetch detailed information by PubChem CID, and perform advanced queries that combine multiple parameters. Core tools include: search_pubchem_by_name (name-based searches with optional max_results), search_pubchem_by_smiles (SMILES-based searches with optional max_results), get_pubchem_compound_by_cid (retrieve full details for a specific CID), and search_pubchem_advanced (multi-parameter searches such as name, SMILES, formula, and CID with a max_results cap). You can invoke these tools from your AI assistant or application using the MCP interface, for example by calling use_tool with the appropriate tool name and parameters to obtain structured compound data, properties, and identifiers like SMILES or InChI. The server also supports deeper data access such as molecular structures, properties, and related metadata, enabling responses to be enriched with chemical details and comparisons across compounds.
To get started, run the MCP server (as shown in the examples) and then use the provided tool names within your prompts or integration code. For instance, you can search for aspirin by name, fetch details for a compound by CID, or run an advanced search with a combination of name, SMILES, or formula to narrow results. The server is designed to work with Claude Desktop and other MCP-enabled clients, so you can drop it into your existing MCP workflow and begin querying PubChem data through a consistent interface.
How to install
Prerequisites:
- Python 3.10+ installed on your system
- Internet access to fetch PubChem data via the PubChemPy library
Option A: Manual installation (recommended for development)
-
Clone the repository: git clone https://github.com/JackKuo666/PubChem-MCP-Server.git cd PubChem-MCP-Server
-
(Optional) Create and activate a virtual environment: python -m venv .venv source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows
-
Install dependencies: pip install -r requirements.txt pip install mcp pubchempy pandas
-
Run the server: python pubchem_server.py
Option B: Install via uv (Smithery ecosystem) for local development
-
Install the MCP server via uv: uv tool install pubchem-mcp-server
-
Activate the environment as needed and start using the server according to your MCP client configuration.
Note: If you plan to use the PubChem MCP Server with Claude Desktop, you can also configure the mcpServers entry in claude_desktop_config.json as shown in the README (Python -m approach) and then run the module.
Additional notes
Tips and considerations:
- The server relies on PubChem through the pubchempy library; ensure network access and, if behind a proxy, configure network settings accordingly.
- Python 3.10+ is required; some environments may require upgrading pip or installing build tools for dependencies.
- The MCP tools names are: search_pubchem_by_name, search_pubchem_by_smiles, get_pubchem_compound_by_cid, search_pubchem_advanced. Each tool accepts parameters as described in the README; adjust max_results to limit payload size.
- For CLI/SDK integrations (e.g., Claude Desktop), you can run the server with python -m pubchem-mcp-server and connect via MCP in your client configuration. If you’re developing, you can reference pubchem_server.py and pubchempy for extending functionality or adding new endpoints.
- If you encounter rate limits or API changes from PubChem, consider caching results locally using the server’s Local Storage capabilities (as described in the feature list) to improve latency and reduce repeated queries.
- Ensure proper handling of sensitive data and comply with PubChem’s data usage policies when integrating into a broader assistant workflow.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP