pubchem-mcp-server
公開ホストサーバー: https://pubchem.caseyjhand.com/mcp
ツール
PubChemの化学情報データベースをクエリするための8つのツール:
ツール名 | 説明 |
| 名前、SMILES、InChIKey、式、部分構造、超構造、または2D類似性によって化合物を検索します。 |
| CIDによって化合物の物理化学的特性、説明、同義語、薬物らしさ、分類を取得します。 |
| CIDによって化合物の2D構造図(PNG)を取得します。 |
| 化合物のGHS危険有害性分類および安全性データを取得します。 |
| 外部データベースの相互参照(PubMed、特許、遺伝子、タンパク質など)を取得します。 |
| 化合物の生物活性プロファイル(アッセイ結果、ターゲット、活性値)を取得します。 |
| 生物学的ターゲット(遺伝子シンボル、タンパク質、Gene ID、UniProtアクセッション)によってバイオアッセイを検索します。 |
| PubChemエンティティ(アッセイ、遺伝子、タンパク質、分類)の要約を取得します。 |
pubchem_search_compounds
5つの検索モードでPubChemの化学化合物を検索します。
識別子検索 — 化合物名、SMILES、またはInChIKeyをCIDに解決します(最大25件のバッチ処理)
式検索 — ヒル表記の分子式で化合物を検索します
部分構造/超構造 — クエリ構造を含む、またはクエリ構造に含まれる化合物を検索します
2D類似性 — Tanimoto類似度(しきい値設定可能)によって構造的に類似した化合物を検索します
オプションで、後続の詳細取得呼び出しを避けるためにプロパティを結果に含める(ハイドレート)ことができます
pubchem_get_compound_details
CIDによって詳細な化合物情報を取得します。
1回の要求で最大100個のCIDをバッチ処理
27種類の利用可能なプロパティ:分子量、SMILES、InChIKey、XLogP、TPSA、複雑度、立体配置数など
オプションでPUG Viewからのテキスト説明(薬理学、メカニズム、治療用途)を含めることができます
オプションですべての既知の同義語(商品名、体系名、登録番号)を含めることができます
オプションで、取得したプロパティから薬物らしさの評価(Lipinskiの法則 + Veberの法則)を計算できます
オプションで薬理学的分類(FDAクラス、作用機序、MeSHクラス、ATCコード)を取得できます
pubchem_get_bioactivity
PubChem BioAssayから化合物の生物活性プロファイルを取得します。
アッセイ結果(活性/不活性/不確定)、ターゲット情報(タンパク質アクセッション、NCBI Gene ID)、および定量的値(IC50、EC50、Ki)を返します
結果でフィルタリングして、活性のある結果に焦点を当てることができます
1リクエストあたり最大100件の結果(よく研究されている化合物は数千件ある場合があります)
pubchem_get_summary
4つのPubChemエンティティタイプの記述的要約を取得します。
アッセイ(AID)、遺伝子(Gene ID)、タンパク質(UniProtアクセッション)、分類(Tax ID)
1回の呼び出しで最大10エンティティ
クリーンで構造化された出力のためのタイプ固有のフィールド抽出
Related MCP server: PubChem MCP Server
機能
@cyanheads/mcp-ts-core 上に構築されています:
宣言的なツール定義 — ツールごとに単一ファイル、フレームワークが登録と検証を処理
すべてのツールにわたる統一されたエラー処理
プラグ可能な認証 (
none,jwt,oauth)交換可能なストレージバックエンド:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1OpenTelemetryトレースをオプションで備えた構造化ログ
ローカル(stdio/HTTP)またはDocker経由のコンテナ化で実行可能
PubChem固有:
PUG RESTおよびPUG View API用のレート制限付きクライアント(自動キューイング付きで5リクエスト/秒)
5xxエラーおよびネットワーク障害時の指数バックオフによる再試行
すべてのツールは読み取り専用かつ冪等 — APIキーは不要
はじめに
公開ホストインスタンス
公開インスタンスが https://pubchem.caseyjhand.com/mcp で利用可能です — インストールは不要です。ストリーミング可能なHTTP経由で任意のMCPクライアントを向けてください:
{
"mcpServers": {
"pubchem": {
"type": "streamable-http",
"url": "https://pubchem.caseyjhand.com/mcp"
}
}
}セルフホスト / ローカル
MCPクライアントの設定(例: claude_desktop_config.json)に追加してください:
{
"mcpServers": {
"pubchem": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/pubchem-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio"
}
}
}
}前提条件
Bun v1.2.0 以上(またはNode.js v22+)
インストール
リポジトリをクローン:
git clone https://github.com/cyanheads/pubchem-mcp-server.gitディレクトリに移動:
cd pubchem-mcp-server依存関係をインストール:
bun install設定
APIキーは不要です — PubChemのAPIは自由にアクセス可能です。
変数 | 説明 | デフォルト |
| トランスポート: |
|
| HTTPサーバーのポート。 |
|
| HTTPサーバーのホスト。 |
|
| 認証モード: |
|
| ログレベル (RFC 5424)。 |
|
| ストレージバックエンド。 |
|
| OpenTelemetryを有効にする。 |
|
サーバーの実行
ローカル開発
ビルドと実行:
bun run rebuild bun run start:stdio # or start:httpチェックとテストの実行:
bun run devcheck # Lints, formats, type-checks bun run test # Runs test suite
Docker
docker build -t pubchem-mcp-server .
docker run -p 3010:3010 pubchem-mcp-serverプロジェクト構造
ディレクトリ | 目的 |
| ツール定義 ( |
| レート制限とレスポンス解析を備えたPubChem APIクライアント。 |
| ビルド、クリーン、devcheck、ツリー生成スクリプト。 |
開発ガイド
開発ガイドラインとアーキテクチャルールについては CLAUDE.md を参照してください。要約:
ハンドラーは例外をスローし、フレームワークがキャッチする — ツールロジック内に
try/catchは不要ドメイン固有のログには
ctx.logを使用新しいツールは
index.tsバレルファイルに登録
貢献
Issueやプルリクエストを歓迎します。提出前にチェックを実行してください:
bun run devcheck
bun run testライセンス
Apache-2.0 — 詳細については LICENSE を参照してください。
Available Tools
10 toolspubchem_get_bioactivityGet BioactivityARead-onlyIdempotentInspect
Get a compound's bioactivity profile: which assays tested it, activity outcomes (Active/Inactive/Inconclusive), target identifiers (NCBI Gene ID, UniProt/GenBank accession), quantitative values (IC50, EC50, Ki, etc.), each assay's type (confirmatory, screening, summary, other), and the PubMed IDs it cites. Filter by outcome, a specific molecular target (NCBI Gene ID or protein accession), assay type, and/or activity name (e.g. IC50) to focus the profile, and rank by potency within the named measurements — e.g. "is this compound active against target T in confirmatory assays?" or "what is its lowest IC50 against T?".
Inputs: cid (required), sort, offset, assayType, +5 more. Returns: cap, cid, sort, error, +16 more
pubchem_get_compound_3d_structureGet Compound 3D StructureARead-onlyIdempotentInspect
Get one 3D conformer of a compound — atomic coordinates and bonds — for one CID: its default conformer, or the one conformerId names. format="json" (default) returns atoms and bonds parsed into structured fields; format="sdf" returns the raw V2000 SDF text for passthrough to docking, rendering, or conformer tools. Optionally lists the compound's other conformer IDs, each one a value for conformerId. Not every compound has computed 3D coordinates (large molecules, mixtures, and some salts do not).
Inputs: cid (required), format, maxAtoms, maxBonds, +3 more. Returns: cid, sdf, atoms, bonds, +12 more
pubchem_get_compound_detailsGet Compound DetailsARead-onlyIdempotentInspect
Get detailed compound information by CID. Returns physicochemical properties (molecular weight, SMILES, InChIKey, XLogP, TPSA, etc.), optionally with a textual description (pharmacology, mechanism, therapeutic use), known synonyms, drug-likeness assessment (Lipinski/Veber rules), and/or pharmacological classification (FDA classes, MeSH classes, ATC codes). Fetches up to 100 CIDs per call; CIDs past that are returned in unprocessed for a follow-up call.
Inputs: cids (required), properties, maxSynonyms, synonymOffset, +6 more. Returns: error, notice, compounds, truncated, +8 more
pubchem_get_compound_imageGet Compound ImageARead-onlyIdempotentInspect
Fetch a 2D structure diagram (PNG image) for a compound by CID.
Inputs: cid (required), size. Returns: cid, error, width, height, +2 more
pubchem_get_compound_interactionsGet Compound InteractionsARead-onlyIdempotentInspect
Get a compound's interaction data: drug-food interactions, and the molecular targets its bioassays name — one entry per target as kinds defines it, with its assay counts by outcome and most potent active value, Active targets first, most potent first. Each entry carries its originating source. Results are paged per kind, with the record total and the next offset reported for each. Drug-food coverage is richest for approved drugs; target covers any compound PubChem has assay data for, and pubchem_get_bioactivity lists one target's assays when given the entry's GeneID or accession. Drug-drug interactions (DrugBank) are unavailable while PubChem's SDQ service refuses automated requests: an explicit drug-drug request is reported in failedKinds while the other kinds still return.
Inputs: cid (required), kinds, offset, maxEntries. Returns: cid, error, notice, offset, +8 more
pubchem_get_compound_safetyGet Compound SafetyARead-onlyIdempotentInspect
Get GHS (Globally Harmonized System) hazard classification and safety data for one or more compounds by CID. Returns signal word, pictograms, hazard statements (H-codes), and precautionary statements (P-codes) per compound, merged across sources, plus each source's own classification — its signal word, pictograms, H-codes with ECHA notifier agreement percentages, and notification counts — since sources often disagree. Reports ECHA "Not Classified" verdicts as their own status.
Inputs: cids (required). Returns: error, notice, results, unprocessed, +3 more
pubchem_get_compound_xrefsGet Compound Cross-ReferencesARead-onlyIdempotentInspect
Get external database cross-references for a compound: PubMed citations, patent IDs, gene associations, CAS and EC numbers with the number of source records that deposited each, other registry numbers, and taxonomy IDs. Results are paged per type — capped at maxPerType with the total count reported; reach the IDs past a page with offset. PubMed IDs come highest (most recently assigned) first and the other numeric types in ascending order; CAS and EC come most-attested first; the other string IDs keep PubChem's order. A type that fails to load is named in failedTypes while the others still return; the call fails only when a type fails and no type other than ProteinGI (which PubChem no longer serves) loads.
Inputs: cid (required), xrefTypes (required), offset, maxPerType. Returns: cid, error, xrefs, notice, +5 more
pubchem_get_summaryGet Entity SummaryARead-onlyIdempotentInspect
Get descriptive summaries for PubChem entities by ID. Supports assays (AID), genes (Gene ID), proteins (UniProt accession), and taxonomy (Tax ID). Up to 10 per call; identifiers past that are returned in unprocessed for a follow-up call.
Inputs: entityType (required), identifiers (required). Returns: error, notice, summaries, entityType, +4 more
pubchem_search_assaysSearch AssaysARead-onlyIdempotentInspect
Find PubChem bioassays associated with a biological target. Search by gene symbol (e.g. "EGFR"), protein name, NCBI Gene ID, or UniProt accession. Returns a page of assay IDs (AIDs) — page past maxResults with offset — which can be explored further with pubchem_get_summary.
Inputs: targetType (required), targetQuery (required), offset, maxResults. Returns: cap, aids, error, shown, +8 more
pubchem_search_compoundsSearch CompoundsARead-onlyIdempotentInspect
Search PubChem for chemical compounds by identifier (name, SMILES, InChI, or InChIKey, up to 25 per call), molecular formula in Hill notation, substructure or superstructure containment, 2D Tanimoto similarity, the compounds a bioassay (AID) found active or tested, or an accurate mass or molecular weight range. Returns a page of CIDs, each similarity hit with its Tanimoto score — reach matches past maxResults with offset. Optionally hydrate results with properties to avoid a follow-up pubchem_get_compound_details call.
Inputs: searchType (required), aid, query, offset, +12 more. Returns: cap, error, shown, notice, +11 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct facet of PubChem data (search, details, 3D conformer, image, safety, xrefs, bioactivity, interactions, assay search, summaries), and the descriptions explicitly disambiguate the closest pairs: bioactivity is per-assay/per-target measurement data while interactions is per-target aggregation plus drug-food data. The main soft overlaps are pubchem_search_assays vs. pubchem_get_summary (AID) and the optional property hydration in pubchem_search_compounds vs. pubchem_get_compound_details, but these are explained clearly enough to guide selection.
All tools share a pubchem_ prefix and use verb_noun form (search_/get_), which is highly predictable. There are minor deviations: most follow get_compound_X but pubchem_get_bioactivity drops the compound_ segment, and pubchem_get_summary names no resource at all, so the resource is not always inferable from the name alone.
Ten tools is squarely in the well-scoped range for a chemical database server, and each one covers a distinct data type (search, properties, 3D, image, safety, xrefs, bioactivity, interactions, assays, summaries) without redundant entries.
The surface covers the full compound lifecycle: discovery (search by name/SMILES/formula/similarity/substructure), enrichment (properties, synonyms, drug-likeness, classification), structure (2D image, 3D conformer), safety, cross-references, bioactivity, target interactions, and assay lookup. No obvious dead ends for the stated PubChem domain; the only gap is a dedicated assay-detail tool, which pubchem_get_summary partially fills.
Maintenance
Related MCP Connectors
Link compounds to protein targets, rank bioactivity, and look up drug mechanisms and indications.
FTIR spectral search and material identification for AI agents via MCP.
Connect AI clients to biomedical data and tools.
Web knowledge fetching tools for your agent.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables comprehensive access to PubChem's chemical database with over 110 million compounds. Supports chemical searches, structure analysis, bioactivity data, safety information, and molecular property calculations through 30 specialized tools.30MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and retrieve chemical compound information, structures, and physical properties from the PubChem database. It supports querying via compound names, SMILES notation, or CIDs to provide detailed molecular data for chemical analysis.5-
- FlicenseBqualityDmaintenanceExtracts basic chemical information and drug data from the PubChem API. It enables users to retrieve molecular details such as SMILES, IUPAC names, molecular formulas, and synonyms for specific compounds.311-
- AlicenseNot gradedqualityCmaintenanceProvides access to the NIH PubChem chemistry compound database, enabling queries for compound synonyms and other data through natural language.76 npmMIT