CoChem试剂
一个用于构建化学和材料试剂的协作框架,具有通用试剂框架,如Gemini CLI、Claude code或Codex+主控程序.
化学试剂: 化学与材料人工智能的开放框架。使用CodeX作为总代理外壳,并通过模型上下文协议(MCP)添加功能。跳过一次性代理——发布MCP服务器(RDKit、材料项目、模拟、实验室API)并组合它们。一次集成,随处重用。
CoChem试剂 颠覆了“每个域一个代理”的模式。我们使用 总代理框架,如Codex 作为通用代理shell和插件域工具,通过 模型上下文协议(MCP)任何人都可以贡献一个MCP服务器——RDKit、Materials Project、您的内部管道——并且它可以立即被同一代理使用。这创造了一个开放、可扩展的生态系统,而不是一个孤立的代理动物园。
为什么化学和材料试剂很重要
人工智能正在迅速加速化学和材料的发现——从结构/性能预测到聚合物和晶体建模——将研究从静态预测推向 能动性 计划、行动和迭代的工作流。调查和社区报告记录了使这些系统在实验室和计算机上实用的强大工具的势头和需求。
什么不起作用
之前的大多数努力都是为了 每个子字段的独立代理 (药物设计、催化、晶体……),每个都有定制的胶水代码、脆弱的集成和重复的工作。评估通常强调推理,但很难 再现性和工具通用性,因此系统在任务或实验室之间不能很好地运行。与此同时,工具访问(API、DB、代码)是分散的,很难在代理之间实现标准化。
核心技术障碍
- 异构工具和模式: 化学信息库、材料数据库、模拟引擎——所有不同的调用模式和数据模型。
- 代理-工具接线和维护: 每个代理都重新实现了连接器和身份验证,从而导致漂移和重复。
- 安全与治理: 向代理开放工具会引发关于身份验证、数据访问和隔离的问题。
- 评估和来源: 代理基准测试了体重不足的再现性和端到端的论文对协议的忠实性。
我们的方法(有什么不同)
1.一个代理框架来管理所有代理 使用Codex作为通用代理运行时(聊天+工具+提示)。不再有特定于域的shell。
2.作为MCP服务器的工具 将化学/材料能力作为MCP工具(标准化名称、模式、元数据)公开。任何与MCP兼容的客户端(如Codex)都可以发现并调用它们——代理中没有定制的胶水。
3.开放的生态系统,而不是一次性代理
- 化学信息学: 社区MCP服务器 RDKit 提供描述符计算、子结构搜索、渲染等。插入并使用。
- 材料数据: 连接到 材料项目 通过其用于结构、形成能和带隙的公共API(或MCP封装器)。
- 定制科学: FastMCP +Gemini CLI使您可以直接将实验室的管道发布为可重用的工具,而不是定制的代理。
TL;DR(项目意图)
- 使命: 通过统一Codex+MCP,为化学和材料试剂构建一个开放的多工具生态系统。
- 为什么重要: 代理科学需要可互操作的工具,而不是更加孤立的代理。
- 您如何提供帮助: 贡献或改进MCP服务器(RDKit、材料项目、模拟、ELN/SDMS、机器人实验室API)。代理人是免费来的。
快速开始
安装
克隆仓库
git clone https://github.com/yuxi-TJU/CoChem-Agents.git
cd ai-chemkit安装依赖
npm install
npm run build #生成 dist/.配置各 API 密钥
CHEMSPIDER_API_KEY、MATERIALS_PROJECT_API_KEY 等,通过环境变量或 .env.
CLI 安装到 Codex
自动安装(推荐)
npx chemagent手动安装
npx chemagent-cli install --platform codex --home --configure-mcp配置 & 注册 MCP 服务
~/.chemagent/mcp_config.json,里面列着所有内置和社区 MCP
npx chemagent- #注册你需要的服务器命令系统
ChemAgent 采用类似 SuperClaude_Framework 的 Markdown 命令定义方式,命令定义简单灵活:
命令定义位置
- 项目级:
.claude/commands/- 项目专用命令 - 用户级:
~/.claude/commands/- 个人全局命令 - 系统级: ChemAgent 自带的默认命令
创建自定义命令
# 在项目中创建命令
mkdir -p .claude/commands
cat > .claude/commands/my-analysis.md << EOF
---
description: 我的分子分析流程
tools: [read_file, web_search]
---
请执行以下分析步骤:
1. 验证分子结构
2. 计算基本性质
3. 预测ADMET
4. 生成报告
EOF案例研究
案例1
请帮我设计一个环保的阿司匹林合成路线(请调用mcp工具并告诉我你调用了哪些mcp工具)• Green Aspirin Route
- Used MCP tool chemagent-extras: chem_synthesize to frame the eco-design constraints and ensure route planning stayed
aligned with renewable feedstocks/recyclable catalysts.
- Start from bio-derived phenol converted to sodium phenolate; perform a Kolbe–Schmitt fixation with recycled/biogenic
CO₂ at 130 °C and 8–10 bar in water or glycerol/water to give sodium salicylate, then mildly acidify with recyclable
dilute acetic acid to obtain salicylic acid.
- Dry salicylic acid and acetylate with bio-ethanol–derived acetic anhydride (0.95–1.0 equiv) in a recyclable solvent
such as 2-MeTHF or EtOAc at 70–80 °C, using a reusable solid acid catalyst (Amberlyst-15 or supported succinic acid/
Fe³⁺); catalyst is filtered, washed, and reused.
- Quench with a small amount of reclaimed water to hydrolyze excess anhydride; phase-separate, recover acetic acid for
reconversion to acetic anhydride, and recycle organic solvent by distillation.
- Crude aspirin is recrystallized from ethanol/water (both bio-sourced) with mother liquors redistilled; solid is
dried under reduced pressure powered by low-carbon electricity.
- Waste minimization: no mineral acids beyond trace acetic acid, closed-loop solvents, solid acid catalyst
regeneration, and CO₂ capture integration keep the E-factor low and the process compliant with green-chemistry
principles.
Next steps: 1) quantify mass balance/E-factor for target scale; 2) run small Kolbe–Schmitt trials to confirm CO₂
recycle efficiency.案例2
请帮我分析作为有机中间合成体,邻苯二甲酸单乙酸酯可以制备什么材料,并给出制备方法(请调用mcp工具并告诉我你调用了哪些mcp工具)• Downstream Materials
- chemagent-extras: chem_synthesize (targets: cellulose acetate phthalate; DEHP plasticizer) flagged phthalic
monoacetate as a versatile half-ester that can be driven either toward anhydrides for acylation chemistry or toward
fully esterified products with long-chain alcohols. Building on those prompts, here are practical materials you
can access:
- Cellulose acetate phthalate (enteric coating polymer) — Convert phthalic monoacetate to the mixed anhydride by
treating with acetic anhydride (1.2 eq) and catalytic pyridine at 80 °C; strip excess anhydride to get a reactive
acylation mixture still containing the monoacetate. Add pre-activated cellulose acetate (DS≈1.7) in acetone and
raise to 50 °C while adding triethylamine as HCl scavenger; the phthalyl group installs at remaining hydroxyls,
giving cellulose acetate phthalate after neutralization and precipitation into water. Wash, dry, then mill for
tablet coating use.
- Di-2-ethylhexyl phthalate (DEHP) or other PVC plasticizer-grade diesters — Hydrolyze the monoacetate (50 % aq. NaOH,
80 °C) to revert the free phthalic acid half, re-esterify via acid chloride formation (SOCl₂, catalytic DMF, 70 °C)
to produce phthalyl chloride; react with 2-ethylhexanol (2.2 eq) and pyridine at 0–25 °C, then heat to 100 °C for
completion. Alternatively, run a direct Fischer esterification on the monoacetate with excess 2-ethylhexanol under
Dean–Stark to displace the terminal acetate and generate the diester; vacuum-strip and polish through a neutral
alumina bed to reach plasticizer purity.
- Alkyd/unsaturated polyester resins (coil coatings, wire enamels) — Use the monoacetate as a “half-ester” feed in an
alkyd cook: charge it with glycerol (or pentaerythritol) and fatty-acid-modified monoglycerides at 220 °C under N₂.
The monoacetate first cleaves to phthalic acid in situ, then esterifies to form the phthalate-rich segments that
lend hardness and gloss. Apply vacuum toward the end to pull off acetic acid and drive polycondensation to acid
value <15 mg KOH/g; the resulting resin dissolves in high-boiling esters for coating formulations.
- Specialty imide monomers (e.g., phthalic-imide curing agents) — Convert monoacetate to phthalic anhydride via
vacuum pyrolysis (180 °C, 20 mmHg) or acetic anhydride reflux with catalytic ZnCl₂; react with ammonia or amines
(e.g., 4,4′-diaminodiphenyl ether) in glacial acetic acid at 120 °C to form amic acids, then dehydrate with acetic
anhydride to imide monomers used in high-Tg polyimides.
Each route leverages the monoacetate either as a latent anhydride (for polymer acylations) or as a controllable half-
ester that can be selectively converted to acid chlorides/diesters, aligning with the MCP guidance on using it as a
modular intermediate.案例3
我有一个包含多个 SMILES 的列表:['CC(=O)Oc1ccccc1C(=O)O', 'CN1C=NC2=C1C(=O)N(C(=O)N2C)C']。请帮我计算这些分子的 LogP 和分子量,并筛选出符合里宾斯基五规则(Lipinski's Rule of 5)的分子,最后输出符合条件的分子列表。• Results
- CC(=O)Oc1ccccc1C(=O)O: MW 180.16, LogP 1.31, HBD 1, HBA 3 → Lipinski-compliant
- CN1C=NC2=C1C(=O)N(C(=O)N2C)C: MW 194.19, LogP −1.03, HBD 0, HBA 6 → Lipinski-compliant
Lipinski-passing SMILES list: ['CC(=O)Oc1ccccc1C(=O)O', 'CN1C=NC2=C1C(=O)N(C(=O)N2C)C']. Let me know if you have more molecules to screen or need a tabular export.案例4
请在数据库中检索二氧化钛(TiO2)的晶体结构信息,提取最稳定的构型,并使用通用力场对其几何结构进行初步优化。• - Pulled TiO₂ rutile (P42/mnm) from the Crystallography Open Database (COD 9004141) because it is the thermodynamic ground-state polymorph at ambient conditions; the
CIF lists a = b = 4.593 Å, c = 2.959 Å, Z = 2, matching the Meagher & Lager 1979 refinement (data/tiO2_rutile_cod9004141.cif:32-44).
- Converted the COD entry to an explicit 6-atom conventional cell and saved both output/rutile_tio2_initial_ase.cif and output/rutile_tio2_initial_ase.xyz for reuse
downstream.
- Performed a Universal Force Field relaxation via Open Babel’s OBForceField (500 CG steps, 1e‑6 tolerance). The optimized coordinates are in output/
rutile_tio2_uff_opt.xyz (output/rutile_tio2_uff_opt.xyz:2-8), and the UFF energy / force diagnostics are captured in output/rutile_tio2_uff_summary.json (energy
−0.217 kcal mol⁻¹, max residual force 0.43 kcal mol⁻¹ Å⁻¹; see output/rutile_tio2_uff_summary.json:1-27). This is a reasonable pre-optimization but still far from
a converged solid-state relaxation because UFF lacks proper ionic/periodic physics.
Next steps (optional):
1. Use a solid-state method (DFT, GULP with Buckingham potentials, etc.) to relax both lattice vectors and positions starting from output/rutile_tio2_uff_opt.xyz.
2. Validate against experimental observables (lattice constants, Raman modes) to ensure the structure remains faithful once higher-level optimization is complete.案例5
请对目标分子布洛芬(Ibuprofen)执行逆合成分析,给出建议的合成前体和切断位点。• Ibuprofen Retrosynthesis
- Breakpoint 1 (carboxylate install): Disconnect the propionic acid side chain from the aromatic ring to give 4-isobutylacetophenone (isobutylbenzene with para-
acylation). This ketone is the key intermediate for the classic Boots/Hoechst process; oxidative or hydrocyanation routes can extend the side chain and set the α-
methyl center before final hydrolysis.
- Breakpoint 2 (aromatic core): Further disconnect 4-isobutylacetophenone into isobutylbenzene and acetyl chloride (or equivalent acylating agent). Fragmentation via
Friedel–Crafts acylation introduces the acetyl group para to the isobutyl substituent.
- Alternative modern route (BHC process): Use isobutylbenzene → para-acylation to 4-isobutylacetophenone → catalytic hydrogenation to the corresponding
α-(isobutyl)ethylbenzene → carbonylation/hydroformylation to the propionic acid motif. This avoids stoichiometric cyanide and simplifies cleanup.
Suggested Precursors
1. Isobutylbenzene: accessible from isobutyl chloride + benzene via Friedel–Crafts alkylation or from isobutylbenzene commercial supply. Provides the aromatic
scaffold.
2. Acetyl chloride (or acetic anhydride): installs the acetyl unit para to the isobutyl group under Friedel–Crafts conditions, furnishing 4-isobutylacetophenone.
3. Oxidizing/chain-extension agent: either (a) hydrogen cyanide plus acid hydrolysis for the classic Ritter-type homologation, or (b) carbon monoxide/hydrogen
(hydroformylation) followed by oxidation in the BHC route.
These disconnections highlight the two strategic bond formations: (1) acylation to append the acetyl group on the aromatic ring, and (2) homologation/oxidation of
the acetyl group to the α-methyl carboxylic acid side chain to yield ibuprofen.案例6
将分子 Aspirin 对接到靶点蛋白 4COX,并给出结合亲和力评分。• Docking Result
- AutoDock Vina 1.2.7 docking (script output/docking/aspirin_4cox/run_vina.py:1) used chain A of 4COX (heme removed to allow rigid PDBQT generation) and a RDKit-
generated aspirin conformer; grid center was the crystallographic indomethacin centroid at 24.849, 22.295, 15.126 Å with a 18.4 × 16.7 × 20.5 Å box (output/
docking/aspirin_4cox/aspirin_docking_summary.txt:1).
- Best pose affinity: -6.819 kcal/mol, with the top cluster ranging from −6.8 to −6.3 kcal/mol (output/docking/aspirin_4cox/aspirin_docking_summary.txt:3, output/
docking/aspirin_4cox/aspirin_vina_energies.txt:2-9). All poses and detailed energy components are in output/docking/aspirin_4cox/aspirin_docked_poses.pdbqt
and .../aspirin_vina_energies.txt.
- Vina log (stdout from python3 output/docking/aspirin_4cox/run_vina.py) shows consistent RMSDs (~1.5–2.5 Å) indicating a stable binding mode in the COX active
channel.
Context & Caveats
- Receptor preparation kept only chain A and removed the heme cofactor to satisfy Open Babel’s rigid PDBQT writer; thus metalloprotein electrostatics are absent and
reported affinities likely underestimate true binding strength.
- Glycans and crystallographic waters were also removed; if these contacts are important, consider reintroducing key residues and converting with AutoDockTools/Meeko
for higher fidelity.
Next Steps
1. If you need heme present, rebuild the receptor with MGLTools/Meeko (supports cofactors) before rerunning run_vina.py.
2. Inspect aspirin_docked_poses.pdbqt in PyMOL/ChimeraX to verify hydrogen-bonding vs. the native indomethacin pose; adjust the grid or exhaustiveness if a different
pocket should be sampled.
3. For comparative scoring, repeat the workflow with known COX inhibitors to benchmark the −6.8 kcal/mol affinity estimate.