Task tutorial

Resolve a compound name to SMILES with local MCP

Send one chemical name from a local MCP process to PubChem, then retain the returned isomeric SMILES with its source.

You will make

A recorded PubChem-backed SMILES lookup for aspirin before local structure analysis.

Steps

  1. Start the local MCP server from the source checkout.
  2. Send the legacy JSON-RPC request below with a compound name.
  3. Confirm the source and returned SMILES, then pass that exact string to a local parse or property tool.
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":"name_to_smiles","arguments":{"name":"aspirin"}}}' \
  | cargo run -p chematic-mcp --release --quiet

Expected result

The response identifies the input name, returns PubChem as the source, and returns CC(=O)OC1=CC=CC=C1C(=O)O for aspirin.

If it does not work

name_to_smiles is the one MCP tool that makes a network call: the name is sent to PubChem and the request has a 10-second timeout. A returned SMILES is a lookup result, not proof of identity, safety, availability, or experimental validity.

Next action

Read the local MCP integration guide