fpgaZeroMCP
fpgaZeroMCP
オープンソースの Model Context Protocol サーバーです。AI アシスタントに完全な FPGA ツールチェーン(lint、シミュレーション、合成、配置配線、ビットストリームの書き込み、および GitHub をバックエンドにしたライブ IP コアレジストリ)を提供します。
AI にコアの検索、取り込み、HDL の lint、ディスク上の複数ファイルからなる VHDL/Verilog プロジェクトの合成、シミュレーションの実行、そしてボードへのビットストリームの書き込みまでを、チャットウィンドウから離れることなく実行させられます。
機能
多言語: Verilog、SystemVerilog、VHDL(ghdl-yosys-plugin 経由)
3 つの入力モード: インラインの
code文字列、複数ファイルのfilesdict、またはディスク上のproject_dirパスファイルリスト対応:
files.f/sources.fと+incdir+、+define+、ネストされた-fディレクティブボードプリセット: 11 の内蔵ボード(iCEBreaker、ULX3S、TinyFPGA BX、Tang Nano など)— target/device/package/clock を自動設定
制約ファイルの自動検出: プロジェクトディレクトリ内の
.pcf/.lpf/.pdc/.cstを検出ビットストリーム書き込み:
iceprog(iCE40)またはopenFPGALoader(ECP5/Gowin/Nexus/Xilinx)でフラッシュVivado:
start_buildによるバッチ実行、LiteX 経由の Xilinx ビルド、build_statusでの構造化された Vivado ログ解析シミュレーション判定の解析: PASS/FAIL/UVM パターン検出と VCD 信号サマリー
バックグラウンドビルド: ステータスポーリング付きの長時間実行合成/配置配線と、EDA 専用コマンドのみを許可する厳格な許可リスト
並行リクエスト: 時間のかかるツール呼び出しが実行されている間も ping、ビルドステータス、キャンセルに応答します。
notifications/cancelledは実行中の呼び出しを中止します機械可読な結果: ツール結果の
structuredContent(MCP 2025-06-18)と、リトライ/フォールバック判断のための統一error_code分類進行通知: クライアントが
progressTokenを送信すると、合成、配置配線、LiteX 実行のフェーズ境界でnotifications/progressを送信しますIP コアレジストリ: FuseSoC CAPI2 メタデータによる GitHub からのライブ検索とインポート
ヘルスチェック: インストール済みで到達可能な OSS CAD Suite ツールを検出します
Related MCP server: vivado-mcp-agent
目次
仕組み
Your AI assistant <--> fpgaZeroMCP (stdio MCP server) <--> OSS tools
|
cores/ registry on GitHub
(uart_tx, fifo + any imported)MCP サーバーはローカルのサブプロセスとして実行されます。AI は JSON-RPC(stdio)経由でサーバーのツールを呼び出します。サーバーは OSS CAD Suite の Yosys、nextpnr、iverilog、Verilator などのツールをシェル経由で実行し、オープンソースの FPGA コアを GitHub から直接取得することもできます。
前提条件
要件 | 備考 |
Python 3.11+ | |
iverilog、Yosys、nextpnr、Verilator、Verible、GHDL を 1 つのダウンロードに同梱 | |
任意 — LiteX ツールでのみ必要 |
インストール後、OSS CAD Suite を PATH に追加してください。すべてのツールラッパーは、ツールが不足している場合でもグレースフルに動作します。
GitHub API アクセス
GitHub API リクエストは、デフォルトでは認証されておらず、レート制限の対象です。レート制限を引き上げるには、パーソナルアクセストークンを設定してください:
# Linux/macOS
export GITHUB_TOKEN=ghp_...# Windows (PowerShell)
$env:GITHUB_TOKEN = "ghp_..."インストール
git clone https://github.com/lcapossio/fpgaZeroMCP
cd fpgaZeroMCP
pip install -e .MCP クライアントのセットアップ
Claude Desktop
claude_desktop_config.json に追加:
{
"mcpServers": {
"fpgaZeroMCP": {
"command": "python",
"args": ["/path/to/fpgaZeroMCP/server.py"],
"env": { "PYTHONPATH": "/path/to/fpgaZeroMCP" }
}
}
}VS Code (GitHub Copilot)
ワークスペース内の .vscode/mcp.json に追加:
{
"servers": {
"fpgaZeroMCP": {
"type": "stdio",
"command": "python",
"args": ["/path/to/fpgaZeroMCP/server.py"],
"env": { "PYTHONPATH": "/path/to/fpgaZeroMCP" }
}
}
}Cursor / Windsurf
MCP 設定(Settings → MCP Servers)に追加:
{
"fpgaZeroMCP": {
"command": "python",
"args": ["/path/to/fpgaZeroMCP/server.py"],
"env": { "PYTHONPATH": "/path/to/fpgaZeroMCP" }
}
}プロンプト例
"I2C マスターコアを探してインポートして。"
"~/projects/my_fpga 内の VHDL ファイルを合成して、LUT 数を教えて。"
"iCEBreaker ボード向けにプロジェクトを配置配線して、それからフラッシュして。"
"より良いタイミングを試すために、シード 42 で配置配線を実行して。"
"この Verilog を lint して、エラーを修正して。"
"この FIFO をシミュレーションして、テストベンチがパスしたか教えて。"
"この SystemVerilog ファイルをフォーマットして。"
"どの OSS CAD Suite ツールがインストールされていますか?"
ツール
HDL 品質
Tool | 説明 |
| iverilog(V/SV)または GHDL(VHDL)による構文/エラーチェック — 単一ファイル |
| 複数のファイルをまとめて lint し、モジュール間参照を解決します |
| 行ごとの構造化診断 — Verilator → verible フォールバック(V/SV)、GHDL(VHDL) |
| verible-verilog-format(V/SV)または vsg(VHDL)による自動フォーマット |
設計フロー
Tool | 説明 |
| テストベンチのコンパイルと実行 — iverilog(V/SV)または GHDL(VHDL)。 |
| リソース統計付きの Yosys 合成。 |
| Yosys + nextpnr を 1 ステップで実行。ボードプリセット、制約ファイルの自動検出、ビットストリームをディスクに書き込み( |
|
|
| 内蔵ボードプリセット(target/device/package/clock)を列挙 |
IP コアレジストリ
Tool | 説明 |
| ローカルレジストリを閲覧し、カテゴリでフィルタリング |
| コアのマニフェストと HDL ソースを取得 |
| パラメータ化されたインスタンス化スニペット + ソースファイルを取得 |
| MIT ライセンスの FPGA IP リポジトリを GitHub で検索 |
| GitHub リポジトリをローカルレジストリにダウンロード |
| ローカルの FuseSoC CAPI2 |
LiteX
Tool | 説明 |
|
|
| ゲートウェアをビルドせずに LiteX SoC を生成 |
| 完全にカスタムな引数で LiteX ボードターゲットを実行 |
ビルド管理
Tool | 説明 |
| 長時間実行コマンドをバックグラウンドで開始(許可リストに登録された EDA ツールのみ) |
| 進行状況を確認 — ステータス、経過時間、解析されたフェーズ/使用率/タイミング |
| 追跡中のすべてのビルドを一覧表示(実行中と完了済み) |
| 実行中のバックグラウンドビルドを強制終了 |
| 経過時間と合計サイズに基づいて古いビルドログを削除 |
サーバー / レジストリ
Tool | 説明 |
| インストール済みの OSS CAD Suite ツールをパスとバージョン付きで報告 |
| サーバーを再起動せずにコアディレクトリを再スキャン |
IP コアレジストリ
コアは cores/<name>/ に置かれます。— core.json マニフェストと 1 つ以上の HDL ファイルからなります。サーバーは起動時にそれらを自動検出し、インポート後にも再読み込みします。
フォーマットの例として、2 つのリファレンスコア(uart_tx、fifo)が含まれています。このレジストリはここで拡張することを意図していません — GitHub を基盤としています。
ランタイムでのコア取得
# Find a RISC-V softcore
search_github_cores("riscv softcore", language="verilog")
# Pull it in
import_github_core("YosysHQ/picorv32")
# It is now in the local registry
get_ip_core("picorv32")
generate_ip("picorv32", {"COMPRESSED_ISA": 1})サーバーは、リポジトリ内に FuseSoC CAPI2 メタデータ(.core ファイル)が見つかった場合、それを自動的に使用し、より豊富なパラメータおよびポート情報を提供します。許可されたライセンス を持つリポジトリのみが受け入れられます。
コアの提供
このリポジトリにコアを追加する PR は開かないでください。 代わりに、次のようにしてください:
GitHub で
fpgaトピックと MIT ライセンスを付けて HDL リポジトリを公開する任意で、よりリッチなメタデータのための FuseSoC CAPI2
.coreファイルを追加するその後は誰でも
import_github_core("you/your-core")を直接呼び出せます
これによりサーバーは軽量なまま保たれ、コミュニティは GitHub 上で有機的に成長できます。
合成ターゲット
ターゲット | ベンダー / ファミリ | 完全な OSS P&R |
| Lattice iCE40 | 対応 — nextpnr-ice40 |
| Lattice ECP5 | 対応 — nextpnr-ecp5 |
| Lattice Nexus (CrossLink-NX, CertusPro-NX) | 対応 — nextpnr-nexus |
| Gowin | 対応 — nextpnr-gowin |
| Xilinx / AMD | 合成のみ |
| Intel / Altera | 合成のみ |
| テクノロジ非依存 | ネットリストのみ |
place_and_route でよく使用する device/package の値:
ターゲット | device | package |
ice40 |
|
|
ecp5 |
|
|
nexus |
| (デバイス文字列に埋め込まれています) |
gowin |
| (デバイス文字列に埋め込まれています) |
LiteX
LiteX は、多くの FPGA ボードをターゲットにできる Python 製 SoC フレームワークです。fpgaZeroMCP は専用の LiteX ツールを 3 つ公開しており、synthesize と place_and_route で backend="litex" も受け付けます。
# Dedicated tools
litex_build(board="arty", args=["--build"])
litex_soc(board="arty", args=["--no-compile"])
litex_flow(board="arty", args=["--build", "--output-dir", "build_arty"])
# As a backend in existing flow tools
synthesize(code="...", top_module="top", backend="litex", litex_board="arty")
place_and_route(code="...", top_module="top", target="ice40", device="hx1k",
backend="litex", litex_board="arty", litex_args=["--build"])ローカルコアリポジトリ
レジストリを自分のローカル HDL ディレクトリに向けるには、2 つの方法があります:
環境変数:
Linux/macOS(コロン区切り):
export USERCORES_PATH=/home/you/my-cores:/home/you/work-coresWindows(セミコロン区切り、PowerShell):
$env:USERCORES_PATH = "C:\Users\you\my-cores;C:\Users\you\work-cores"設定ファイル(~/.fpgazero_mcp/config.json):
{
"core_paths": [
"/home/you/my-cores",
"/home/you/work-cores"
]
}すべてのパスは、起動時に組み込みの cores/ ディレクトリとともにスキャンされます。
許可されるライセンス
デフォルトでは、import_github_core は以下のいずれかの SPDX ライセンスを持つリポジトリを受け入れます:
MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0, ISC, GPL-2.0, GPL-3.0, LGPL-2.1, LGPL-3.0FPGAZERO_ALLOWED_LICENSES 環境変数(カンマ区切りの SPDX ID)で上書きできます:
# Linux/macOS
export FPGAZERO_ALLOWED_LICENSES=MIT
export FPGAZERO_ALLOWED_LICENSES=MIT,Apache-2.0# Windows (PowerShell)
$env:FPGAZERO_ALLOWED_LICENSES = "MIT"
$env:FPGAZERO_ALLOWED_LICENSES = "MIT,Apache-2.0"ライセンス ID は SPDX 表記に従います。チェックはインポート時に行われ、search_github_cores はライセンスに関係なく結果を返すため、インポートする前に評価できます。
テスト
pip install -e ".[dev]"
python -m pytest tests/ -v一部のテストでは、PATH に OSS CAD Suite ツールが必要です。不足しているツールを必要とするテストは自動的にスキップされます。
メモリ使用量の削減
サーバーは stdio トランスポート上で、セッションごとに 1 プロセスずつのサブプロセスとして実行されます(これは Claude Desktop などの MCP クライアントが起動する方法です)。Linux では、各セッションのアイドル時 RSS は ~60〜90 MB で、そのほとんどは Python インタープリターと依存関係によるものです。
多数の MCP セッションを同時に実行する場合は、MCP クライアントを起動する前に次の環境変数を設定してください:
# Linux — reduces glibc malloc arena fragmentation (can save 10-20 MB per session)
export MALLOC_ARENA_MAX=2
# Strip bytecode position annotations from tracebacks (saves a few MB)
export PYTHONNODEBUGRANGES=1
# Skip .pyc cache files (no memory impact, avoids disk writes)
export PYTHONDONTWRITEBYTECODE=1これらはコード変更が一切不要で、完全に透過的です。
環境変数
変数 | 説明 |
| GitHub 個人アクセストークン — API レート制限を引き上げます |
| 追加のコア検索ディレクトリ(OS のパス区切り文字で区切る) |
|
|
| 一時ワークスペースのルートディレクトリを上書きします |
| 永続的なサーバーアーティファクトのルート — ビルドログ、LiteX 出力、一時ワークスペース(デフォルト: |
|
|
スタンドアロン / スクリプティング
Python API は MCP クライアントなしで直接使用できます:
from registry.resolver import CoreRegistry
from tools.lint import lint_hdl
reg = CoreRegistry()
# Import a core from GitHub
reg.import_github_core("ben-marshall/uart")
# Generate a parameterized instantiation
result = reg.generate_ip("uart", {"CLKS_PER_BIT": 868})
print(result["instantiation"])
# Lint some HDL
lint_hdl(open("my_design.v").read())python example.py # runs the built-in democore.json スキーマ
{
"name": "my_core",
"version": "1.0.0",
"description": "...",
"author": "you",
"license": "MIT",
"language": "verilog",
"category": "communication",
"tags": ["spi", "serial"],
"parameters": {
"DATA_WIDTH": { "type": "integer", "default": 8, "description": "..." }
},
"ports": {
"clk": { "direction": "input", "width": 1, "description": "System clock" }
},
"files": ["my_core.v"]
}著者
Leonardo Capossio (bard0) — hello@bard0.com
ライセンス
MIT — LICENSE を参照してください。
Available Tools
25 toolsbuild_statusA
Check the progress of a background build. Returns status (running/success/failed), elapsed time, and recent log output.
Inputs: build_id (required), tail_lines, parse.
cancel_buildB
Cancel a running background build.
Inputs: build_id (required).
check_toolsA
Check which EDA tools are installed and reachable. Returns tool name, path, and version for each detected binary.
Inputs: no named parameters.
cleanup_build_logsA
Delete old build logs to reclaim disk space. Removes logs older than max_age_days, then trims oldest until under max_total_mb.
Inputs: max_age_days, max_total_mb.
format_hdlA
Format HDL source code and return the result. Verilog/SystemVerilog: uses verible-verilog-format. VHDL: uses vsg (pip install vsg). Returns the formatted code and whether it changed.
Inputs: code (required), language.
generate_ipB
Generate a parameterized instance of an IP core. Returns the HDL source files and a ready-to-paste Verilog instantiation snippet with the requested parameter values applied.
Inputs: name (required), parameters, instance_name.
get_diagnosticsB
Return structured lint diagnostics (line, column, severity, message) for HDL source. Verilog/SystemVerilog: uses Verilator (primary) with verible-verilog-lint as fallback. VHDL: uses GHDL. All tools are part of OSS CAD Suite.
Inputs: code (required), language.
get_ip_coreB
Fetch the full manifest and HDL source files for a named IP core.
Inputs: name (required).
import_fusesoc_coreA
Import a local FuseSoC CAPI2 .core file into the registry. HDL files referenced in the .core file must exist in the same directory. Useful when you already have FuseSoC cores checked out locally.
Inputs: path (required).
import_github_coreA
Download an open-source GitHub repository and add it to the local IP core registry. Automatically uses FuseSoC CAPI2 metadata (.core file) if one exists in the repo. After import, the core is immediately available via get_ip_core and generate_ip.
Inputs: repo (required), subdir, ref.
lint_hdlA
Lint HDL source code using iverilog/verilator (Verilog/SystemVerilog) or ghdl (VHDL). Use linter='verilator' to enable -Wall checks including multidriven net detection.
Inputs: code (required), language, top_module, linter.
lint_projectA
Lint multiple HDL files together so cross-module references resolve. Pass a dict of filename-to-source pairs. All files are compiled in one invocation of iverilog/verilator (Verilog/SystemVerilog) or ghdl (VHDL). Use linter='verilator' to enable -Wall checks including multidriven net detection.
Inputs: files (required), language, top_module, timeout, +1 more.
list_boardsA
List all known FPGA board presets with target, device, package, and clock frequency.
Inputs: no named parameters.
list_buildsA
List all tracked builds (running and finished) with status summary.
Inputs: no named parameters.
list_ip_coresA
List all available IP cores in the registry. Optionally filter by category.
Inputs: category.
litex_buildC
Run LiteX board target with --build. Returns logs and output directory.
Inputs: board (required), args, output_dir, timeout.
litex_flowA
Run a generic LiteX board target with caller-provided args.
Inputs: board (required), args, timeout.
litex_socA
Generate LiteX SoC without building gateware. Returns logs and output directory.
Inputs: board (required), args, output_dir, timeout.
place_and_routeA
Synthesize HDL with Yosys then place-and-route with nextpnr in one step. Provide source as: code (single string), files (dict of filename→source), or project_dir (path to HDL files on disk). If backend=litex, runs LiteX build and ignores HDL inputs. Returns max frequency, critical path, resource utilization, bitstream, and full logs. Supported targets: ice40, ecp5, nexus, gowin. Common device/package values: ice40: device=hx1k|hx8k|up5k|lp1k package=tq144|qn84|sg48|cm81 ecp5: device=25k|45k|85k package=CABGA256|CABGA381 nexus: device=LIFCL-40-9BG400C (package embedded in device string) gowin: device=GW1N-UV4LQ144C6/I5 (package embedded in device string)
Inputs: top_module (required), code, files, project_dir, +12 more.
program_fpgaA
Flash a bitstream to an FPGA board using iceprog (ice40) or openFPGALoader (ecp5/gowin/nexus). Provide bitstream as base64 (from place_and_route output) or a file path on disk.
Inputs: target (required), bitstream_b64, bitstream_path, programmer, +2 more.
reload_registryA
Re-scan all core directories and rebuild the IP core cache. Call after adding cores to disk or editing config.json.
Inputs: no named parameters.
search_github_coresA
Search GitHub for open-source FPGA IP cores (MIT, BSD, Apache, GPL, etc). Returns repo names, star counts, descriptions and topics. Use import_github_core to download a result into the local registry.
Inputs: query (required), language, max_results.
simulateA
Compile and simulate HDL using Icarus Verilog (iverilog + vvp) or GHDL (VHDL). Provide the design source and a separate testbench. Returns all $display/$monitor output (Verilog) or report output (VHDL) and any runtime errors.
Inputs: code (required), testbench (required), language, timeout.
start_buildA
Start a long-running build command in the background. Returns a build_id to check progress with build_status. Use for synthesis, place-and-route, LiteX builds, or any command that takes minutes.
Inputs: cmd (required), label, work_dir.
synthesizeA
Synthesize HDL (Verilog, SystemVerilog, or VHDL) using Yosys or run LiteX backend. Provide source as: code (single string), files (dict of filename→source), or project_dir (path to HDL files on disk). Returns resource statistics and the list of inferred modules. Supported targets: generic, ice40, ecp5, gowin, xilinx, intel.
Inputs: top_module (required), code, files, project_dir, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Each tool targets a distinct operation: build management, IP core management, HDL linting/simulation, synthesis/P&R, and LiteX flows. Overlaps like lint_hdl vs lint_project are clearly differentiated by single vs multi-file scope, so agents can reliably select the correct tool.
All tool names follow consistent snake_case with a verb_noun pattern (e.g., list_boards, generate_ip, cancel_build). No camelCase or mixed styles, making naming predictable and easy to remember.
25 tools cover a broad FPGA development workflow without being excessive. Each sub-domain (builds, IP cores, linting, synthesis, LiteX) is adequately represented, though the count is at the upper end of typical scopes.
The tool set covers the main FPGA flow: HDL linting, simulation, synthesis, place-and-route, and programming, plus build management and IP core discovery/import. Minor omissions like constraint file generation or waveform viewing exist, but core operations are well-supported.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Create, deploy, and operate MCP servers directly from your GitHub repositories.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides 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.151MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for deterministic Vivado FPGA automation including project scaffolding, simulation, synthesis, implementation, and gated bitstream generation.4MIT
- AlicenseAqualityBmaintenanceA minimal MCP server that provides 25 tools and 5 hooks to control Xilinx Vivado EDA for FPGA development, including session management, Tcl execution, smart diagnostics, and IP debugging.32166 PyPI181Apache 2.0
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants like Claude to directly interact with AMD/Xilinx Vivado FPGA development tools.4074MIT