{
  "markdown": "<div align=\"center\">\n  <h1>@cyanheads/pubchem-mcp-server</h1>\n  <p><b>Search the PubChem chemical database for compounds, properties, safety data, bioactivity, cross-references, and entity summaries via MCP. STDIO or Streamable HTTP.</b>\n  <div>10 Tools • 6 Resources</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.6.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/pubchem-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/pubchem-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/pubchem-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-^1.3.0-f472b6.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/pubchem-mcp-server/releases/latest/download/pubchem-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=pubchem-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvcHViY2hlbS1tY3Atc2VydmVyIl19) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22pubchem-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads/pubchem-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n<div align=\"center\">\n\n**Public Hosted Server:** [https://pubchem.caseyjhand.com/mcp](https://pubchem.caseyjhand.com/mcp)\n\n</div>\n\n---\n\n## Tools\n\nTen tools for querying PubChem's chemical information database:\n\n| Tool Name | Description |\n|:----------|:------------|\n| `pubchem_search_compounds` | Search for compounds by name, SMILES, InChIKey, formula, substructure, superstructure, or 2D similarity. |\n| `pubchem_get_compound_details` | Get physicochemical properties, descriptions, synonyms, drug-likeness, and classification for compounds by CID. |\n| `pubchem_get_compound_image` | Fetch a 2D structure diagram (PNG) for a compound by CID. |\n| `pubchem_get_compound_3d_structure` | Fetch a 3D conformer (atomic coordinates and bonds) for a compound by CID, as parsed JSON or raw SDF. |\n| `pubchem_get_compound_xrefs` | Get external database cross-references (PubMed, patents, genes, proteins, etc.). |\n| `pubchem_get_compound_safety` | Get GHS hazard classification and safety data for one or more compounds by CID (batch). |\n| `pubchem_get_bioactivity` | Get a compound's bioactivity profile: assay results, targets, and activity values; filter by outcome or molecular target. |\n| `pubchem_get_compound_interactions` | Get drug-drug, drug-food, and chemical-target interactions for a compound by CID. |\n| `pubchem_search_assays` | Find bioassays by biological target (gene symbol, protein, Gene ID, UniProt accession). |\n| `pubchem_get_summary` | Get summaries for PubChem entities: assays, genes, proteins, taxonomy. |\n\n### `pubchem_search_compounds`\n\nSearch PubChem for chemical compounds across five search modes.\n\n- **Identifier lookup** — resolve compound names, SMILES, or InChIKeys to CIDs (batch up to 25)\n- **Formula search** — find compounds by molecular formula in Hill notation\n- **Substructure/superstructure** — find compounds containing or contained within a query structure\n- **2D similarity** — find structurally similar compounds by Tanimoto similarity (configurable threshold)\n- Caps at 200 CIDs per page; `offset` pages further, to a ceiling of 10,000. Identifier lookups page over the set already resolved; formula and structure searches widen their bounded upstream request to reach a page, so deep pages cost more upstream\n- Optionally hydrate results with properties to avoid a follow-up details call\n\n---\n\n### `pubchem_get_compound_details`\n\nGet detailed compound information by CID.\n\n- Batches up to 100 CIDs in a single request\n- 27 available properties: molecular weight, SMILES, InChIKey, XLogP, TPSA, complexity, stereo counts, and more\n- Optionally includes textual descriptions (pharmacology, mechanism, therapeutic use) from PUG View — fetched for the first 10 CIDs of a batch, with the skipped CIDs named in the response\n- Optionally includes known synonyms (trade names, systematic names, registry numbers)\n- Synonyms and descriptions are paged: `synonymOffset` and `descriptionOffset` window every compound in the batch at the same position, reaching the entries past a page\n- Optionally computes drug-likeness assessment (Lipinski Rule of Five + Veber rules) from fetched properties\n- Optionally fetches pharmacological classification (FDA classes, mechanisms of action, MeSH classes, ATC codes)\n\n---\n\n### `pubchem_get_bioactivity`\n\nGet a compound's bioactivity profile from PubChem BioAssay.\n\n- Returns assay outcomes (Active/Inactive/Inconclusive), target info (protein accessions, NCBI Gene IDs), and quantitative values (IC50, EC50, Ki)\n- Filter by outcome and/or a specific molecular target (NCBI Gene ID or protein accession)\n- Caps at 100 results per page; `offset` reaches the rest (well-studied compounds may have thousands)\n\n---\n\n### `pubchem_get_summary`\n\nGet descriptive summaries for four PubChem entity types.\n\n- Assays (AID), genes (Gene ID), proteins (UniProt accession), taxonomy (Tax ID)\n- Up to 10 entities per call\n- Type-specific field extraction for clean, structured output\n\n---\n\n### `pubchem_get_compound_interactions`\n\nGet a compound's interaction data by CID.\n\n- Drug-drug interactions (DrugBank), drug-food interactions, and chemical-target binding/activity (BindingDB, ChEMBL, and others)\n- Select which interaction kinds to fetch and cap entries per kind\n- Paged per kind: each reports its source-record total and its own `nextOffset`, and `offset` reaches the records past a page\n- Each entry carries its originating source — coverage is richest for approved drugs\n\n---\n\n### `pubchem_get_compound_3d_structure`\n\nGet a compound's default 3D conformer by CID.\n\n- `format=\"json\"` returns parsed atoms (element + x/y/z) and bonds for direct reasoning; `format=\"sdf\"` returns raw V2000 SDF for passthrough to docking or rendering\n- `maxAtoms`/`maxBonds` bound the atom/bond preview and `includeRawSdf` opts into a large raw SDF past the safe line cap; `atomCount`/`bondCount` always report the totals and any capping is disclosed\n- Optionally lists alternate conformer IDs\n- Returns a typed not-found when PubChem has no computed 3D coordinates (large molecules, mixtures, some salts)\n\n## Resources\n\nCompound and assay records are also exposed as URI-templated MCP resources, backed by the same client methods as the tools:\n\n| URI Template | Returns |\n|:-------------|:--------|\n| `pubchem://compound/{cid}` | Core physicochemical properties (JSON). |\n| `pubchem://compound/{cid}/safety` | GHS hazard classification (JSON). |\n| `pubchem://compound/{cid}/image` | 2D structure diagram (PNG). |\n| `pubchem://compound/{cid}/xrefs` | External cross-references (JSON). |\n| `pubchem://compound/{cid}/bioactivity` | Bioassay activity profile (JSON). |\n| `pubchem://assay/{aid}` | BioAssay summary (JSON). |\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):\n\n- Declarative tool definitions — single file per tool, framework handles registration and validation\n- Unified error handling across all tools\n- Pluggable auth (`none`, `jwt`, `oauth`)\n- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`\n- Structured logging with optional OpenTelemetry tracing\n- Runs locally (stdio/HTTP) or containerized via Docker\n\nPubChem-specific:\n\n- Rate-limited client for PUG REST and PUG View APIs (5 req/s with automatic queuing)\n- Retry with exponential backoff on 5xx errors and network failures\n- All tools are read-only and idempotent — no API keys required\n\n## Getting Started\n\n### Public Hosted Instance\n\nA public instance is available at `https://pubchem.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:\n\n```json\n{\n  \"mcpServers\": {\n    \"pubchem-mcp-server\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://pubchem.caseyjhand.com/mcp\"\n    }\n  }\n}\n```\n\n### Self-Hosted / Local\n\nAdd to your MCP client config (e.g., `claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"pubchem-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/pubchem-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\"\n      }\n    }\n  }\n}\n```\n\n### Prerequisites\n\n- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+)\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/pubchem-mcp-server.git\n```\n\n1. **Navigate into the directory:**\n\n```sh\ncd pubchem-mcp-server\n```\n\n1. **Install dependencies:**\n\n```sh\nbun install\n```\n\n## Configuration\n\nNo API keys are required — PubChem's API is freely accessible.\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |\n| `MCP_HTTP_HOST` | Host for HTTP server. | `localhost` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend. | `in-memory` |\n| `OTEL_ENABLED` | Enable OpenTelemetry. | `false` |\n\n## Running the Server\n\n### Local Development\n\n- **Build and run:**\n\n  ```sh\n  bun run rebuild\n  bun run start:stdio   # or start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck     # Lints, formats, type-checks\n  bun run test         # Runs test suite\n  ```\n\n### Docker\n\n```sh\ndocker build -t pubchem-mcp-server .\ndocker run -p 3010:3010 pubchem-mcp-server\n```\n\n## Project Structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). |\n| `src/services/pubchem/` | PubChem API client with rate limiting and response parsing. |\n| `scripts/` | Build, clean, devcheck, and tree generation scripts. |\n\n## Development Guide\n\nSee [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for domain-specific logging\n- Register new tools in the `index.ts` barrel file\n\n## Contributing\n\nIssues and pull requests are welcome. Run checks before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n",
  "bytes": 11359,
  "sha": "8936b37a0c8afa66b2e2e27f82f4aafbef6a86e1b7980e7387da3a9192854fe2",
  "repo_slug": "cyanheads/pubchem-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_cyanheads_pubchem_mcp_server_7460a20c/readme"
}