Task tutorial
Canonicalize SMILES before matching local records
Send one SMILES to the local MCP process and retain chematic's canonical representation beside the original input.
You will make
A versioned local record containing input SMILES and the canonical form returned by chematic.
Steps
- Start the local MCP server from the source checkout.
- Send the canonical_smiles JSON-RPC request below.
- Store the input, returned canonical field, and chematic version together before comparing records.
git clone https://github.com/kent-tokyo/chematic.git
cd chematic
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' \
'{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"canonical_smiles","arguments":{"smiles":"C1=CC=CC=C1"}}}' \
| cargo run -p chematic-mcp --release --quietExpected result
The response has a canonical field containing a valid SMILES representation. The checked C1=CC=CC=C1 example returns a canonical string without sending the molecule to a network service.
If it does not work
Canonical SMILES is a representation from a particular library and version, not a universal chemical identifier or proof that two records are equivalent. Preserve stereochemistry, salts, and the original input; do not compare strings from different tools or releases without validating that workflow.