desmonddak/rohd-mcp-server
If you are the rightful owner of rohd-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The ROHD MCP Server is a comprehensive Model Context Protocol server that integrates AI capabilities with the Rapid Open Hardware Development framework, offering a complete suite of tools for hardware design, simulation, and verification.
ROHD MCP Server
A comprehensive Model Context Protocol (MCP) server providing AI applications with complete access to ROHD (Rapid Open Hardware Development) framework capabilities. This server enables professional hardware design, simulation, and verification workflows through 43 specialized MCP tools.
🎯 Overview
The ROHD MCP Server transforms hardware development by bridging AI capabilities with professional ROHD tools. It provides 43 specialized MCP tools across 7 categories, supporting everything from basic module creation to complex system-on-chip integration with advanced port types.
Key Capabilities
- Complete Hardware Design Workflow: Module creation → Simulation → Verification → Code Generation
- Advanced Port Types: Logic, LogicStructure, LogicArray for complex designs
- Interface Management: Reusable interfaces with conditional logic support
- Real-Time Simulation: Interactive debugging with signal monitoring
- Professional Code Generation: Complete ROHD modules with comprehensive tests
- Multi-LLM Support: Optimized configurations for Claude, GPT-4/5, Gemini, and more
Professional Features
- 43 MCP Tools organized in 7 functional categories
- LogicStructure & LogicArray Support for advanced hardware constructs
- Interface-Based Design with complex conditional logic
- Coverage-Driven Verification with comprehensive analysis
- System Integration capabilities for SoC-level designs
- Multi-Platform LLM Integration with performance optimization
Installation
Quick Start (Recommended)
For the fastest setup, use our automated scripts:
# 1. Install prerequisites (Node.js, npm, build tools)
./install-prerequisites.sh
# 2. Setup the project (install dependencies, build)
./setup-server.sh
# 3. Start the server
./start-server.sh --inspector # For testing with web interface
# OR
./start-server.sh # For production use
📚 Complete Documentation
📖 Main Guides
- : Comprehensive setup for Claude, GPT-4/5, Gemini, and all supported LLMs with configuration examples and verification procedures
- : All 43 MCP tools, advanced examples, professional workflows, and complex design patterns
🚀 Quick Start
- : Get running in 5 minutes with basic examples
- : Detailed installation and setup procedures
🔧 Advanced Topics
- : Complete feature overview and capabilities summary
⚡ Quick Installation
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Install & Build
npm install
npm run build
Usage
Validate Your Setup
Before configuring your LLM, validate your MCP server installation:
./validate-mcp-setup.sh
This script will:
- ✅ Check server installation and build
- ✅ Test MCP protocol response
- ✅ Verify all 43+ tools are available
- ✅ Generate LLM-specific configuration snippets
- ✅ Provide test prompts to verify MCP integration
Running the Server
The server uses stdio transport for communication with MCP clients:
npm start
# or
node build/index.js
For development with auto-reload:
npm run dev
Integration with MCP Clients
Claude Desktop
Add this server to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"rohd-simulator": {
"command": "node",
"args": ["/path/to/rohd-mcp-server/build/index.js"]
}
}
}
VS Code with MCP
Use the MCP extension for VS Code and configure the server in your mcp.json:
{
"servers": {
"rohd-simulator": {
"type": "stdio",
"command": "node",
"args": ["/path/to/rohd-mcp-server/build/index.js"]
}
}
}
GPT-4 and GPT-5 (OpenAI)
For OpenAI's GPT models with MCP support, add the server to your MCP configuration:
{
"mcp_servers": {
"rohd-simulator": {
"command": "node",
"args": ["/path/to/rohd-mcp-server/build/index.js"],
"description": "ROHD Hardware Design and Simulation Server"
}
}
}
GPT-5-mini (OpenAI)
For GPT-5-mini specifically, configure using the lightweight MCP client format:
{
"servers": [
{
"name": "rohd-simulator",
"command": "node",
"args": ["/path/to/rohd-mcp-server/build/index.js"],
"env": {
"NODE_ENV": "production"
},
"capabilities": [
"tools",
"resources"
],
"metadata": {
"category": "hardware-design",
"description": "ROHD hardware simulation and code generation",
"version": "1.0.0"
}
}
]
}
Other MCP-Compatible LLMs
For any LLM that supports the Model Context Protocol, use this generic configuration template:
{
"mcp_servers": {
"rohd-simulator": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/rohd-mcp-server/build/index.js"],
"timeout": 30000,
"retry_attempts": 3,
"capabilities": {
"tools": true,
"resources": false,
"prompts": false
}
}
}
}
Configuration Notes:
- Replace
/path/to/rohd-mcp-server/with the actual absolute path to your installation - Ensure the server is built (
npm run build) before configuring - Some LLMs may require restarting after configuration changes
- For production use, consider setting
NODE_ENV=productionin the environment
Testing with MCP Inspector
Use the MCP Inspector to test the server functionality:
npx @modelcontextprotocol/inspector node build/index.js
Available Tools
The ROHD MCP Server provides 39 comprehensive tools organized into seven categories:
Module Management Tools
create_module
Create a new hardware module with specified inputs and outputs.
Parameters:
name: Module nameinputs: Object mapping input names to bit widthsoutputs: Object mapping output names to bit widthsparameters: Optional module parameters
Example:
{
"name": "and_gate",
"inputs": { "a": 1, "b": 1 },
"outputs": { "y": 1 }
}
list_modules
List all created hardware modules.
get_module_details
Get detailed information about a specific hardware module.
Signal Management Tools
create_signal
Create a signal with specified bit width and optional initial value.
update_signal
Update the value of an existing signal.
list_signals
List all signals and their current values.
watch_signal
Add a signal to the watch list for monitoring during simulation.
get_watched_signals
Get current values of all watched signals.
force_signal
Force a signal to a specific value (overrides normal logic).
Simulation Control Tools
start_simulation
Start simulation for a hardware module with configurable clock period.
Parameters:
moduleName: Name of module to simulateclockPeriod: Clock period in time units (optional, default: 10)
stop_simulation
Stop the currently running simulation.
step_clock
Advance the simulation by one or more clock cycles.
Parameters:
steps: Number of clock steps to advance (optional, default: 1)
Returns:
- Current simulation time
- List of signals that changed during the step
wait_cycles (ROHD-VF Inspired)
Wait for a specified number of complete clock cycles, similar to ROHD-VF's waitCycles() method.
Parameters:
clockName: Clock signal name (optional, default: 'clk')cycles: Number of complete cycles to wait (optional, default: 1)
Returns:
- Final simulation time
- Number of cycles completed
- Array of detected clock edges with timestamps
next_posedge (ROHD-VF Inspired)
Wait until the next positive edge (rising edge) of a clock signal, similar to ROHD-VF's nextPosedge() method.
Parameters:
clockName: Clock signal name (optional, default: 'clk')
Returns:
- Time when positive edge occurred
- Clock value after edge
- Edge type confirmation
next_negedge (ROHD-VF Inspired)
Wait until the next negative edge (falling edge) of a clock signal, similar to ROHD-VF's nextNegedge() method.
Parameters:
clockName: Clock signal name (optional, default: 'clk')
Returns:
- Time when negative edge occurred
- Clock value after edge
- Edge type confirmation
wait_signal_change
Wait for a specific signal to change value or reach an expected value.
Parameters:
signalName: Signal name to monitorexpectedValue: Expected value to wait for (optional)maxWaitTime: Maximum time to wait (optional, default: 1000)
Returns:
- Time when change occurred
- New signal value
- Total wait time
get_simulation_status
Get comprehensive simulation status including:
- Running state
- Current module under test
- Simulation time
- Active clock signals
- Watched signals count
- Active breakpoints
- Total signal count
set_breakpoint
Set a breakpoint at a specific simulation time with optional conditions.
get_simulation_history
Get recent simulation events and signal changes with configurable history depth.
Test Bench Tools
create_test_bench
Create test benches for module validation with test vectors.
run_simulation
Execute test bench simulations and get detailed pass/fail results.
Code Generation Tools
generate_verilog
Generate Verilog HDL code from hardware module definitions.
generate_rohd_code
Generate complete ROHD Dart module code from hardware module definitions. Creates a proper ROHD module class with inputs, outputs, constructor, and placeholder logic implementation.
Example Usage:
// First create a module
create_module({
name: "counter",
inputs: { clk: 1, reset: 1, enable: 1 },
outputs: { count: 8, overflow: 1 }
})
// Generate ROHD Dart code
generate_rohd_code({ moduleName: "counter" })
Generated ROHD Code:
import 'package:rohd/rohd.dart';
/// counter module generated by ROHD MCP Server
class Counter extends Module {
Logic get clk => input('clk');
Logic get reset => input('reset');
Logic get enable => input('enable');
Logic get count => output('count');
Logic get overflow => output('overflow');
Counter({
required Logic clk,
required Logic reset,
required Logic enable,
super.name = 'counter',
}) {
clk = addInput('clk', clk);
reset = addInput('reset', reset);
enable = addInput('enable', enable);
addOutput('count', width: 8);
addOutput('overflow');
_buildLogic();
}
void _buildLogic() {
// TODO: Implement module logic here
// Example: output <= input;
// Simple pass-through example:
// count <= clk;
}
}
generate_rohd_test
Generate ROHD Dart test framework code for a hardware module.
Parameters:
testName: Name of the testmoduleName: Name of module to generate test foroptions: Configuration options including imports, setup, cleanup, history-based generation, and custom test sequences
generate_rohd_test_from_session
Generate ROHD Dart test code from the current simulation session history.
Parameters:
testName: Name of the testsessionDescription: Description of what this test validates (optional)
Returns:
- Complete ROHD Dart test code based on simulation actions performed
- Metadata about the simulation session
generate_rohd_testbench
Generate comprehensive ROHD test bench from test vectors.
Parameters:
testBenchName: Name of the test benchmoduleName: Name of module to testtestVectors: Array of test vectors with inputs and expected outputs (optional if using existing test bench)
ROHD Test Framework Code Generation
The server can generate actual ROHD Dart test framework code from simulation sessions, enabling LLMs to create production-ready hardware verification tests.
Complete Workflow: Simulation to ROHD Test
// 1. Create and simulate a module
create_module({
name: "counter",
inputs: { "clk": 1, "reset": 1, "enable": 1 },
outputs: { "count": 8 }
})
// 2. Set up simulation environment
start_simulation({ moduleName: "counter", clockPeriod: 10 })
// 3. Perform ROHD-VF style verification
next_posedge({ clockName: "clk" })
force_signal({ signalName: "reset", value: "1" })
wait_cycles({ cycles: 2 })
force_signal({ signalName: "reset", value: "0" })
next_posedge()
// 4. Run test sequence
for (let i = 0; i < 5; i++) {
force_signal({ signalName: "enable", value: "1" })
wait_cycles({ cycles: 1 })
// Check counter increment
}
// 5. Generate ROHD test code from session
generate_rohd_test_from_session({
testName: "counter_basic_test",
sessionDescription: "Tests counter increment functionality with enable signal"
})
Generated ROHD Test Output:
/*
* Generated ROHD Test: counter_basic_test
* Module Under Test: counter
* Generated: 2025-11-09T13:30:00.000Z
* Session Description: Tests counter increment functionality with enable signal
*/
import 'dart:async';
import 'package:rohd/rohd.dart';
import 'package:rohd_vf/rohd_vf.dart';
import 'package:test/test.dart';
/// Test module for counter
class CounterTestModule extends Module {
// Input ports
late final Logic clk = addInput('clk', Logic());
late final Logic reset = addInput('reset', Logic());
late final Logic enable = addInput('enable', Logic());
// Output ports
late final Logic count = addOutput('count', Logic(width: 8));
CounterTestModule({
required Logic clk,
required Logic reset,
required Logic enable,
required Logic count,
}) : super(name: 'counter_test') {
// Connect to DUT
final dut = Counter(
clk: clk,
reset: reset,
enable: enable,
count: count,
);
// Build the module
dut.build();
}
}
/// Main test for counter
void main() {
group('counter tests', () {
late CounterTestModule testModule;
late Simulator sim;
setUp(() async {
testModule = CounterTestModule(
clk: Logic(),
reset: Logic(),
enable: Logic(),
count: Logic(width: 8),
);
await testModule.build();
sim = Simulator(testModule);
});
tearDown(() async {
await sim.reset();
});
test('counter_basic_test', () async {
unawaited(sim.run());
// Test sequence generated from simulation history
await testModule.clk.nextPosedge;
testModule.reset.put(LogicValue.of('1'));
await testModule.clk.waitCycles(2);
testModule.reset.put(LogicValue.of('0'));
await testModule.clk.nextPosedge;
testModule.enable.put(LogicValue.of('1'));
await testModule.clk.waitCycles(1);
await sim.endSimulation();
});
});
}
Custom Test Generation
// Generate test with custom sequence
generate_rohd_test({
testName: "custom_counter_test",
moduleName: "counter",
options: {
includeImports: true,
customTestSequence: [
{ action: "next_posedge", parameters: { clockName: "clk" } },
{ action: "force_signal", parameters: { signalName: "reset", value: "1" } },
{ action: "wait_cycles", parameters: { cycles: 3 } },
{ action: "force_signal", parameters: { signalName: "reset", value: "0" } },
{ action: "expect_signal", parameters: { signalName: "count", expectedValue: "00000000" } }
]
}
})
ROHD-VF Inspired Workflow Examples
The server now supports ROHD Verification Framework (ROHD-VF) inspired methods for precise simulation control:
Basic Clock Control Workflow
// Start simulation
start_simulation({ moduleName: "counter", clockPeriod: 10 })
// Wait for 5 complete clock cycles
wait_cycles({ clockName: "clk", cycles: 5 })
// Wait specifically for next positive edge
next_posedge({ clockName: "clk" })
// Apply stimulus and wait for negative edge
force_signal({ signalName: "reset", value: "1" })
next_negedge({ clockName: "clk" })
force_signal({ signalName: "reset", value: "0" })
Advanced Signal Monitoring
// Setup signal watching
watch_signal({ signalName: "counter_out" })
watch_signal({ signalName: "overflow" })
// Wait for specific signal change
wait_signal_change({
signalName: "overflow",
expectedValue: "1",
maxWaitTime: 1000
})
// Check all watched signals
get_watched_signals()
Testbench-style Simulation
// Initialize
start_simulation({ moduleName: "dut" })
next_posedge({ clockName: "clk" })
// Apply reset sequence
force_signal({ signalName: "reset_n", value: "0" })
wait_cycles({ cycles: 2 })
force_signal({ signalName: "reset_n", value: "1" })
next_posedge()
// Run test stimulus
for (let i = 0; i < 10; i++) {
force_signal({ signalName: "data_in", value: i.toString(2) })
next_posedge()
// Check outputs here
}
Advanced Simulation Analysis
The ROHD MCP Server provides powerful analysis capabilities for deep insight into hardware designs and verification:
Coverage and Metrics
// Collect comprehensive coverage data
collect_coverage({ modules: ["counter", "alu"] })
// Get simulation performance metrics
get_simulation_performance()
// Analyze module complexity and resource usage
analyze_module({ moduleName: "counter" })
Debug and Visualization
// Generate VCD waveform files for signal analysis
create_waveform_dump({
filename: "counter_test.vcd",
signals: ["clk", "reset", "count", "overflow"]
})
// Inspect design hierarchy and connections
inspect_module_hierarchy({ rootModule: "top_level" })
// Trace signal fanout and connections
trace_signal_fanout({ signalName: "clk" })
State Management
// Export complete simulator state for checkpointing
dump_internal_state()
// Restore from previous checkpoint
restore_internal_state({ stateData: previousStateData })
Advanced Features
- Coverage Analysis: Line, branch, and functional coverage collection
- Performance Profiling: Simulation speed, memory usage, event metrics
- Design Analysis: Module complexity, critical paths, resource utilization
- Waveform Generation: VCD export for signal visualization
- Hierarchy Inspection: Design structure and connectivity analysis
- Signal Tracing: Fanout analysis and connection paths
- State Checkpointing: Export/restore simulator state for debugging
These tools enable comprehensive verification workflows from basic simulation to advanced coverage-driven verification and performance optimization.
Documentation
Quick References
- 📚 - Fast setup and first steps
- 🔧 - Comprehensive installation guide
- 📖 - Complete LLM setup and configuration
- �️ - All tools, examples, and workflows
Setup Scripts
install-prerequisites.sh- Install Node.js, npm, and build toolssetup-server.sh- Project setup and buildstart-server.sh- Start server with various optionstest-server.sh- Verify server functionality
Development
Project Structure
rohd-mcp-server/
├── src/
│ └── index.ts # Main server implementation
├── build/ # Compiled JavaScript output
├── .vscode/ # VS Code configuration
│ ├── tasks.json # Build and run tasks
│ ├── launch.json # Debug configurations
│ └── mcp.json # MCP server configuration
├── install-prerequisites.sh # Prerequisites installer
├── setup-server.sh # Project setup script
├── start-server.sh # Server startup script
├── test-server.sh # Server test script
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Available Scripts
npm run build: Compile TypeScript to JavaScriptnpm run dev: Run in development mode with auto-reloadnpm start: Start the compiled servernpm test: Run testsnpm run clean: Clean build directory
VS Code Tasks
- Build ROHD MCP Server: Compile the project
- Start ROHD MCP Server: Run the server
- Dev Mode (Auto-reload): Run in development mode
- Test MCP Server with Inspector: Test with MCP Inspector
- Clean Build: Clean the build directory
📖 Documentation Organization
November 2025: Project documentation has been streamlined into comprehensive guides for better usability:
Current Documentation Structure
- : Everything needed for LLM setup, configuration, and verification
- : All 43 MCP tools, examples, and professional workflows
- : Get running in 5 minutes
- : Detailed setup procedures
- : Feature overview and capabilities
Clean Documentation: Incremental enhancement files have been removed after consolidation to maintain a focused, professional documentation set.
Architecture
This server implements a simplified simulation of ROHD functionality for demonstration purposes. In a production environment, this would interface with actual ROHD libraries and simulation engines.
Current Implementation
- ROHDSimulator Class: Manages modules, signals, and test benches in memory
- Simulation Engine: Simplified logic evaluation for demonstration
- Verilog Generation: Basic template-based code generation
Future Enhancements
- Integration with actual ROHD Dart libraries
- Support for SystemVerilog generation
- Advanced simulation features (timing, power analysis)
- Waveform generation and analysis
- Support for more complex logic types (sequential, memory, etc.)
Development Setup
First Time Setup
# Clone the repository
git clone <repository-url>
cd rohd-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Validate setup
./validate-mcp-setup.sh
Testing
# Run validation tests
./validate-mcp-setup.sh
# Test MCP connectivity
node test-mcp-connectivity.cjs
# Test with MCP Inspector
npx @modelcontextprotocol/inspector node build/index.js
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
MIT License - see LICENSE file for details
Related Projects
- ROHD - Rapid Open Hardware Development framework
- Model Context Protocol - Protocol specification
- MCP SDK - TypeScript SDK for MCP