Skip to main content
Glama
sssjiang

PubChem MCP Server

by sssjiang
README.md
# pubchem mcp server

the mcp is used to extract the drug basic chemical infomation from pubchem API.

## Requirements

- Python 3.10
- `python-dotenv`
- `requests`
- `mcp`
- `uvicorn`

## Installation

**Install the dependencies(local):**

- Install directly from the project directory

```bash
git clone [project repository URL]
cd [project directory]
pip install .
```

**Configure servers(pypi):**

The `servers_config.json` follows the same structure as Claude Desktop, allowing for easy integration of multiple servers.
Here's an example:

```json
{
  "mcpServers": {
    "pubchem": {
      "command": "uvx",
      "args": ["pubchem_mcp_server"]
    }
  }
}
```

## the result of this MCP

```json
{
  "Drug Name": "Aspirin",
  "CAS Number": "50-78-2",
  "Molecular Weight": 180.16,
  "Molecular Formula": "C9H8O4",
  "SMILES": "CC(=O)OC1=CC=CC=C1C(=O)O",
  "Synonyms": [
    "2-(Acetyloxy)benzoic Acid",
    "Acetylsalicylic Acid",
    "Acetysal",
    "Acylpyrin",
    "Aloxiprimum",
    "Aspirin",
    "Colfarit",
    "Dispril",
    "Easprin"
  ],
  "InchI Key": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
  "IUPAC Name": "2-acetyloxybenzoic acid",
  "ATC Code": "N02BA01",
  "Details Link": "https://pubchem.ncbi.nlm.nih.gov/compound/2244"
}
```

TDQS

B3/5.0

Scored across 3 tools

Disambiguation4/5

Tools have distinct purposes: get_chemical_info returns details by name, get_cid_by_name returns CID by name, and search_chemical_by_cas searches by CAS number. However, slight overlap exists between the first two since both accept a name parameter, but the outputs differ, so an agent can distinguish them with careful reading.

Naming Consistency4/5

All tools use snake_case and follow a verb_noun or verb_noun_by_param pattern (get_chemical_info, get_cid_by_name, search_chemical_by_cas). The verbs are mostly 'get' except one 'search', which is a minor inconsistency, but overall the pattern is clear and predictable.

Tool Count3/5

With only 3 tools, the server feels under-scoped for a domain like PubChem, which typically requires many lookup and search capabilities. The count is borderline but still within a reasonable minimum, though it likely limits usefulness.

Completeness2/5

The tool surface covers only name and CAS lookups, missing many common operations like searching by formula, structure, or synonyms, and does not support listing or multiple results. This leaves significant gaps for a comprehensive chemical information server.

Maintenance

ActivityInactive
ResponsivenessUnresponsive