io.github.scottmreed/ChemCP

编码与调试

by scottmreed

基于 RDKit.js 的 MCP 应用,可从 SMILES 渲染二维分子结构,适合化学可视化与分析。

什么是 io.github.scottmreed/ChemCP

基于 RDKit.js 的 MCP 应用,可从 SMILES 渲染二维分子结构,适合化学可视化与分析。

README

ChemCP - Molecule Viewer MCP App

An MCP App that renders interactive 2D molecular structure diagrams from SMILES notation using RDKit.js. Ask your AI assistant to show you any molecule, and ChemCP displays the structure with computed properties — right inside the chat.

What you get

  • 2D structure diagrams rendered from any valid SMILES string
  • Molecular properties — molecular weight, LogP, H-bond donors/acceptors, TPSA, rotatable bonds, rings, and more
  • Interactive UI — type your own SMILES, click example molecules, all without leaving the conversation
  • Powered by RDKit (the same cheminformatics toolkit used by pharma and biotech)

For more functionality try: ChemIllusion

Prerequisites

  • Node.js 18+download here
  • Claude Desktop (recommended) or Claude.ai paid plan (Pro/Max/Team) — the interactive molecule viewer requires a host that supports MCP Apps

Note: Claude Desktop has full MCP Apps support. Claude.ai custom connectors are experimental and may have CSP limitations that prevent RDKit.js from loading. If you see "RDKit.js failed to load" in Claude.ai, use Claude Desktop instead.


Setup: Claude Desktop

Claude Desktop supports local MCP servers out of the box. No tunnels or remote hosting needed.

Step 1: Install ChemCP

bash
npm install -g chemcp

Verify it installed:

bash
chemcp --help

(It will start the MCP server on stdio — you can Ctrl+C to stop it.)

Step 2: Configure Claude Desktop

Open your Claude Desktop config file:

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

Add ChemCP to the mcpServers section:

json
{
  "mcpServers": {
    "chemcp": {
      "command": "npx",
      "args": ["chemcp"]
    }
  }
}

Tip: If you already have other MCP servers configured, just add the "chemcp" entry alongside them inside the existing "mcpServers" object.

Step 3: Restart Claude Desktop

Quit and reopen Claude Desktop. You should see ChemCP listed in the MCP tools (click the hammer icon at the bottom of the chat input).

Step 4: Try it out

Type a message like:

  • "Show me the molecule for aspirin"
  • "Render the structure of caffeine"
  • "Display SMILES: CC(=O)Oc1ccccc1C(=O)O"

Claude will call the render_molecule tool, and an interactive molecule viewer will appear in the conversation showing the 2D structure and molecular properties.


Setup: Claude.ai (Web) — Experimental

⚠️ Experimental: Claude.ai custom connectors have experimental MCP Apps support. CSP restrictions may prevent RDKit.js from loading. Use Claude Desktop for the best experience.

Claude.ai supports remote MCP servers via custom connectors. This requires a paid Claude plan (Pro, Max, or Team).

Step 1: Install and start the server

bash
npm install -g chemcp

Start in HTTP mode:

bash
chemcp --http

This starts the server on http://localhost:3001/mcp.

Step 2: Expose with a tunnel

In a separate terminal, create a public tunnel to your local server:

bash
npx cloudflared tunnel --url http://localhost:3001

Copy the generated URL (e.g., https://random-name.trycloudflare.com).

Step 3: Add as a custom connector in Claude.ai

  1. Go to claude.ai
  2. Click your profile picture (bottom-left)
  3. Go to Settings > Connectors
  4. Click Add custom connector
  5. Paste your tunnel URL + /mcp (e.g., https://random-name.trycloudflare.com/mcp)
  6. Give it a name like "ChemCP"
  7. Save

Step 4: Try it out

Start a new chat and ask Claude to show you a molecule:

  • "Show me the structure of ibuprofen"
  • "What does benzene look like? Render it for me"
  • "Render SMILES: CN1C=NC2=C1C(=O)N(C(=O)N2C)C"

The interactive molecule viewer will render directly in the chat.


Example prompts

Once connected, try these:

PromptWhat happens
"Show me aspirin"Renders aspirin's 2D structure + properties
"Render SMILES: CCO"Renders ethanol from its SMILES code
"What's the structure of testosterone?"Claude provides the SMILES and renders it
"Compare the structures of caffeine and theobromine"Renders both molecules side by side

Example SMILES

MoleculeSMILES
EthanolCCO
Benzenec1ccccc1
AspirinCC(=O)Oc1ccccc1C(=O)O
CaffeineCN1C=NC2=C1C(=O)N(C(=O)N2C)C
TestosteroneCC12CCC3C(C1CCC2O)CCC4=CC(=O)CCC34C
GlucoseOC[C@H]1OC(O)[C@H](O)[C@@H](O)[C@@H]1O

Troubleshooting

"I don't see the molecule viewer, just text"

The interactive UI only works in hosts that support MCP Apps:

  • Claude Desktop (latest version)
  • Claude.ai (web, with custom connector)

If you're using Claude Code (CLI) or another MCP client that doesn't support MCP Apps, the tool will still return the SMILES data as text, but the visual rendering won't appear.

"Tool not found" or ChemCP not listed

  • Claude Desktop: Make sure you restarted the app after editing the config file. Check that npx chemcp works in your terminal.
  • Claude.ai: Make sure the tunnel is still running and the connector URL ends with /mcp.

"RDKit.js failed to load from CDN"

Claude.ai custom connectors: CSP limitations may prevent RDKit.js from loading when using custom connectors. Solution: Use Claude Desktop instead, which has full MCP Apps support.

Claude Desktop: If RDKit.js fails to load, this usually means:

  • No internet connection (RDKit.js loads from unpkg.com, ~8 MB)
  • CDN is blocked by your network firewall
  • First load timeout — reload the chat and try again

Node.js version

ChemCP requires Node.js 18 or higher. Check with:

bash
node --version

For developers

Local development

bash
git clone https://github.com/scottmreed/ChemCP.git
cd ChemCP
npm install
npm run build
npm run serve:http    # HTTP mode for testing

Project structure

FilePurpose
server.tsMCP server — registers render_molecule tool and serves the UI resource
src/mcp-app.htmlHTML entry point, loads RDKit.js from CDN
src/mcp-app.tsxReact UI — initializes RDKit WASM, renders SVG from SMILES, computes descriptors
bin/chemcp.jsnpm bin entry point
dist/Built output (compiled server + bundled single-file HTML)

How it works

  1. Claude calls the render_molecule tool with a SMILES string
  2. The server returns the SMILES to the MCP App UI
  3. The UI loads RDKit.js (WebAssembly) in the browser
  4. RDKit parses the SMILES and renders a 2D SVG structure diagram
  5. Molecular descriptors (MW, LogP, TPSA, etc.) are computed client-side
  6. Everything displays in a sandboxed iframe inside the chat

Testing with the basic-host

The ext-apps repository includes a test host for MCP App development:

bash
# Terminal 1 — run ChemCP in HTTP mode
npm run serve:http

# Terminal 2 — run the test host
git clone https://github.com/modelcontextprotocol/ext-apps.git
cd ext-apps/examples/basic-host
npm install
SERVERS='["http://localhost:3001/mcp"]' npm start
# Open http://localhost:8080

Links

常见问题

io.github.scottmreed/ChemCP 是什么?

基于 RDKit.js 的 MCP 应用,可从 SMILES 渲染二维分子结构,适合化学可视化与分析。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论