cdk_pywrapper
A Python wrapper for the Chemistry Development Kit (CDK)
claude mcp add --transport stdio sebotic-cdk_pywrapper uv tool run --from cdk-pywrapper cdk_pywrapper-mcp-server
How to use
The cdk_pywrapper MCP server exposes the Python wrapper around the Chemistry Development Kit (CDK) via a tool-enabled MCP server. It integrates with UNII, ChEMBL, and Guide to Pharmacology data and requires an LLM capable of tool use. With this server, you can search for compounds by name, retrieve SMILES strings, convert between SMILES, InChI, and InChIKey, compute basic properties (such as molecular mass), and generate a visual SVG of a compound structure. The server leverages the cdk_pywrapper package to perform cheminformatics operations through a Python layer that interacts with the CDK Java jar behind the scenes. To use it in your MCP configuration, reference the server in your LLM’s tool setup so that the model can invoke chemical queries and conversions as needed.
Typical capabilities include: searching for a compound by name to obtain identifiers and synonyms, converting SMILES to InChI or InChIKey, retrieving the common/structured name for a given structure, calculating basic properties like molecular mass, and creating an SVG depiction of the molecule for visualization within prompts or responses.
How to install
Prerequisites:
- Java JDK (OpenJDK recommended) installed on your system
- Python 3.x environment
- uv package manager installed (see uv docs)
Install and run locally:
- Prepare a Python virtual environment and install the package from the repository:
# Create Python virtual environment named 'cdk_pywrapper'
p python3 -m venv ./cdk_pywrapper
source ./cdk_pywrapper/bin/activate
# Clone repository from GitHub
git clone https://github.com/sebotic/cdk_pywrapper.git
cd cdk_pywrapper
# Install into created venv
pip install .
- Install and configure the MCP server with uv as shown in the README and start using the tool installation approach described there. For MCP usage, install uv and then run the server as a tool:
uv tool install . --force-reinstall
- Ensure your LLM MCP configuration includes the cdk_pywrapper-mcp-server entry (see the example in the README) so the model can invoke the server’s capabilities.
If you prefer containerized or alternative runtimes, adapt the commands to your environment accordingly, but ensure Java, Python, and uv are available and the package dependencies are satisfied.
Additional notes
Tips and notes:
- The MCP server relies on the CDK Java components; ensure Java is installed and accessible in the environment running the server.
- The Python wrapper automatically downloads the CDK.jar during installation; ensure your network access allows JAR downloads.
- When integrating with an LLM, consider exposing search-by-name, structure-based queries, and conversion tools as separate commands to improve prompt reliability.
- If you encounter tool invocation errors, verify the uv tool installation and that the server name in your MCP config matches the registered tool.
- Environment variables can be used to configure API keys or data source endpoints (ChemBL, UNII, etc.); populate the env map in the mcp_config accordingly.
Related MCP Servers
mcp-neo4j
Neo4j Labs Model Context Protocol servers
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.
pydantic-rpc
PydanticRPC is a Python library for rapidly exposing Pydantic models as gRPC, ConnectRPC, and MCP services without protobuf files.
python
🔐 Plug-and-play auth for Python MCP servers.
sympy
A MCP server for symbolic manipulation of mathematical expressions
rdkit
MCP server that enables language models to interact with RDKit through natural language