MCP for AI Agents
Hanzi Stroke Order MCP Server
The MCP server wraps the REST API so AI agents can call tools instead of parsing webpages.
Available Tools
- get_hanzi_writing: returns pinyin, radical, stroke count, stroke names, writing advice, and common words for one character.
- get_phrase_writing: returns writing data for each character in a Chinese word or short phrase.
- get_hanzi_stroke_data: returns Hanzi Writer compatible SVG stroke path data.
Recommended Agent Use
- Call get_hanzi_writing when a learner asks how to write a single Chinese character.
- Call get_phrase_writing when a learner enters a word such as 学习.
- Call get_hanzi_stroke_data only when the agent needs to render an animation or generate visual stroke-order output.
Configuration
- The MCP server defaults to the production API at https://wr.practice-hanzi.uk.
- Set HANZI_API_BASE_URL to point agents at a local or private deployment.
Examples
npm run mcp
HANZI_API_BASE_URL=https://wr.practice-hanzi.uk npm run mcp
HANZI_API_BASE_URL=http://localhost:8788 npm run mcp