Example 1.4 — Turn a chemical name into a structure¶
A reproducible record of an AI-assisted BindingDB analysis: each prompt, the BindingDB tool calls that answered it with their recorded results, the answer, and its figures. Run all cells to show the recorded results, or rerun every call on your own copy of the database and check each result against the recorded one.
- Date: 2026-11-23
- Model: claude-opus-5-5
- Data: BindingDB release 202611 (
BDB-mySQL_All_202611_dmp.zip, SHA-256daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381) - Database build: 2026-11-21T01:08:15+00:00, DuckDB 1.5.6
- Derived data: standard InChIKeys computed from SMILES by RDKit 2026.03.6; compound_property computed from SMILES (largest fragment) by RDKit 2026.03.6
- Server: mcp-bindingdb v0.1.17, commit
79dae5d22c0f - Software: python 3.12.7, duckdb 1.5.6, rdkit 2026.03.6, mcp 2.3.0, gemmi 0.7.5
- Notebook generated: 2026-11-24T04:55:02Z
- Contents: 1 exchange · 3 tool calls
How to run¶
Keep the notebook in its folder, which holds everything it needs: requirements.txt (mcp-bindingdb at its commit and the versions of the packages it needs) and the recorded results in data/. With uv, from that folder (replace the path with yours):
cd /path/to/1.4-name-to-structure-notebook
uv run --no-project --with-requirements requirements.txt --with jupyterlab jupyter lab 1.4-name-to-structure-notebook.ipynb
then choose Run → Run All Cells. The first start installs the packages, which takes a minute or two; the cells show the recorded results, so no database is needed. Without uv: pip install -r requirements.txt jupyterlab, then jupyter lab 1.4-name-to-structure-notebook.ipynb in the folder.
How to rerun the calls¶
To rerun every BindingDB call on your own copy of release 202611 and check each result against the recorded one, set RERUN = True in the setup cell and run all cells, or rerun the notebook without opening Jupyter, writing a copy with the new results:
cd /path/to/1.4-name-to-structure-notebook
BINDINGDB_RERUN=1 uv run --no-project --with-requirements requirements.txt --with nbconvert jupyter nbconvert --to notebook --execute --output 1.4-name-to-structure-notebook-rerun.ipynb 1.4-name-to-structure-notebook.ipynb
A rerun needs the database: the one BINDINGDB_DUCKDB=/path/to/bindingdb_202611.duckdb names (put it before uv run), else the newest one mcp-bindingdb built on this computer, for example for Claude Desktop. With neither, the first rerun builds one, which takes about half an hour and 2.4 GB. To build exactly release 202611, with a clone of mcp-bindingdb:
git clone https://github.com/sbl-sdsc/mcp-bindingdb.git
cd mcp-bindingdb
git checkout 79dae5d22c0f15b8ded9b49adc8b105f0463703a
scripts/build_duckdb.sh --release 202611
The setup cell checks the database's release and source checksum against the recorded ones.
Run as it is, each call cell shows its recorded result, read from data/ and checked against the SHA-256 digest recorded in the cell. Rerun, it shows the new result with ✅ when it matches the recorded one (floats to 10 significant digits, ids of viewers and files left out). Calls to PubChem, RCSB or PDBe depend on those services and may differ. The prose answers are the model's and are not recomputed.
# Shows the results recorded during the session (data/), so the notebook runs without a database. Set
# RERUN = True (or start Jupyter with BINDINGDB_RERUN=1) to rerun every BindingDB call on a local copy of
# the database instead and check it against its recorded result: see 'How to rerun the calls' above.
from mcp_bindingdb.notebook import Replay
RERUN = False
replay = Replay(release='202611', source_zip_sha256='daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381', rerun=RERUN)
Recorded with BindingDB release 202611, mcp-bindingdb v0.1.17 (commit 79dae5d22c0f) python 3.12.7, duckdb 1.5.6, rdkit 2026.03.6, mcp 2.3.0, gemmi 0.7.5
Exchange 1¶
👤 User
Give me the SMILES and the BindingDB record for three compounds I only know by name: the trade name Ibrance, the IUPAC name N-(3-chloro-4-fluorophenyl)-7-methoxy-6-(3-morpholin-4-ylpropoxy)quinazolin-4-amine, and the CAS number 50-78-2.
Call 1 · chemical_name_to_smiles · ran 2026-11-24 04:54:59 UTC (3 lines)
# Call 1 · chemical_name_to_smiles · ran 2026-11-24 04:54:59 UTC
await replay.call(1, 'chemical_name_to_smiles', {'name': 'Ibrance'},
sha256='02f66e7700eda9fba253b23d20e7d3a2439bd380a344e1853e432f1cce7e7213')
Call 1 · chemical_name_to_smiles · recorded result · sha256 02f66e7700ed… · uses PubChem, whose answers can change
| name | smiles |
|---|---|
| Ibrance | CC1=C(C(=O)N(c2c1cnc(n2)Nc3ccc(cn3)N4CCNCC4)C5CCCC5)C(=O)C |
{
"query": "Ibrance",
"resolved": true,
"source": "bindingdb",
"smiles": "CC1=C(C(=O)N(c2c1cnc(n2)Nc3ccc(cn3)N4CCNCC4)C5CCCC5)C(=O)C",
"inchi_key": "AHJRHEGDXFFMBM-UHFFFAOYSA-N",
"monomerid": 6309,
"ambiguous": false
}
candidates: 1 row
| monomerid | bdbm_id | name | inchi_key | smiles | n_activities |
|---|---|---|---|---|---|
| 6309 | BDBM6309 | Ibrance | AHJRHEGDXFFMBM-UHFFFAOYSA-N | CC1=C(C(=O)N(c2c1cnc(n2)Nc3ccc(cn3)N4CCNCC4)C5CCCC5)C(=O)C | 154 |
sources_tried: 1 row
| source | status |
|---|---|
| bindingdb | found |
Call 2 · chemical_name_to_smiles · ran 2026-11-24 04:55:01 UTC (6 lines)
# Call 2 · chemical_name_to_smiles · ran 2026-11-24 04:55:01 UTC
arguments = {
'name': 'N-(3-chloro-4-fluorophenyl)-7-methoxy-6-(3-morpholin-4-ylpropoxy)quinazolin-4-amine',
}
await replay.call(2, 'chemical_name_to_smiles', arguments,
sha256='b423ce729c6f0acea572bdf5aad93798c20a063916dce360bc27b7a510905495')
Call 2 · chemical_name_to_smiles · recorded result · sha256 b423ce729c6f… · uses PubChem, whose answers can change
| name | smiles |
|---|---|
| N-(3-chloro-4-fluorophenyl)-7-methoxy-6-(3-morpholin-4-ylpropoxy)quinazolin-4-amine | COc1cc2ncnc(Nc3ccc(F)c(Cl)c3)c2cc1OCCCN1CCOCC1 |
{
"query": "N-(3-chloro-4-fluorophenyl)-7-methoxy-6-(3-morpholin-4-ylpropoxy)quinazolin-4-amine",
"resolved": true,
"source": "opsin",
"smiles": "COc1cc2ncnc(Nc3ccc(F)c(Cl)c3)c2cc1OCCCN1CCOCC1",
"inchi_key": "XGALLCVXEZPNRQ-UHFFFAOYSA-N"
}
bindingdb_matches: 3 rows
| monomerid | bdbm_id | name | inchi_key | smiles | n_activities | exact_match |
|---|---|---|---|---|---|---|
| 5447 | BDBM5447 | Iressa | XGALLCVXEZPNRQ-UHFFFAOYSA-N | COc1cc2c(cc1OCCCN3CCOCC3)c(ncn2)Nc4ccc(c(c4)Cl)F | 1177 | True |
| 50338602 | BDBM50338602 | Iressa | XGALLCVXEZPNRQ-UHFFFAOYSA-N | COc1cc2c(cc1OCCCN3CCOCC3)c(ncn2)Nc4ccc(c(c4)Cl)F | 6 | True |
| 32367 | BDBM32367 | GEFITINIB | XGALLCVXEZPNRQ-UHFFFAOYSA-N | COc1cc2c(cc1OCCCN3CCOCC3)c(ncn2)Nc4ccc(c(c4)Cl)F | 0 | True |
sources_tried: 2 rows
| source | status |
|---|---|
| bindingdb | not found |
| opsin | found |
Call 3 · chemical_name_to_smiles · ran 2026-11-24 04:55:02 UTC (3 lines)
# Call 3 · chemical_name_to_smiles · ran 2026-11-24 04:55:02 UTC
await replay.call(3, 'chemical_name_to_smiles', {'name': '50-78-2'},
sha256='b05c878809fe804433bcdfc60f32844dc5ee9e2905f790b8016725401797eede')
Call 3 · chemical_name_to_smiles · recorded result · sha256 b05c878809fe… · uses PubChem, whose answers can change
| name | smiles |
|---|---|
| 50-78-2 | CC(=O)Oc1ccccc1C(=O)O |
{
"query": "50-78-2",
"resolved": true,
"source": "pubchem",
"smiles": "CC(=O)Oc1ccccc1C(=O)O",
"inchi_key": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",
"pubchem_name": "Aspirin",
"pubchem_cid": 2244
}
bindingdb_matches: 1 row
| monomerid | bdbm_id | name | inchi_key | smiles | n_activities | exact_match |
|---|---|---|---|---|---|---|
| 22360 | BDBM22360 | Aspirin | BSYNRYMUTXBXSQ-UHFFFAOYSA-N | CC(=O)Oc1ccccc1C(=O)O | 137 | True |
sources_tried: 3 rows
| source | status |
|---|---|
| bindingdb | not found |
| opsin | not found |
| pubchem | found |
🧠 Assistant
All three names resolved to a structure, each through a different source:
| Name given | Resolved by | Compound | BindingDB record | Measurements | SMILES |
|---|---|---|---|---|---|
| Ibrance | BindingDB synonym | palbociclib | BDBM6309 | 154 | CC1=C(C(=O)N(c2c1cnc(n2)Nc3ccc(cn3)N4CCNCC4)C5CCCC5)C(=O)C |
| N-(3-chloro-4-fluorophenyl)-7-methoxy-6-(3-morpholin-4-ylpropoxy)quinazolin-4-amine | OPSIN (IUPAC name parser) | gefitinib | BDBM5447 | 1,177 | COc1cc2ncnc(Nc3ccc(F)c(Cl)c3)c2cc1OCCCN1CCOCC1 |
| 50-78-2 (CAS) | PubChem | aspirin | BDBM22360 | 137 | CC(=O)Oc1ccccc1C(=O)O |
How the lookup works. The tool tries three sources in order and stops at the first one that knows the name:
- BindingDB synonyms: trade names, common names, ChEMBL ids and patent labels already in the database. "Ibrance" is a BindingDB synonym of palbociclib, and only one compound carries it, so the answer is not ambiguous.
- OPSIN: a parser that turns systematic IUPAC names into structures. It runs offline and needs no database. BindingDB did not know the IUPAC string as written, but OPSIN built the structure from the name itself.
- PubChem: name lookup on the web, which also handles CAS numbers. Neither BindingDB nor OPSIN knew 50-78-2; PubChem resolved it to aspirin (PubChem CID 2244).
When a structure comes from OPSIN or PubChem, the tool matches it back to BindingDB by InChIKey. For gefitinib it found three records with the same full InChIKey (XGALLCVXEZPNRQ-UHFFFAOYSA-N): BDBM5447 ("Iressa", 1,177 measurements), BDBM50338602 (also "Iressa", 6 measurements) and BDBM32367 ("GEFITINIB", no measurements). Use the record with the data. Aspirin has a single record, BDBM22360, with 137 measurements. Note that each record's preferred name is often a brand name ("Ibrance", "Iressa"), which shows why matching by structure is more reliable than matching by name.
The lesson: resolve names to structures first. Most of the powerful searches (similarity, substructure, exact structure) take a SMILES string, not a name. Converting a name to a SMILES string is usually the first step of a structure-based analysis. Watch for one pitfall: a generic label such as "compound 5" can belong to many BindingDB compounds from different papers. The tool then returns all candidates and sets ambiguous=true, and you should pick one by checking the structures.
How this was answered
chemical_name_to_smilesthree times, once per name, with the default source order (BindingDB, then OPSIN, then PubChem). Each reply lists the sources it tried and what each one returned.
Try next
- "Find close analogues of imatinib that bind below 100 nM." — using a SMILES for a similarity search (Example 2.2)
- "Start from sildenafil and find which other targets its analogues hit." (Example 5.1)
Verification¶
How each rerun call compared with its recorded result.
replay.summary()
Recorded: 3 tool calls. Run all cells to compare.
How to cite¶
Cite this notebook (for example deposited with a DOI) together with the data and software it ran on:
- Data: BindingDB release 202611, https://www.bindingdb.org/rwd/bind/BDB-mySQL_All_202611_dmp.zip (SHA-256 daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381)
- Software: mcp-bindingdb v0.1.17, commit 79dae5d22c0f15b8ded9b49adc8b105f0463703a, https://github.com/sbl-sdsc/mcp-bindingdb
- Analysis: Example 1.4 — Turn a chemical name into a structure, 2026-11-23, with claude-opus-5-5
- BindingDB: Liu T, Hwang L, Burley SK, Nitsche CI, Southan C, Walters WP, Gilson MK. BindingDB in 2024: a FAIR knowledgebase of protein-small molecule binding data. Nucleic Acids Research 53(D1):D1633-D1644, 2025. https://doi.org/10.1093/nar/gkae1075
As BibTeX, for this server, BindingDB and RDKit (used for structure search, properties and drawings):
@software{rose2026mcp-bindingdb,
title={MCP BindingDB Server},
author={Rose, P.W.},
year={2026},
url={https://github.com/sbl-sdsc/mcp-bindingdb}
}
@article{liu2025bindingdb,
title={BindingDB in 2024: a FAIR knowledgebase of protein-small molecule binding data},
author={Liu, T. and Hwang, L. and Burley, S.K. and Nitsche, C.I. and Southan, C. and Walters, W.P. and Gilson, M.K.},
journal={Nucleic Acids Research},
volume={53},
number={D1},
pages={D1633--D1644},
year={2025},
doi={10.1093/nar/gkae1075}
}
@software{rdkit,
title={RDKit: Open-source cheminformatics},
author={Landrum, G. and others},
version={2026.03.6},
url={https://www.rdkit.org},
doi={10.5281/zenodo.591637}
}