Science
Data source: PubChem (NCBI)
MCP Protocol
Endpoint
https://context.gnist.ai/mcp/pubchem/
claude_desktop_config.json
{
"mcpServers": {
"gnist-pubchem": {
"url": "https://context.gnist.ai/mcp/pubchem/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Shell
curl -X POST "https://context.gnist.ai/mcp/pubchem/" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_compound", "arguments": {"identifier": "example"}}}'
REST API
API Root
https://context.gnist.ai/rest/pubchem/
5 endpoints available:
GET /rest/pubchem/get_compoundGET /rest/pubchem/search_compoundsGET /rest/pubchem/get_compound_propertiesGET /rest/pubchem/find_similar_compoundsGET /rest/pubchem/report_feedback
Shell
curl "https://context.gnist.ai/rest/pubchem/get_compound?identifier=example" \ -H "Gnist-API-Key: YOUR_API_KEY"
Python
import httpx
resp = httpx.get(
"https://context.gnist.ai/rest/pubchem/get_compound",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
params={
"identifier": "example"
},
)
print(resp.json())
Command Line
Command
gc pubchem
CLI documentation will be available when the GnistAI SDK is published.
Install
pip install gnistai
Available Tools (5)
get_compoundLook up a chemical compound by name, CID, InChIKey, or SMILES.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | required | The compound identifier. Examples: - By name: "aspirin", "caffeine", "glucose" - By CID: "2244" (aspirin's PubChem CID) - By InChIKey: "BSYNRYMUTXBXSQ-UHFFFAOYSA-N" - By SMILES: "CC(=O)O... |
namespace | string | optional | How to interpret the identifier. One of: "name" (default), "cid", "inchikey", "smiles". (default: "name") |
search_compoundsSearch PubChem for chemical compounds by name or keyword.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Chemical name or keyword (e.g., "aspirin", "beta-lactam", "serotonin"). |
max_results | integer | optional | Number of results to return (1–50, default 10). (default: 10) |
get_compound_propertiesFetch physicochemical properties for a PubChem compound by CID.
| Parameter | Type | Required | Description |
|---|---|---|---|
cid | integer | required | PubChem Compound ID (e.g., 2244 for aspirin). Found in search_compounds results. |
properties | any | optional | Optional list of specific property names to fetch. If omitted, returns all standard properties. Available properties include: MolecularFormula, MolecularWeight, CanonicalSMILES, IsomericSMILES, InC... |
find_similar_compoundsFind structurally similar compounds using 2D Tanimoto similarity.
| Parameter | Type | Required | Description |
|---|---|---|---|
cid | integer | required | PubChem Compound ID to use as the query structure. |
threshold | integer | optional | Tanimoto similarity threshold (0–100, default 90). Higher values return only very close structural matches. 90 is a common threshold for drug analog searches. (default: 90) |
max_results | integer | optional | Number of similar compounds to return (1–50, default 10). (default: 10) |
report_feedbackReport a bug, feature request, or general feedback for this data source.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |