Skip to main content
Glama
Organic Chemistry Structure MCP Server

Organic Chemistry Structure MCP Server

有机化学结构 MCP 服务器 🧪

一个生产级 模型上下文协议(MCP) 服务器,旨在让 AI 助手(ChatGPT、Gemini、Claude、Cursor、MCP Inspector)能够直接在 AI 对话中,使用原生 MCP 图像内容,确定性地渲染、解析并显示准确的二维有机化学结构、反应、机理、共振贡献体和立体化学。


主要特性

  • 对话内直接二维描绘:返回原生 MCP 图像内容项(image/png base64),使兼容的 AI 客户端无需外部图像托管或扩散模型即可直接渲染结构。

  • 确定性化学渲染:由 RDKit 和 Cairo 驱动,以 CPK 标准颜色和清晰的骨架键生成出版级教科书式描绘。

  • 多层解析:

    1. 精选 JEE 预设:本地加载 200+ 个 11/12 年级 JEE Main 和 Advanced 化合物及试剂,实现即时(<10ms)响应。

    2. SQLite 持久缓存:自动缓存已解析的化合物和预渲染的描绘。

    3. PubChem PUG REST API:为数千种已知有机分子提供回退查找。

    4. 歧义引擎:绝不猜测异构体。标记歧义名称(例如 甲酚、丁醇、二甲苯)并提示消歧。

  • 7 个 MCP 工具:

    • show_structure:带分子式、分子量、SMILES 和来源元数据的可视化二维描绘。

    • resolve_compound:以结构化 JSON 形式提供完整的分子元数据。

    • show_reaction:带条件和箭头的出版级对齐反应方程式。

    • show_mechanism:带中间体面板、形式电荷和弯箭头的多步机理(SN1、SN2、EAS、烯烃水合、Aldol)。

    • compare_structures:并排分子比较网格。

    • show_resonance:用括号括起并以 $\leftrightarrow$ 箭头连接的共振规范贡献体。

    • show_stereochemistry:带 R/S 和 E/Z 标注的显式三维楔形-虚线投影。

  • 双传输:

    • Streamable HTTP:用于远程 AI 连接的现代 /mcp 端点。

    • Stdio:用于本地 AI 工具和 MCP Inspector CLI 的标准输入/输出传输。

  • 测试与管理 Web 工作室:使用 React + Vite + Tailwind CSS 构建,用于实时测试、检查 MCP 调用、浏览预设和监控服务器健康状态。


Related MCP server: chemdraw-mcp

快速开始

1. 前置条件

  • Node.js:v18+(已在 Node.js v24 上测试)

  • Python:v3.10+(已在 Python 3.12 上使用 .venv 测试)

2. 安装

# Clone or open the repository directory
cd chem

# Install Node.js dependencies
npm install

# Setup Python virtual environment and chemistry dependencies
py -3.12 -m venv .venv
.\.venv\Scripts\python -m pip install rdkit pillow fastapi uvicorn pydantic requests pytest

3. 构建与运行

# Build the TypeScript backend & React frontend
npm run build
cd web && npm run build && cd ..

# Start the unified MCP server & Web Studio (starts Node and Python engine automatically)
npm run dev
# Or for production:
npm start
  • MCP Streamable HTTP 端点:http://localhost:3000/mcp

  • Web 测试与管理工作室:http://localhost:3000/

  • 健康检查:http://localhost:3000/health


连接 AI 客户端

1. Claude Desktop(stdio)

将以下内容添加到您的 claude_desktop_config.json:

{
  "mcpServers": {
    "organic-chemistry": {
      "command": "npx",
      "args": ["-y", "tsx", "C:/Users/TANMAY GARG/Desktop/chem/src/mcp/transports/stdioTransport.ts"]
    }
  }
}

2. MCP Inspector

要以交互方式检查和测试全部 7 个工具:

npx @modelcontextprotocol/inspector npx tsx src/mcp/transports/stdioTransport.ts

或通过 Streamable HTTP 连接到 http://localhost:3000/mcp。

3. ChatGPT 与远程 AI 客户端

将服务器部署到启用 HTTPS 的域名(例如 https://your-mcp-domain.com/mcp),并将其配置为自定义操作或 MCP 连接器。


运行测试

# Run Node.js unit and integration tests (Vitest)
npm test

# Run Python RDKit engine tests (pytest)
npm run test:python

许可证

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Renders interactive 2D molecular structure diagrams from SMILES notation and computes molecular properties like molecular weight, LogP, and TPSA, directly in the chat.
    1
    60 npm
    2
    ISC
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides an MCP interface for publication-quality chemical structure and reaction rendering from SMILES/InChI/molblock, with validation and name parsing. Enables AI agents to draw molecules and reactions as images.
    102 PyPI
    MIT
  • A
    license
    C
    quality
    F
    maintenance
    Enables LLM agents to draw and edit ChemDraw reaction schemes, parse ELN exports and LCMS/NMR data, and generate publication-ready CDXML files through grounded chemistry tools.
    35
    3
    MIT