Skip to main content
Glama

Version Framework MCP SDK License TypeScript Bun

Публичный хостинг сервера: https://pubchem.caseyjhand.com/mcp


Инструменты

Восемь инструментов для запросов к базе данных химической информации PubChem:

Название инструмента

Описание

pubchem_search_compounds

Поиск соединений по названию, SMILES, InChIKey, формуле, подструктуре, суперструктуре или 2D-подобию.

pubchem_get_compound_details

Получение физико-химических свойств, описаний, синонимов, оценки лекарственности и классификации соединений по CID.

pubchem_get_compound_image

Получение 2D-структурной диаграммы (PNG) для соединения по CID.

pubchem_get_compound_safety

Получение классификации опасностей GHS и данных о безопасности соединения.

pubchem_get_compound_xrefs

Получение перекрестных ссылок на внешние базы данных (PubMed, патенты, гены, белки и т. д.).

pubchem_get_bioactivity

Получение профиля биоактивности соединения: результаты анализов, мишени и значения активности.

pubchem_search_assays

Поиск биоанализов по биологической мишени (символ гена, белок, Gene ID, UniProt accession).

pubchem_get_summary

Получение сводок по сущностям PubChem: анализы, гены, белки, таксономия.

pubchem_search_compounds

Поиск химических соединений в PubChem с использованием пяти режимов поиска.

  • Поиск по идентификатору — преобразование названий соединений, SMILES или InChIKey в CID (пакетная обработка до 25 элементов)

  • Поиск по формуле — поиск соединений по молекулярной формуле в нотации Хилла

  • Подструктура/суперструктура — поиск соединений, содержащих или содержащихся в структуре запроса

  • 2D-подобие — поиск структурно похожих соединений по подобию Танимото (настраиваемый порог)

  • Опциональное обогащение результатов свойствами для исключения последующего запроса деталей


pubchem_get_compound_details

Получение подробной информации о соединении по CID.

  • Пакетная обработка до 100 CID в одном запросе

  • 27 доступных свойств: молекулярная масса, SMILES, InChIKey, XLogP, TPSA, сложность, количество стереоизомеров и многое другое

  • Опциональное включение текстовых описаний (фармакология, механизм, терапевтическое применение) из PUG View

  • Опциональное включение всех известных синонимов (торговые названия, систематические названия, регистрационные номера)

  • Опциональное вычисление оценки лекарственности (правило пяти Липински + правила Вебера) на основе полученных свойств

  • Опциональное получение фармакологической классификации (классы FDA, механизмы действия, классы MeSH, коды ATC)


pubchem_get_bioactivity

Получение профиля биоактивности соединения из PubChem BioAssay.

  • Возвращает результаты анализов (Активен/Неактивен/Неопределенно), информацию о мишенях (белковые доступы, NCBI Gene ID) и количественные значения (IC50, EC50, Ki)

  • Фильтрация по результату для фокусировки на активных данных

  • Ограничение в 100 результатов на запрос (хорошо изученные соединения могут иметь тысячи)


pubchem_get_summary

Получение описательных сводок для четырех типов сущностей PubChem.

  • Анализы (AID), гены (Gene ID), белки (UniProt accession), таксономия (Tax ID)

  • До 10 сущностей за вызов

  • Извлечение полей, специфичных для типа, для получения чистого структурированного вывода

Related MCP server: PubChem MCP Server

Возможности

Построено на @cyanheads/mcp-ts-core:

  • Декларативные определения инструментов — один файл на инструмент, фреймворк берет на себя регистрацию и валидацию

  • Унифицированная обработка ошибок для всех инструментов

  • Подключаемая аутентификация (none, jwt, oauth)

  • Сменные бэкенды хранения: in-memory, filesystem, Supabase, Cloudflare KV/R2/D1

  • Структурированное логирование с опциональной трассировкой OpenTelemetry

  • Работает локально (stdio/HTTP) или в контейнере через Docker

Специфично для PubChem:

  • Клиент с ограничением частоты запросов для PUG REST и PUG View API (5 запросов/сек с автоматической очередью)

  • Повторные попытки с экспоненциальной задержкой при ошибках 5xx и сбоях сети

  • Все инструменты работают только на чтение и идемпотентны — ключи API не требуются

Начало работы

Публичный хостинг

Публичный экземпляр доступен по адресу https://pubchem.caseyjhand.com/mcp — установка не требуется. Укажите его в любом MCP-клиенте через потоковый HTTP:

{
  "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"
      }
    }
  }
}

Предварительные требования

Установка

  1. Клонируйте репозиторий:

git clone https://github.com/cyanheads/pubchem-mcp-server.git
  1. Перейдите в директорию:

cd pubchem-mcp-server
  1. Установите зависимости:

bun install

Конфигурация

Ключи API не требуются — API PubChem находится в свободном доступе.

Переменная

Описание

По умолчанию

MCP_TRANSPORT_TYPE

Транспорт: stdio или http.

stdio

MCP_HTTP_PORT

Порт для HTTP-сервера.

3010

MCP_HTTP_HOST

Хост для HTTP-сервера.

localhost

MCP_AUTH_MODE

Режим аутентификации: none, jwt или oauth.

none

MCP_LOG_LEVEL

Уровень логирования (RFC 5424).

info

STORAGE_PROVIDER_TYPE

Бэкенд хранения.

in-memory

OTEL_ENABLED

Включить OpenTelemetry.

false

Запуск сервера

Локальная разработка

  • Сборка и запуск:

    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

Структура проекта

Директория

Назначение

src/mcp-server/tools/definitions/

Определения инструментов (*.tool.ts).

src/services/pubchem/

Клиент API PubChem с ограничением частоты и парсингом ответов.

scripts/

Скрипты сборки, очистки, проверки и генерации дерева.

Руководство по разработке

См. CLAUDE.md для получения рекомендаций по разработке и архитектурных правил. Кратко:

  • Обработчики выбрасывают исключения, фреймворк их перехватывает — никакой логики try/catch внутри инструментов

  • Используйте ctx.log для логирования, специфичного для предметной области

  • Регистрируйте новые инструменты в файле index.ts

Вклад в проект

Проблемы и pull-запросы приветствуются. Перед отправкой выполните проверки:

bun run devcheck
bun run test

Лицензия

Apache-2.0 — подробности см. в LICENSE.

Available Tools

10 tools
pubchem_get_bioactivityGet BioactivityA
Read-onlyIdempotent
Inspect

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 StructureA
Read-onlyIdempotent
Inspect

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 DetailsA
Read-onlyIdempotent
Inspect

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 ImageA
Read-onlyIdempotent
Inspect

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 InteractionsA
Read-onlyIdempotent
Inspect

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 SafetyA
Read-onlyIdempotent
Inspect

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-ReferencesA
Read-onlyIdempotent
Inspect

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 SummaryA
Read-onlyIdempotent
Inspect

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 AssaysA
Read-onlyIdempotent
Inspect

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 CompoundsA
Read-onlyIdempotent
Inspect

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

    A4.1/5.0

    Scored across 10 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables 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.
      30
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
      -
    • F
      license
      B
      quality
      D
      maintenance
      Extracts 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.
      3
      11
      -