{"id":"16148175-3e6e-4f20-94f7-c65e0ccac6d2","slug":"cdk-pywrapper","kind":"mcp","name":"cdk-pywrapper","summary":"A Python wrapper for the Chemistry Development Kit (CDK)","owner":"sebotic","repoUrl":"https://github.com/sebotic/cdk_pywrapper","license":"AGPL-3.0","licenseTier":"strong-copyleft","trust":"community","stars":38,"match":null,"fewStars":false,"format":"mcp","createdAt":"2016-08-26T09:23:39.000Z","addedAt":"2026-10-14T03:47:07.696Z","logoUrl":"https://avatars.githubusercontent.com/u/7053730?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["cloud-infra"],"tags":["chemistry","inchi","cdk","python-wrapper","chemistry-development-kit","python3","python"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-15T03:22:49.241Z","sample":false,"url":"https://conduits.dev/tools/cdk-pywrapper","language":"Python","transports":["stdio"],"install":{"pypi":"cdk_pywrapper"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"## Python Wrapper for the Chemistry Development kit\n\n### tl;dr\n* A Python wrapper for the Chemistry Development Kit (CDK), which is written in Java\n* Primary purpose: \n  * Generate diverse chemical compound identifiers (SMILES, InChI).\n  * Inter-convert between these identifiers.\n  * Integration with chem\n* Fully compatible with Python 3.x.\n\n### Motivation\nCheminformatics only has a small number of open source tools, e.g. [OpenBabel](http://openbabel.org), the \n[Chemistry Development Kit](https://github.com/cdk) and [RDKit](https://www.rdkit.org/).\n\nEvery framework has its pros and cons, e.g. OpenBabel has issues with InChI generation from SMILES.\n\nCDK lacks the ability to be used with Python, while Python has become the indispensable programming language for data science, also in cheminformatics and computational biology.\n\nAlso, all three frameworks lack integration with databases.\n\n### Installation\n\nBefore installing cdk_pywrapper, make sure to have a Java JDK available on your system, e.g. [OpenJDK](https://openjdk.org/).\n\nThen, you can install from the repository directly.\n\n```bash\n# Create Python virtual environment named 'cdk_pywrapper'\npython3 -m venv ./cdk_pywrapper\nsource ./cdk_pywrapper/bin/activate\n\n# Clone repository from GitHub\ngit clone https://github.com/sebotic/cdk_pywrapper.git\ncd cdk_pywrapper\n\n# Install into created venv\npip install .\n\n```\n\nThis will install the package on your local system. Setuptools will take care of downloading the CDK.jar and it will build the cdk_bridge.java.\nSo after that, cdk_pywrapper should be ready to use, like in the example below.\n\ncdk_pywrapper was tested on Linux and MacOS, but it should also work on Windows.\n\n### Example\n\n```python\nfrom cdk_pywrapper.cdk_pywrapper import Compound\n\nsmiles = 'CCN1C2=CC=CC=C2SC1=CC=CC=CC3=[N+](C4=CC=CC=C4S3)CC.[I-]'\ncmpnd = Compound(compound_string=smiles, identifier_type='smiles')\nikey = cmpnd.get_inchi_key()\nprint(ikey)\n\n```\nOutput: 'MNQDKWZEUULFPX-UHFFFAOYSA-M'\n\n\n## MCP server\nI also added a MCP server now which makes use of the functions of cdk_pywrapper and also integrates with UNII, Chembl and Guide to Pharmacology data.\n\nIt requires a LLM capable of tool use.\n\nKey features:\n* Allows a LLM to search for a compound by name.\n* Allows a LLM to get the corresponding SMILES string.\n* Allows a LLM to get the name associated with a structure (SMILES or InChI, will lookup Chembl).\n* Allows for convertions between SMILES and InChI and also InChI key.\n* Allows for calculation of basic compound properties (e.g. molecular mass).\n* Allows for creation of an SVG of the compound structure.\n\n### Installation of the MCP\nMost conveniently, one would install it locally as a tool, using the [uv package manager](https://docs.astral.sh/uv/).\nInstall uv first, according to it's instructions, then run from the repo root:\n\n```bash\nuv tool install . --force-reinstall\n```\n\nFor using the MCP server, add this configuration to your respective LLM MCP configuration.\n```json\n  \"cdk_pywrapper-mcp-server\": {\n    \"command\": \"uv\",\n    \"args\": [\n      \"tool\",\n      \"run\",\n      \"--from\",\n      \"cdk-pywrapper\",\n      \"cdk_pywrapper-mcp-server\"\n    ],\n    \"env\": {}\n  }\n```\n\n### Example prompts for using the MCP tools:\n\n## Example 1:\n```\nSearch for structure of compound vemurafenib.\n```\nWill return SMILES, InchI and Inchi key for vemurafenib.\n\n## Example 2:\n```\nGet details for compound vemurafenib.\n```\nWill return synonyms and compound structure.\n\n## Example 3:\n\n```\nGet inchi for CCOH\n```\nWill return the InChI for Ethanol, which is InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3\n\nThis conversion works for any valid SMILES string and can also return the InChI key.\n\n## Example 4:\n\n```\nGet the compound names for this smiles CC1=CN=C(C(=C1OC)C)CS(=O)C2=NC3=C(N2)C=C(C=C3)OC\n```\nThat should return [Omeprazole](https://www.wikidata.org/wiki/Q422210). Use a modern thinking model like Google Gemini 2.5. Gemini will figure out on its own that it first needs to convert the SMILES to an InChI key and then use the Chembl tool to get the name. \n"}