How augmented-nature/pubchem-mcp-server works
This is a single-file TypeScript MCP server exposing PubChem search, chemical informatics, bioassay, safety, and cross-reference capabilities as tools and URI resources. The principal workflow is an MCP client request, server dispatch, domain-specific PubChem REST request, and returned data. The implementation is concentrated in src/index.ts; README-described subsystems are represented there even where their handler excerpts were not supplied. Relationships for those unsampled capabilities rely on README documentation.
Main entry points: index.ts Tool Dispatcher
Components 14
MCP Interface
- MCP Server
src/index.ts - Tool Dispatcher
src/index.ts - Resource Templates
src/index.ts - Input Validation
src/index.ts
Chemical Informatics
- Compound Search
src/index.ts - Compound Retrieval
src/index.ts - Structure Analysis
src/index.ts - Properties & Descriptors
src/index.ts
Bioassay Data
- Bioassay & Activity
src/index.ts
Safety & References
- Safety & Toxicity
src/index.ts - External References
src/index.ts - Batch Lookup
src/index.ts
Other components
- MCP Client
- PubChem REST API
Connections 21
- MCP Client → MCP Server: sends MCP requests
README.md - MCP Server → Tool Dispatcher: dispatches tools
src/index.ts - MCP Server → Resource Templates: serves templates
README.md - Tool Dispatcher → Input Validation: validates inputs
README.md - Tool Dispatcher → Compound Search: routes requests
src/index.ts - Compound Search → PubChem REST API: queries compounds
src/index.ts - Tool Dispatcher → Compound Retrieval: routes requests
README.md - Compound Retrieval → PubChem REST API: fetches compound data
src/index.ts - Tool Dispatcher → Structure Analysis: routes requests
README.md - Structure Analysis → PubChem REST API: queries structures
src/index.ts - Tool Dispatcher → Properties & Descriptors: routes requests
README.md - Properties & Descriptors → PubChem REST API: fetches properties
src/index.ts - Tool Dispatcher → Bioassay & Activity: routes requests
README.md - Bioassay & Activity → PubChem REST API: queries assays
src/index.ts - Tool Dispatcher → Safety & Toxicity: routes requests
README.md - Safety & Toxicity → PubChem REST API: fetches classifications
src/index.ts - Tool Dispatcher → External References: routes requests
README.md - External References → PubChem REST API: queries references
README.md - Tool Dispatcher → Batch Lookup: routes requests
README.md - Batch Lookup → PubChem REST API: looks up compounds
README.md - Resource Templates → PubChem REST API: fetches resource data
src/index.ts