Skip to main content
Glama

logisim271-mcp

MCP server that builds and verifies circuits as Logisim 2.7.1 .circ files (classic Carl Burch Logisim, not Evolution). Simulation runs the real 2.7.1 via java -jar logisim-win-2.7.1.exe file.circ -tty table.

Tools

Group

Tools

File

create_circuit_file, list_circuits, add_circuit, delete_circuit, set_main_circuit, describe_circuit

Low level

add_pin, add_gate, add_component (flip-flops, register, counter, mux, adder/subtractor), add_constant, add_wire, add_subcircuit_instance, remove

High level

build_logic (expressions), build_preset (half/full/ripple adder, mux, decoder, comparator), build_from_truth_table (Quine-McCluskey)

Simulation

simulate, truth_table, verify_truth_table, simulate_sequential (clocked circuits, optional per-cycle input sequence)

High-level builders auto-place and auto-wire, then verify the full truth table in Logisim.

Related MCP server: Logisim-evolution MCP Server

2.7.1 facts this relies on (all measured, see tests/)

  • Gate loc = output point. Size 50 input offsets (east): 2 → ±20; 3 → -20,0,20; 4 → -20,-10,10,20; 5 → -20..20 step 10. Input x = loc − 50 (AND/OR), −60 (NAND/NOR, XOR), −70 (XNOR), −30 (NOT), −20 (Buffer).

  • Default inputs is 5; XOR default is "exactly one" → we write xor="odd" (parity).

  • -tty table settles once with input pins at 0 (pin values aren't saved), prints output pins sorted by (y, x), tab-separated, multi-bit as binary, x floating / E error, then never exits. We read one line and kill the JVM. To evaluate many rows in one run, the circuit is copied once per row with input pins replaced by Constants.

  • A wire end touching another wire mid-span connects; mid-span crossings don't.

  • tty mode does tick Clock components and prints a line each time an output changes. simulate_sequential replaces the clock pin with a Clock and adds a second Clock wired to a top-most output pin, so every half period yields one line (line 0 = power-on, line 2k-1 = after rising edge k). Non-clock inputs are held constant unless sequence is given: then each sequenced input pin becomes a Tunnel fed by a Multiplexer of Constants whose select comes from a Counter clocked on the falling edge, so step k is in place before rising edge k+1 (max 16 steps).

  • Large simulate/truth_table batches are split into runs of about 8000 components+wires (one huge run takes minutes to load) executed 4 at a time.

Library component ports (east-facing, offsets from loc)

Read from the 2.7.1 class files and checked in tests/test_components.py.

Component

Ports

D / T Flip-Flop

D or T (-40,20), clock (-40,0), Q (0,0), Qn (0,20), preset (-30,30), enable (-20,30), reset (-10,30)

J-K / S-R Flip-Flop

J or S (-40,0), K or R (-40,20), clock (-40,10), rest as D

Register

out (0,0), data (-30,0), enable (-30,10), clock (-20,20), clear (-10,20)

Counter

out (0,0), data (-30,0), load (-30,-10), count (-30,10), clock (-20,20), clear (-10,20), carry (0,10)

Multiplexer, 2 inputs

in0 (-30,-10), in1 (-30,10), select (-20,20)

Multiplexer, n = 4/8/16

in_i (-40, -n/2·10 + 10i), select (-20, n/2·10), out (0,0) — note the inputs are not centred

Adder / Subtractor

A (-40,-10), B (-40,10), out (0,0), carry/borrow in (-20,-20), out (-20,20)

Note the D flip-flop's clock is the upper input and D the lower one.

Hand-drawn schematics (logisim271_mcp.schematic)

For Python scripts that should produce a schematic a person could have drawn (real wires, junctions, signal rails, few tunnels) instead of a tunnel on every port. Sheet records the intended net of every wire and port, and check() recomputes connectivity with Logisim's own rules, reporting short, open, stray and unconnected with coordinates before the file is opened.

from logisim271_mcp.model import Project
from logisim271_mcp.schematic import Sheet

proj = Project()
s = Sheet(proj, "FULL_ADDER")
a = s.pin_in("A", (40, 100))
x = s.gate("XOR", (220, 120), ["A", "B"], "P")   # returns port points: in0, in1, out
s.wire("A", a, (100, 100), x["in0"])             # polyline, net name first
s.hvh("P", x["out"], (300, 140), 260)            # horizontal, vertical at x=260, horizontal
s.check()                                        # raises SchematicError on short / open

Other helpers: pin_out, const, part (library parts), inst (subcircuits), tunnel, hv / vh / vhv, shift(dx, dy). Splitters accept facing east / west / north / south.

Layout patterns and checker messages are in the Claude Code skill skills/logisim-hand-drawn/SKILL.md. Install it by copying the folder to ~/.claude/skills/.

Install (Claude Code)

Requirements: Java 8+, Python 3.10+, uv, and Logisim 2.7.1 (logisim-win-2.7.1.exe or logisim-generic-2.7.1.jar from SourceForge). Logisim is not bundled.

Option A: plugin (MCP server + skill in one step)

  1. Set the LOGISIM_JAR environment variable to your Logisim 2.7.1 exe/jar path (e.g. setx LOGISIM_JAR C:/path/to/logisim-win-2.7.1.exe on Windows), then restart your terminal.

  2. In Claude Code:

/plugin marketplace add JunghyunLee1122/logisim271-mcp
/plugin install logisim271@logisim271-mcp

Restart Claude Code. This installs the logisim271 MCP server and the logisim-hand-drawn skill.

Option B: MCP server only

claude mcp add logisim271 --env LOGISIM_JAR=C:/path/to/logisim-win-2.7.1.exe -- uvx --from git+https://github.com/JunghyunLee1122/logisim271-mcp logisim271-mcp

Option C: Codex CLI

Codex does not read .claude-plugin, so register the MCP server and the skill separately.

codex mcp add logisim271 --env LOGISIM_JAR=C:/path/to/logisim-win-2.7.1.exe -- uvx --from git+https://github.com/JunghyunLee1122/logisim271-mcp logisim271-mcp

Or add it to ~/.codex/config.toml:

[mcp_servers.logisim271]
command = "uvx"
args = ["--from", "git+https://github.com/JunghyunLee1122/logisim271-mcp", "logisim271-mcp"]
env = { LOGISIM_JAR = "C:/path/to/logisim-win-2.7.1.exe" }

Skill: copy skills/logisim-hand-drawn/ into ~/.codex/skills/ (some Codex versions use ~/.agents/skills/ instead), then start a new Codex session.

git clone https://github.com/JunghyunLee1122/logisim271-mcp.git
cp -r logisim271-mcp/skills/logisim-hand-drawn ~/.codex/skills/

Then ask e.g. "full adder 만들어줘" / "build a 4-bit ripple adder in adder.circ and verify it".

Development

py -3.13 -m venv .venv
.venv/Scripts/python.exe -m pip install -e ".[dev]"
LOGISIM_JAR=../logisim-win-2.7.1.exe .venv/Scripts/python.exe -m pytest

Env: LOGISIM_JAR (2.7.1 exe or jar), JAVA (java executable), LOGISIM_WORKDIR (base for relative paths).

Available Tools

21 tools
add_circuitC

Add a new empty circuit (sub-circuit) to the project.

Inputs: name (required), path (required).

add_componentA

Add a built-in library component (east-facing) and return its absolute ports.

kind: dff | tff | jkff | srff (flip-flops: D/T or J,K / S,R, clock, Q, Qn, async reset / preset / enable), register (data, clock, clear, enable, out), counter (clock, count, load, data, clear, out, carry), mux (in0.., select, out; select_bits 1..4), adder (A, B, carry_in, out, carry_out), subtractor (A, B, borrow_in, out, borrow_out). width applies to register/counter/mux/adder/ subtractor data. trigger (memory parts): rising | falling | high | low. ram: addr_bits x width RAM, separate ports (addr, data = read out, din, we = store on rising clock, clock, optional cs/oe/clear); load contents with ram_image in simulate_sequential or write_ram_image for the GUI. decoder: select -> out0.. out(2**select_bits - 1). splitter: combined (width bits) <-> split0.. with group sizes splits LSB first, e.g. [5, 3]. bit_extender: in (in_width) -> out (width), zero-extended. Optional ports (Qn, reset, preset, enable, carry...) may stay unconnected; note an unconnected counter count input counts every cycle.

Inputs: x (required), y (required), kind (required), path (required), +8 more.

add_constantC

Add a constant source (faces east; connect at its loc).

Inputs: x (required), y (required), path (required), value (required), +2 more.

add_gateB

Add AND/OR/NAND/NOR/XOR/XNOR (2-5 inputs), NOT or BUF.

(x, y) is the gate's OUTPUT point. Returns absolute port coordinates to wire to. XOR/XNOR use parity semantics (odd number of 1s). width > 1 = bitwise on buses.

Inputs: x (required), y (required), kind (required), path (required), +5 more.

add_pinB

Add an input pin (faces east, connect at its loc) or output pin (faces west).

Inputs: x (required), y (required), path (required), label (required), +3 more.

add_subcircuit_instanceA

Place an instance of another circuit of this project (east-facing, default appearance). Returns its ports keyed by the subcircuit's pin labels: input pins (facing east) on the west edge, output pins on the east edge, each top-to-bottom in the subcircuit's pin y order. Finish the subcircuit's pins before placing.

Inputs: x (required), y (required), path (required), subcircuit (required), +2 more.

add_wireB

Add a polyline wire through points [[x,y], ...]; each segment must be horizontal or vertical. An end landing on another wire joins it; crossings don't.

Inputs: path (required), points (required), circuit.

build_from_truth_tableC

Minimize (Quine-McCluskey) and build. outputs maps name -> minterm indices, where the FIRST input is the most significant bit. Optional dont_cares likewise.

Inputs: path (required), inputs (required), outputs (required), x, +4 more.

build_logicA

Synthesize boolean expressions into gates, pins and wires (auto layout).

outputs maps pin name -> expression. Syntax: NOT ~A !A A' ; AND A&B A*B A.B or 'A B'; XOR A^B ; OR A|B A+B ; constants 0 1 ; parentheses. Creates the file/circuit if missing, places below existing content unless x,y given, then (verify=true) runs the full truth table in Logisim 2.7.1 and compares with the expressions.

Inputs: path (required), inputs (required), outputs (required), x, +3 more.

build_presetB

Textbook circuits from gates: half_adder, full_adder, ripple_adder (bits 1..8, default 4), mux (select_bits 1..3, default 1; inputs D0.., S..), decoder (bits 1..3, default 2, optional EN), comparator (bits 1..4, default 2; outputs EQ GT LT). Circuit defaults to the preset name. Verified in Logisim after building.

Inputs: path (required), preset (required), x, y, +5 more.

create_circuit_fileC

Create an empty Logisim 2.7.1 project with one circuit.

Inputs: path (required), circuit, overwrite.

delete_circuitB

Delete a circuit. Refuses if it is main or used as a sub-circuit.

Inputs: name (required), path (required).

describe_circuitC

Components (with absolute port coordinates), wires and connection warnings.

Inputs: path (required), circuit.

list_circuitsB

List circuits in a .circ file with their input/output pins.

Inputs: path (required).

removeB

Remove the component with label or at (x, y). With wires_at=true remove every wire having an endpoint at (x, y) instead.

Inputs: path (required), x, y, label, +2 more.

set_main_circuitC

Choose which circuit opens first in Logisim.

Inputs: name (required), path (required).

simulateB

Run the circuit in Logisim 2.7.1 for one input assignment (inputs) or many (rows). Unlisted inputs are 0. Output values are ints; 'x' = floating, 'E' = error.

Inputs: path (required), rows, inputs, circuit.

simulate_sequentialA

Simulate a clocked (sequential) circuit in Logisim 2.7.1. The clock input pin (clock, auto-detected if labelled clk/clock) is driven by a free-running Clock; a Clock component already in the circuit also works. Other inputs are held at inputs (unlisted = 0). sequence (up to 16 steps) changes them per cycle: sequence[k] = inputs sampled at rising edge k+1, each step keeps earlier values it does not mention, and the last step stays in force. ram_image (words from address 0) is loaded into every RAM before the first edge. Returns power-on outputs and outputs after each rising edge (cycle 1..cycles).

Inputs: path (required), clock, cycles, inputs, +4 more.

truth_tableB

Full truth table (<=12 input bits) computed by Logisim 2.7.1. strict=true turns unconnected gate inputs into E so wiring bugs are visible.

Inputs: path (required), strict, circuit.

verify_truth_tableB

Check the circuit against expected rows [{"in": {...}, "out": {...}}, ...] and/or reference expressions {output: expr} (checked on every input row).

Inputs: path (required), circuit, expected, expressions.

write_ram_imageB

Write a Logisim memory image file (v2.0 raw, words from address 0) that the GUI loads via right-click on a RAM -> Load Image... (or logisim -tty ... -load file).

Inputs: path (required), words (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools target a clearly distinct action+resource: add_pin/add_gate/add_component/add_constant/add_wire/add_subcircuit_instance are separable, and the three build_* tools differ by input form (expressions, presets, truth table). The main overlap is in the simulation family — simulate, truth_table, simulate_sequential, and verify_truth_table share concepts, and build_logic vs build_from_truth_table could be misselected by an agent that doesn't read carefully.

    Naming Consistency4/5

    The dominant convention is verb_noun (create_circuit_file, list_circuits, add_gate, delete_circuit, write_ram_image), which is applied broadly across circuit, component, and simulation tools. Minor deviations exist: bare 'remove', bare 'simulate', and the noun-only 'truth_table', plus 'create_circuit_file' vs 'add_circuit' showing two different verbs for placing a circuit.

    Tool Count4/5

    21 tools is on the high side of the acceptable band, but the domain (layout editing, synthesis, and simulation of digital circuits) genuinely requires this breadth. Each tool covers a distinct capability, so little feels redundant, though a few simulation tools could conceivably be merged.

    Completeness4/5

    Coverage is strong: project creation, circuit lifecycle (add/list/delete/set_main), component placement and wire routing, removal, high-level builders, and multiple simulation/verification modes including sequential and RAM images. Gaps are minor — no tool to rename or edit existing component properties (e.g., change a gate's input count or relabel), and no explicit open/load of an external .circ path beyond what list/describe imply.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Local electronics tools for MCP-capable assistants, enabling static analysis of CRUMB save files and Logisim-evolution projects, including net tracing, BOM building, electrical rule checks, and optional truth table generation.
      22
      87 npm
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to build, wire, inspect and simulate digital circuits directly in a running Logisim Evolution window, with every edit appearing live and undoable. Agents work from exact ports, real netlists and truth tables rather than screenshots, and can verify designs through simulation.
      8
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to draw, simulate, and verify Logisim-evolution 5 circuits directly from natural-language descriptions, without opening the GUI — it lays out components, routes wires, and returns images of the resulting .circ files. It also synthesizes circuits from formulas or truth tables (minimizing to MDNF/MKNF and converting to NAND/NOR bases), detects wiring faults, and checks behavior against expected outputs or clock sequences.
      9
      2
      GPL 3.0