Note

Introducing the MCP Server

An HTTP MCP server now exposes the simulator's automata engine to AI assistants simulate machines, run conversions, and generate shareable canvas links over JSON RPC.

Overview

The simulator now ships with an HTTP MCP (Model Context Protocol) server, exposing the automata engine to AI assistants and other programmatic clients. Through a single JSON RPC 2.0 endpoint at POST /api/mcp, a model can simulate machines, convert between formalisms, and generate shareable canvas links without ever touching the UI.

What You Can Do

Simulate Automata

Six tools run input strings against the core machine types and report whether the input is accepted, along with the path taken:

  • simulate_fa — DFA / NFA
  • simulate_pda — pushdown automata
  • simulate_ndpa — nondeterministic pushdown automata
  • simulate_tm — Turing machines (single- and multi-tape)
  • simulate_mealy — Mealy machines
  • simulate_moore — Moore machines

Convert Between Formalisms

Three tools bridge the classic equivalences:

  • regex_to_nfa — compile a regular expression into an NFA
  • nfa_to_dfa — determinize an NFA via subset construction
  • fa_to_regex — extract a regular expression from a finite automaton

Inspect Machines

  • get_transition_table — the full transition table for an automaton
  • get_automata_info — states, alphabet, and structural metadata

Six build_*_link tools (build_fa_link, build_pda_link, build_ndpa_link, build_tm_link, build_mealy_link, build_moore_link) encode a complete workspace state into a URL fragment. Opening the link loads the machine straight onto the canvas, ready to edit and run.

How It Works

Everything is served over a standard JSON-RPC 2.0 interface, so any MCP-compatible client can list the available tools and call them by name. The generated links use the canvas #load= hash convention: a mount hook decodes the base64 payload, reconstructs the automaton, and renders it on load no server round trip required.

Why It Matters

The MCP server turns the simulator into a tool an assistant can use, not just describe. Ask a model to build an automaton for a language, and it can validate the construction, convert it, and hand you a link to the finished machine on the canvas.

← All notesOpen Simulator →
On this page
← All notes