How to use the DVT MCP Server with a CLI AI agent

Overview

The DVT MCP Server provides AI agents with a set of tools that deliver accurate, compiler-backed information from your design and verification project.

This video covers starting the DVT MCP Server for your project and configuring a CLI AI Agent to use it.

Details

Introduction

The DVT MCP Server provides AI agents with a set of tools that deliver accurate, compiler-backed information from your design and verification project.

Start the server

To start the server, run the dvt_mcp.sh start command and provide the project directory and languages:

dvt_mcp.sh start uvm_ref_flow_1.1 -lang vlog

The process immediately goes to background and starts building the project.

The build configuration arguments are read from the .dvt/default.build file. You can also provide the build arguments on the commandline. Let's start another server in this other mixed language project:

dvt_mcp.sh start mx-1 -lang vlog -lang vhdl -f vlog.f -f vhdl.f -top tb_jop

You can check the server status using dvt_mcp.sh list.

Run dvt_mcp.sh -help to see all available script arguments.

Configure Claude CLI AI Agent to use DVT MCP Server

Connecting to the server is agent-specific. You typically specify a command which the agent then uses to initiate a server connection. Subsequent communication to the server is done over the standard input/output of this command. For the DVT MCP server, the command is dvt_mcp.sh connect.

Now let's configure the DVT MCP server in Claude code CLI agent by running this command:

claude mcp add --env DVT_HOME=path/to/dvt/home --transport stdio dvt_mcp -- /bin/bash -c '$DVT_HOME/bin/dvt_mcp.sh connect'

Let's break it down. Most agents, including Claude, run MCP servers in a "slim" environment, so we explicitly add DVT_HOME to the env. Then, we specify the transport mechanism - standard I/O, the server name, and finally the DVT MCP specific command.

For every tool call, agents will add a root directory to the command. Typically this is the working dir of the CLI agent and must match the project directory specified at server startup.

Perform a task with Claude CLI

So let's start Claude in our project directory and ask it to find the root cause of a test failure - notice how it calls tools provided by DVT MCP Server to accomplish its task.

Stop the agent and server

If we check the server status now, notice that it shows up as being "in use" by cCaude. To stop it, we first disconnect the agent and then run dvt_mcp.sh stop.