pubchem-mcp-server
公共托管服务器: https://pubchem.caseyjhand.com/mcp
工具
用于查询 PubChem 化学信息数据库的八个工具:
工具名称 | 描述 |
| 通过名称、SMILES、InChIKey、分子式、子结构、超结构或 2D 相似度搜索化合物。 |
| 通过 CID 获取化合物的物理化学性质、描述、同义词、药物相似性和分类。 |
| 通过 CID 获取化合物的 2D 结构图 (PNG)。 |
| 获取化合物的 GHS 危险分类和安全数据。 |
| 获取外部数据库交叉引用(PubMed、专利、基因、蛋白质等)。 |
| 获取化合物的生物活性概况:分析结果、靶点和活性值。 |
| 通过生物靶点(基因符号、蛋白质、基因 ID、UniProt 登录号)查找生物分析。 |
| 获取 PubChem 实体的摘要:分析、基因、蛋白质、分类学。 |
pubchem_search_compounds
通过五种搜索模式在 PubChem 中搜索化学化合物。
标识符查找 — 将化合物名称、SMILES 或 InChIKey 解析为 CID(最多可批量处理 25 个)
分子式搜索 — 通过 Hill 记法中的分子式查找化合物
子结构/超结构 — 查找包含查询结构或被查询结构包含的化合物
2D 相似度 — 通过 Tanimoto 相似度(阈值可配置)查找结构相似的化合物
可选:使用属性填充结果,以避免后续的详细信息调用
pubchem_get_compound_details
通过 CID 获取详细的化合物信息。
单次请求最多可批量处理 100 个 CID
27 种可用属性:分子量、SMILES、InChIKey、XLogP、TPSA、复杂性、立体计数等
可选:包含来自 PUG View 的文本描述(药理学、机制、治疗用途)
可选:包含所有已知的同义词(商品名、系统名称、注册号)
可选:根据获取的属性计算药物相似性评估(Lipinski 五规则 + Veber 规则)
可选:获取药理学分类(FDA 分类、作用机制、MeSH 分类、ATC 代码)
pubchem_get_bioactivity
从 PubChem BioAssay 获取化合物的生物活性概况。
返回分析结果(活性/非活性/不确定)、靶点信息(蛋白质登录号、NCBI 基因 ID)和定量值(IC50、EC50、Ki)
按结果过滤以专注于活性结果
每次请求上限为 100 个结果(研究充分的化合物可能有数千个)
pubchem_get_summary
获取四种 PubChem 实体类型的描述性摘要。
分析 (AID)、基因 (Gene ID)、蛋白质 (UniProt 登录号)、分类学 (Tax ID)
每次调用最多 10 个实体
针对特定类型的字段提取,以获得清晰、结构化的输出
Related MCP server: PubChem Chemical Safety 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 req/s,带自动排队)
在 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 客户端。 |
| 构建、清理、开发检查和树生成脚本。 |
开发指南
请参阅 CLAUDE.md 获取开发准则和架构规则。简而言之:
处理程序抛出异常,框架捕获 — 工具逻辑中不使用
try/catch使用
ctx.log进行特定领域的日志记录在
index.ts桶文件中注册新工具
贡献
欢迎提交问题和拉取请求。提交前请运行检查:
bun run devcheck
bun run test许可证
Apache-2.0 — 详情请参阅 LICENSE。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- AlicenseBqualityDmaintenanceEnables users to retrieve chemical safety information including compound properties, GHS safety classifications, and toxicity data from PubChem database using compound names or CIDs. Supports batch queries with caching for efficient chemical safety research and analysis.3MIT
- AlicenseBqualityCmaintenanceEnables AI agents to search the Chemspace API for synthesizable building blocks and screening compounds using exact matches, substructure searches, and similarity searches by SMILES strings.31MIT
- Flicense-qualityDmaintenanceEnables 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
Related MCP Connectors
Link compounds to protein targets, rank bioactivity, and look up drug mechanisms and indications.
Real-time Amazon, WIPO & PACER data for AI agents — 19 tools via the MCP protocol.
PubChem MCP — NIH chemistry compound database (no auth)
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/pubchem-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server