ypotheto-compchem-mcp
Enables natural language interaction with computational chemistry tools including molecule building, electronic structure calculations, geometry optimization, vibrational spectroscopy, and molecular dynamics, powered by RDKit, PySCF, and ASE.
README
Ypotheto Computational Chemistry MCP Server (ypotheto-compchem-mcp)
An MCP (Model Context Protocol) server that provides natural language interfaces and AI assistants with access to computational chemistry, cheminformatics, and molecular modeling tools.
Powered by RDKit, PySCF, and the Atomic Simulation Environment (ASE).
Features
- Molecule Builder: Convert SMILES strings to 3D optimized geometries (MMFF94 or UFF) and render 2D layout diagrams (SVG).
- Cheminformatics: Calculate molecular descriptors (Molecular Weight, LogP, TPSA, Rotatable Bonds) and evaluate compliance with Lipinski's Rule of Five.
- Electronic Structure Theory: Run Hartree-Fock (HF) and Density Functional Theory (DFT) single-point calculations using PySCF. Retrieve total energies, dipole moments, HOMO/LUMO band gaps, and Mulliken atomic charges.
- Geometry Optimization: Relax molecular structures to energy minima using ASE's LBFGS optimizer coupled with PySCF or RDKit force fields.
- Vibrational Spectroscopy: Run harmonic vibrational analysis to determine normal modes, frequencies, Zero-Point Energy (ZPE), and thermochemical corrections (Enthalpy, Entropy, Gibbs energy). Simulates IR intensities and generates Lorentzian line-broadened IR spectra plots.
- Molecular Dynamics (MD): Propagate NVE (VelocityVerlet) or NVT (Langevin) trajectories. Saves multi-frame XYZ files and renders energy/temperature conservation plots.
- Asynchronous Job Manager: Long-running calculations (like DFT optimizations or dynamics) run in background threads with progress updates, avoiding client timeouts.
- File-First Artifacts: Visual outputs (plots, diagrams) and heavy coordinate files (SDF, XYZ, PDB) are written to a local data directory and returned as public URLs instead of bloating the LLM's chat context.
Local Development & Setup
This project uses uv for lightning-fast virtualenv and dependency management.
1. Prerequisites
- Python
>= 3.11 - Windows, macOS, or Linux.
- Note: PySCF requires C compilation libraries. If running natively on Windows without WSL/Conda, PySCF tools will automatically report as unavailable, but the RDKit builder, descriptors, and forcefield-based optimizations/dynamics/vibrations will still run perfectly.
2. Install Dependencies
# Clone the repository
git clone <repo-url>
cd compchem-mcp
# Create a virtual environment and install in editable mode
uv venv
uv pip install -e .
# (Optional) Install pytest to run tests
uv pip install pytest
3. Run the Tests
.\.venv\Scripts\python.exe -m pytest
4. Run the Server
The server supports two transport mechanisms: STDIO (default) for desktop client plugins and HTTP (SSE/Streamable HTTP) for hosted web apps.
# Start STDIO mode
.\.venv\Scripts\python.exe -m ypotheto_compchem_mcp --transport stdio
# Start HTTP mode
.\.venv\Scripts\python.exe -m ypotheto_compchem_mcp --transport http --port 8348
Running in Docker
To run full PySCF quantum calculations natively on Windows or deploy to DigitalOcean, compile and run inside Docker:
# Build the Docker image
docker build -t ypotheto-compchem-mcp .
# Run the container (binds workspace data to a local directory)
docker run -p 8348:8348 -v C:/data/compchem:/data ypotheto-compchem-mcp
Client Integration Configuration
1. Claude Desktop (STDIO)
To register the server directly with Claude Desktop, add it to your claude_desktop_config.json configuration file:
{
"mcpServers": {
"ypotheto-compchem": {
"command": "python",
"args": [
"-m",
"ypotheto_compchem_mcp",
"--transport",
"stdio"
],
"env": {
"COMPCHEM_DATA_DIR": "C:/Users/<your-user>/.compchem-mcp"
}
}
}
}
2. ypotheto-core / SSE Web Client
To connect a remote client over streamable HTTP with Bearer token authentication:
- Start the server:
COMPCHEM_API_TOKEN="secret_api_token" python -m ypotheto_compchem_mcp --transport http --port 8348 - Configure your client (e.g.
StreamableHttpMcpClient) to connect to:- URL:
http://localhost:8348/mcp - Headers:
Authorization: Bearer secret_api_token
- URL:
Environment Variables
| Variable | Description | Default |
|---|---|---|
COMPCHEM_API_TOKEN |
Bearer token required for authentication | "" (Disabled) |
COMPCHEM_DATA_DIR |
Directory on disk to store molecule structures and artifacts | ~/.compchem-mcp |
COMPCHEM_PORT |
Port to run the HTTP/SSE server | 8348 |
COMPCHEM_PUBLIC_BASE_URL |
Base URL used to prefix artifact download links | http://localhost:8348 |
Tool Catalog Overview
| Tool Name | Parameters | Description |
|---|---|---|
ping |
None | Verify server connectivity. |
build_molecule_from_smiles |
smiles, name |
Create a 3D model and 2D diagram from SMILES. |
get_3d_coordinates |
molecule_id, format |
Export XYZ or SDF molecular coordinates. |
calculate_descriptors |
molecule_id |
Compute MW, LogP, TPSA, and Lipinski filter. |
estimate_calculation_time |
molecule_id, method, basis |
Estimate duration of a calculation. |
run_single_point |
molecule_id, method, functional, basis, charge, spin, run_async |
Run DFT/HF energy, HOMO/LUMO, dipole moments, and atomic charges. |
optimize_geometry |
molecule_id, method, functional, basis, charge, spin, max_steps, run_async |
Relax molecular coordinates. |
calculate_vibrations |
molecule_id, method, functional, basis, charge, spin, run_async |
Run frequency analysis and thermochemical corrections. |
simulate_ir_spectrum |
molecule_id, method, functional, basis, charge, spin, run_async |
Simulates vibrational IR spectrum plot. |
run_molecular_dynamics |
molecule_id, steps, time_step_fs, temperature_k, ensemble, calculator_type, run_async |
Run Langevin or Verlet molecular dynamics. |
get_job_status |
job_id |
Poll background calculation status and get results. |
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。