Skip to main content
Glama
mcp-fpga
by zesun33

@zesun33/mcp-fpga

Purpose and first steps

Synthesize and route FPGA designs and prepare bitstreams through an MCP server.

Who it is for: Hardware engineers using an MCP-capable client or coding agent.

First task: Configure the server in your MCP client, then call fpga_toolchain_info before running a design.

What to expect: Tool availability, then synthesis/place-and-route metrics and bitstream artifacts.

Current scope: Published MCP server for iCE40/ECP5 flows. Programming defaults to a dry run and requires an attached board for an actual hardware check. The npx command waits for an MCP client.

Start here: Runtime requirements and configuration.

Related projects: mcp-yosys, mcp-verilog.

Choose another project.

Model Context Protocol (MCP) server for FPGA synthesis, place-and-route, and bitstream programming (iCE40/ECP5).

License: Apache-2.0 CI Protocol: MCP Runtime: Rootless Podman

mcp-fpga gives AI coding agents and IDEs (Cursor, Windsurf, GitHub Copilot / OpenAI Codex, Claude Code, Google Antigravity, OpenCode, Cline) a complete open-source FPGA flow: Yosys synthesis to nextpnr JSON, nextpnr place-and-route with utilization/Fmax reports, bitstream packing (icepack/ecppack), and hardware programming via iceprog (iCE40) or openFPGALoader (ECP5). Board presets (iCEBreaker, HX8K, ULX3S-class, generic ECP5) resolve device/package details.

Hardware honesty: bitstream flashing needs a board on USB, which CI hosts cannot verify. fpga_program dry-runs by default and only reports the plan; set dry_run: false on a host with hardware attached. ECP5 .bit files use openFPGALoader in the FPGA image.

Related MCP server: fpga-mcp

Install and run

Run this MCP server directly from npm:

npx -y @zesun33/mcp-fpga

For the complete hardware-agent setup, use npx -y @zesun33/create-hw-agent my-asic.


⚡ Quick Tour: See It in Action

The examples below illustrate tool requests and result fields. Timings, counts, and scores depend on the input and runtime; they are not guaranteed outcomes or fresh verification results.

Example tool requests and results

1. Probing the Toolchain (Zero-Config Verification)

// Tool Call: fpga_toolchain_info
{
  "runtime": "podman",
  "image": "ghcr.io/zesun33/fpga",
  "versions": {
    "yosys": "Yosys 0.38+92",
    "nextpnr-ice40": "present",
    "nextpnr-ecp5": "present",
    "icepack": "present",
    "ecppack": "present",
    "iceprog": "present",
    "openFPGALoader": "present"
  }
}

2. Listing Board Presets

// Tool Call: fpga_boards
{
  "boards": [
    { "board": "icebreaker", "family": "ice40", "device": "up5k", "package": "sg48", "programmer": "iceprog" },
    { "board": "hx8k", "family": "ice40", "device": "hx8k", "package": "ct256", "programmer": "iceprog" }
  ]
}

3. iCEBreaker Flow: Synth, Place-and-Route, Bitstream

// Tool Call: fpga_synth {"verilog_sources": ["blink.v"], "top_module": "blink", "family": "ice40"}
// -> { "success": true, "jsonNetlist": "blink_ice40.json", "cellCount": 30 }
// Tool Call: fpga_place_route {"json_netlist": "blink_ice40.json", "top_module": "blink", "board": "icebreaker"}
// -> { "success": true, "device": "up5k", "utilization": { "ICESTORM_LC": { "used": 28 } }, "fmax": { "clk": { "achievedMhz": 194.3 } } }
// Tool Call: fpga_bitstream {"input_file": "blink_up5k.asc"}
// -> { "success": true, "bitstreamFile": "blink_up5k.bin", "bytes": 135100 }

4. Safe Programming Default (Dry Run)

// Tool Call: fpga_program {"bitstream_file": "blink_up5k.bin"}
{
  "success": true,
  "programmer": "iceprog",
  "flashed": false,
  "warnings": ["Dry run only: no hardware touched. Set dry_run=false on a host with the board attached."]
}

Tools Exposed

Tool

Parameters

Engine

Description

fpga_synth

verilog_sources: string[], top_module: string, family?: "ice40" | "ecp5", cwd?: string

synth_ice40 / synth_ecp5

RTL to nextpnr JSON netlist with cell/wire counts.

fpga_place_route

json_netlist: string, top_module?: string, family?: "ice40" | "ecp5", board?: string, device?: string, package?: string, cwd?: string

nextpnr-ice40 / nextpnr-ecp5

P&R with utilization and Fmax from --report JSON. Explicit device/package wins over presets.

fpga_bitstream

input_file: string, compress?: boolean, cwd?: string

icepack / ecppack

Routed image to bitstream (.asc→.bin, .config→.bit).

fpga_program

bitstream_file: string, dry_run?: boolean, cwd?: string

iceprog / openFPGALoader

iCE40 .bin via iceprog, ECP5 .bit via openFPGALoader; dry-run default, honest HW errors otherwise.

fpga_boards

none

Static presets

Board → device/package/programmer table.

fpga_toolchain_info

none

Probe

Versions of the FPGA toolchain, including openFPGALoader.


Execution Runtime

mcp-fpga runs inside the zesun33/fpga rootless Podman image so tools are identical on any Linux host.

Public install (recommended — anyone can pull):

podman pull ghcr.io/zesun33/fpga:latest
export MCP_FPGA_IMAGE=ghcr.io/zesun33/fpga

ghcr.io/zesun33/fpga is the default (anyone can pull). Local builds still work as localhost/zesun33/fpga via MCP_FPGA_IMAGE.

  • Container mount: -v <workspace>:/workspace:Z -w /workspace

  • Podman storage option: --storage-opt overlay.ignore_chown_errors=true

To force host binaries instead of container execution:

export MCP_FPGA_RUNTIME=host

Targets iCE40 / ECP5 toolchains shipped in zesun33/fpga.


Universal Client & AI IDE Setup

Because mcp-fpga implements the standard Model Context Protocol (MCP), it connects seamlessly to any MCP-compliant AI IDE or agent interface:

{
  "mcpServers": {
    "fpga": {
      "command": "node",
      "args": ["/path/to/mcp-fpga/dist/index.js"]
    }
  }
}
  • Cursor: Configure in .cursor/mcp.json.

  • Windsurf: Configure in ~/.codeium/windsurf/mcp_config.json.

  • GitHub Copilot / OpenAI Codex: Configure via Copilot MCP settings or Codex tool proxy.

  • Claude Code: Configure via claude mcp add fpga node /path/to/dist/index.js.

  • Google Antigravity: Load as workspace MCP server in antigravity.json.

  • OpenCode & Cline: Direct stdio JSON-RPC connection.


Verification & Testing

Run the full 6-gate verification suite:

# Full verification (with Podman FPGA synthesis and P&R)
./scripts/verify.sh

# Fast / CI verification (headless environments)
./scripts/verify.sh --quick

License

Apache-2.0 © 2026 Md Zesun Ahmed Mia

npm releases

See RELEASING.md for GitHub Actions dry runs and trusted publishing.

Available Tools

6 tools
fpga_bitstreamA

Packs a routed image to a bitstream: icepack (.asc to .bin) for iCE40, ecppack (optionally --compress) for ECP5. Feed the result into fpga_program.

Inputs: input_file (required), cwd, compress.

fpga_boardsA

Lists board presets (device, package, programmer) for place-and-route targeting. Use a preset name as fpga_place_route board input.

Inputs: no named parameters.

fpga_place_routeA

Runs nextpnr place-and-route for iCE40/ECP5 from a Yosys JSON netlist. Device and package resolve from an explicit pair or a board preset (explicit wins). Returns utilization and Fmax from the JSON report. Use fpga_boards to list presets.

Inputs: json_netlist (required), cwd, board, device, +3 more.

fpga_programA

Flashes an iCE40 bitstream via iceprog. Dry-run (default) only reports the planned command: real flashing needs board hardware this host cannot verify. ECP5 needs openFPGALoader, which is absent from the image.

Inputs: bitstream_file (required), cwd, dry_run.

fpga_synthA

Synthesizes RTL to a nextpnr-ready JSON netlist with Yosys (synth_ice40/synth_ecp5), returning cell and wire counts. First stage of the FPGA flow; feed jsonNetlist into fpga_place_route.

Inputs: top_module (required), verilog_sources (required), cwd, family.

fpga_toolchain_infoA

Returns active container/host runtime and versions of Yosys, nextpnr, icepack, ecppack, and iceprog.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a unique, clearly defined role in the FPGA workflow (synthesis, place-and-route, bitstream, programming, board listing, toolchain info). No overlap or ambiguity.

    Naming Consistency5/5

    All tools follow a consistent 'fpga_' prefix with descriptive verb/noun combinations. The pattern is uniform and predictable.

    Tool Count5/5

    Six tools cover the essential FPGA flow without redundancy or unnecessary additions. The count fits the domain scope well.

    Completeness4/5

    The tool set covers the core synthesis-to-programming pipeline and auxiliary info/board queries. Slightly missing advanced features like device status or configuration readback, but the main workflow is fully supported.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with a complete FPGA toolchain for HDL linting, simulation, synthesis, and place-and-route across various hardware targets. It features a GitHub-backed IP core registry that enables users to search for and import MIT-licensed cores directly through their chat interface.
      15
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to drive Xilinx Vivado, Intel Quartus, and Anlogic TangDynasty for FPGA development, including project creation, synthesis, implementation, timing closure, and hardware programming through natural language.
      31 PyPI
      8
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents such as Claude Code, Cursor, and Codex to drive a locally installed Xilinx Vivado across the full FPGA flow, from GUI, headless Tcl, or attached sessions through synthesis, implementation, timing and CDC analysis, waveform queries, and device programming. It exposes 32 curated tools plus evidence-driven workflow prompts that return structured timing/IO reports, Chinese-language CRITICAL WARNING diagnostics, and guarded bitstream generation.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents to safely drive a locally installed Xilinx Vivado FPGA flow, covering session control, synthesis, implementation, timing and CDC analysis, XDC constraints, IP inspection, waveform queries, and device programming with structured, evidence-based diagnostics.
      -