Vivado MCP Server
Drive a persistent AMD/Xilinx Vivado Tcl session from an LLM client and get back the real Tcl result plus everything Vivado printed (INFO/WARNING/ERROR).
Start or re-attach a session (
start_session) — launchesvivado.bator reuses an already-running Vivado; optionalvivado_pathoverride.Run arbitrary Tcl (
run_tcl_command) — auto-starts a session if none exists; returnsstatus(ok/error/running/busy),result,error,consoletranscript, duration and Tcl code.Inspect session state (
session_status) — alive/attached/busy, running job, pid, port, console log path.Stop Vivado (
stop_session) — kills the process tree if a command is running (the only way to cancel).Not exposed in this schema but in the README: job polling (
job_status),console_tail, FPGA programming over JTAG (list_hw_devices,program_device), simulation control and PASS/FAIL log parsing, project artifact browsing, optional RAG document search, per-project command history/journal, and agent guide resources.
Allows controlling an AMD/Xilinx Vivado TCL session for FPGA design, including starting sessions, executing TCL commands, checking status, and stopping sessions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Vivado MCP Server run the TCL command: synth_design -top top_module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Vivado MCP Server (Windows-Native)
Vivado MCP Server is a Model Context Protocol (MCP) server that lets LLM clients control a persistent AMD/Xilinx Vivado Tcl session on Windows and get back what actually happened: the Tcl result, whether it failed, and everything Vivado printed (INFO / WARNING / ERROR messages included).
How it works
Vivado itself hosts a small Tcl socket server (vivado_socket_server.tcl). The MCP
server sends one JSON request per command over loopback and Vivado answers directly
from its own Tcl interpreter, so there is no prompt scraping.
Reliable success/failure: Tcl return codes become
status: ok | error.Console capture: Vivado is launched with
-log; each command's slice of that transcript is returned asconsole(Vivado 2025.2 has noredirect, and its messages bypass Tcl's channels, so the log is the only place they can be read).Survives MCP restarts: Vivado keeps running;
start_sessionre-attaches to it instead of launching a second one (cold start is ~30 s).Secured: loopback only, per-session random token required on every request; anything that is not a JSON object (e.g. an HTTP request from a web page) is dropped.
Audit trail: per-project command history and a replayable
.tcljournal.
Why this design beat a stdin/stdout pipe wrapper (and a TCP layer on top of it):
see docs/BACKEND_DECISION.md. The old modules live in legacy/.
Related MCP server: Vivado MCP
Requirements
Windows 10/11
Python 3.10+
Vivado installed locally (developed against 2025.2)
uv(recommended) orpip
Quick install
git clone <your-repo-url>
cd Vivado_MCP_Windows
uv syncVivado path configuration
The server resolves vivado.bat in this order:
start_sessiontool argumentvivado_pathEnvironment variable
VIVADO_BAT_PATHPATH lookup (
vivado.batorvivado)Common install locations (
C:\AMDDesignTools\2025.2\...,C:\VIVADO\2025.2\...,C:\Xilinx\Vivado\2025.2\...)
Recommended: set VIVADO_BAT_PATH explicitly.
$env:VIVADO_BAT_PATH = "C:\AMDDesignTools\2025.2\Vivado\bin\vivado.bat"Run the MCP server
uv run vivado-mcpThis is a stdio MCP server: it waits for MCP messages from a client and looks idle when run directly in a terminal. Restart it after updating the code so the client loads the new tools.
MCP client configuration
You must insert the directory of where you installd the vivado-mcp server
{
"mcpServers": {
"vivado": {
"command": "uv",
"args": ["run",
"--directory",
"DIRECTORY TO THE VIVADO MCP FOLDER",
"vivado-mcp"],
"env": {
"VIVADO_BAT_PATH": "C:/AMDDesignTools/2025.2/Vivado/bin/vivado.bat"
}
}
}
}Optional: document search (RAG)
The agent can search reference PDFs (board user guides, datasheets) through search_docs.
Everything lives in this project's rag/ folder: config.yaml (tracked), sources/ for the
PDFs and db/ for the LanceDB database (both git-ignored).
Install the extra once:
uv sync --extra rag.Start the embedding model named in
rag/config.yaml(default:bge-base-en-v1.5-fp16-ovon OVMS athttp://localhost:8000, OpenAI-compatible/v1/embeddings).Put PDFs in
rag/sources/and build the database:
uv run --extra rag vivado-docs ingest rag/sourcesAdd
"--extra", "rag"before"vivado-mcp"in the MCP clientargsand restart it.
The same embedding model must be used for ingesting and searching; after changing it, delete
rag/db and ingest again. vivado-docs list, remove <file>, reindex and config manage
the database. To query it from a terminal (same search as the agent's search_docs):
uv run --extra rag vivado-docs search "ZedBoard 100 MHz clock pin" -k 5-s <file> limits it to one document, --json prints the raw result, and
vivado-docs page <file> <page> prints a whole page. VIVADO_MCP_RAG_CONFIG points at a different config file if needed.
Embeddings come only from a local server (OVMS; LM Studio and Ollama also work); no cloud
service or API key is used.
Tools
Session
start_session(vivado_path?, show_window?, project?, host?, port?): attach to a running Vivado or launch one.show_window=trueopens a visible Vivado console.run_tcl_command(command, wait=60): run Tcl as a background job and wait up towaitseconds. If it finishes, you get the full result; if not, you getstatus: runningand ajob_idwhile Vivado keeps going (starts/attaches a session if needed).job_status(job_id?, wait=0): collect a job's outcome (default: the most recent job).wait=Nblocks up to N seconds. While running it returnselapsed_sand the console so far.console_tail(lines=100): last N lines of Vivado's transcript. Only reads the log file, so it works while a long command is still running.session_status(): alive / attached / busy / running_job / pid / port / console log path.stop_session(): stop Vivado. If a command is still running, the Vivado process tree is killed (the only way to cancel).
Guides for the agent
Four markdown guides ship in src/vivado_mcp/guides/ and are exposed as MCP resources: vivado://guide/overview, vivado://guide/workflow, vivado://guide/tcl-cheatsheet, vivado://guide/troubleshooting. The vivado_guide(topic?) tool returns the same text for clients that do not surface resources. Edit the .md files to change what the agent is told.
run_tcl_command result
field | meaning |
|
|
| id for |
| the Tcl return value |
| everything Vivado printed during the command, including |
| Tcl error text, |
| whether the full slice arrived / was capped (the log keeps everything; use |
| timing and Tcl return code |
Operating rules (Vivado's Tcl loop is single-threaded):
While a command runs, Vivado answers nothing else, so a new
run_tcl_commandreturnsstatus: busyat once instead of queueing. Poll withjob_status/console_tail(both are safe while a job runs).Long steps (
launch_runs ... -wait_on_run,run all, bitstream) can be sent as-is: the connection stays open for the whole job (ceiling 4 h) and the agent collects the result withjob_status(wait=...).There is no way to cancel a running Vivado command except
stop_session, which kills the process (a new session is then needed).A Vivado
ERRORaborts the rest of that command.
Board programming (Hardware Manager)
list_hw_devices(hw_server_url?): connect tohw_server(launched by Vivado on first use, ~30 s) and list JTAG targets and devices: name, part,is_fpga(false for the Zynqarm_dap_*debug port) anddone(DONE pin). Read-only.program_device(bitstream?, device?, probes?, run="impl_1", target?, hw_server_url?): program the FPGA over JTAG. Withoutbitstreamit uses the newest.bitof the open project'simpl_1run and reportsrun_status/run_needs_refresh. The ARM debug port is skipped automatically;device/targetare only needed for multi-FPGA chains or several cables. Returnsdone: truewhen the design is running. Programming is volatile; flash and SD card are not touched.
Both run as background jobs like run_tcl_command (status: running + job_id if the connect takes longer than wait).
Simulation and artifact inspection
close_simulation: clear active simulation snapshots before a rerun.run_simulation: configuresim_1, launch behavioral or post-synthesis simulation (Vivado 2025.2 syntax), wait for completion, parse common PASS/FAIL markers.list_project_artifacts,read_project_artifact: browse and read bounded files under a project's.runs/.simdirectories (paths cannot escape the project).summarize_simulation_logs: parse PASS/FAIL markers from existing logs.
Document search (optional, see "Optional: document search" above)
Read-only search of the rag/ knowledge base. The tools return matching text with source file and page; they do not generate an answer, the agent does that.
search_docs(query, top_k?, source_file?): hybrid vector + full-text search merged by weighted reciprocal rank fusion. Falls back to vector-only, with anote, when the full-text index is missing.list_docs(): documents in the database (chunks, page range) and the config in use.read_doc_page(source_file, page_number): all stored text of one page, to read around a hit.
New documents ingested with vivado-docs are visible on the next call without restarting the server.
Per-project command logging
set_active_project,get_project_command_history,list_logged_projects.
Files and logs
Everything lives under ~/.vivado_mcp/logs/ (override with VIVADO_MCP_LOG_DIR):
console/vivado_<time>_<port>.log: Vivado's full transcript for the session.projects/<project>/<project>_history.jsonl: every command, status, duration, output and console.projects/<project>/<project>_journal.tcl: replayable script of the successful commands.native_session.json: host/port/token of the running session, used to re-attach (treat like a password; delete it if you want to force a fresh launch).
Projects are detected automatically from open_project / create_project, or set with project=.
Environment variables
variable | purpose |
| path to |
|
|
| where logs and the attach state file are kept |
| loopback address of the Tcl server (default |
| document-search config file or folder (default |
The token (VIVADO_TCL_SERVER_TOKEN) is generated per session and passed to Vivado automatically.
Development
uv sync --group dev
uv run ruff check .
uv run pytesttests/test_native_protocol.py runs the real Tcl server under tclsh through a fake
vivado launcher; it is skipped on Windows or where tclsh is missing.
Troubleshooting
Vivado executable not found: setVIVADO_BAT_PATHor passvivado_pathtostart_session.127.0.0.1:9877 is already in use ...: an older Vivado server (without token support) or another program holds the port. Close that Vivado or pass anotherport.Attach keeps failing: delete
~/.vivado_mcp/logs/native_session.json; a stale entry is normally removed automatically.consoleis empty: checksession_status().console_logexists and is growing; if Vivado was started some other way (without-log), onlyresultanderrorare available.Import errors for
mcp.*in the editor: runuv syncand select the project virtual environment.
Available Tools
4 toolsrun_tcl_commandA
Send an arbitrary TCL command to the persistent Vivado session and return its output. Auto-starts a session if none exists.
Inputs: command (required), timeout.
session_statusA
Return status/statistics for the current Vivado session.
Inputs: no named parameters.
start_sessionA
Start a persistent Vivado TCL session (vivado.bat -mode tcl). Optionally override the vivado.bat path. Reuses an existing session if one is already running.
Inputs: vivado_path.
stop_sessionB
Stop the running Vivado session and free resources.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct aspect: running commands, querying status, starting, and stopping the session. No ambiguity between them.
All tools use consistent snake_case verb_noun naming (run_tcl_command, session_status, start_session, stop_session), following the same pattern.
For a Vivado session manager, 4 tools is slightly thin but covers the essential lifecycle and command execution. Could be expanded with project or file operations.
The set covers session management and command execution fully. Missing an explicit health check or reset, but most workflows are supported.
Related MCP Connectors
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Windows MCP server for AI agents (WebGL browser QA, MS Office COM, NVENC) via x402 USDC.
Remote desktop control, files, and terminal tools for AI assistants on paired Windows PCs.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to directly launch, control, and analyze AMD/Xilinx Vivado on Windows and Linux, supporting project management, synthesis, implementation, bitstream generation, timing/resource analysis, and simulation through a persistent Tcl session.76 PyPIMIT
- AlicenseBqualityCmaintenanceEnables AI coding assistants to drive Xilinx Vivado through natural language, letting users open .xpr projects, run synthesis, implementation, and bitstream generation, inspect timing, resource, and clock reports, and launch simulations to read signal values or set breakpoints. It also exposes design hierarchy queries and arbitrary TCL execution, so FPGA design flows can be operated conversationally on Windows.40MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents such as Claude Code, Cursor, and Codex to safely drive a locally installed Xilinx Vivado through 32 curated tools spanning GUI, Tcl, and attach sessions, synthesis, implementation, timing, CDC, XDC, IP, waveforms, and device programming. It provides structured timing evidence with baseline comparison, offline VCD queries for unknown values and handshake events, environment self-checks, and Chinese-language diagnosis of timing issues and CRITICAL WARNINGs.-
- FlicenseNot gradedqualityAmaintenanceEnables 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.-