Content
# EDI MCP Service
[](https://pypi.org/project/edi-mcp/)
Each computer with EDI installed runs a local MCP service, which wraps the gRPC interface, command-line tools, and ANSYS HFSS of EDA-PMDS/EDI into MCP tools (`copy_image_to_workspace` needs to be configured with `OPENCLAW_WORKSPACE` to register), supporting **SSE** and **stdio** transport methods, allowing AI clients to operate EDA projects through natural language.
## Quick Start
### 1. Installation
**Method A: PyPI (Recommended)**
```powershell
pip install edi-mcp
```
**Method B: Source Code**
```powershell
git clone <repo-url>
cd mcp-grpc
uv sync
```
### 2. Configure `.env`
Create a `.env` file in the project root directory (or running directory):
```ini
EDA_GRPC_SERVER=127.0.0.1:50055
# EDI/TurboCharts path: leave blank to automatically detect ../ directory of EDI.exe/EDA-PMDS.exe/CAIS.exe
EDI_PATH=C:\Program Files (x86)\EDI\EDI.exe
TURBOCHARTS_PATH=C:\Program Files (x86)\EDI\turbocharts_app.exe
MCP_TRANSPORT=sse
MCP_HOST=127.0.0.1
MCP_PORT=50026
# OpenClaw workspace (enable copy_image_to_workspace, leave blank to not register the tool)
OPENCLAW_WORKSPACE=C:\Users\JGL\.openclaw\workspace
# Optional, for chat client AI conversation
LLM_API_KEY=sk-xxx
LLM_BASE_URL=https://api.deepseek.com
LLM_MODEL=deepseek-chat
```
### 3. Prerequisites
- EDA gRPC service available: `netstat -ano | findstr 50055`
- `.epp` project file exists
- Turbocharts functionality requires `turbocharts_app.exe`
### 4. Start
**HTTP Mode (Recommended)** — Multiple local clients share a process:
```powershell
# PyPI installation
edi-mcp --transport sse
# Source code running
cd D:\GitLabCode\mcp-grpc
uv run python start_servers.py
```
Output example:
```
==================================================
EDI MCP v0.1.3
UI: http://127.0.0.1:50026/ui
MCP: http://127.0.0.1:50026/sse
Tools: loaded(default 25, 26 with OPENCLAW_WORKSPACE configured)
gRPC: 127.0.0.1:50055 [ONLINE]
Close window to stop
==================================================
```
After starting, listen on `127.0.0.1:50026`:
- All local clients connect through `http://127.0.0.1:50026/sse`
- EDI gRPC operations are guaranteed to be serialized by a global lock
- Turbocharts is guaranteed to have one process at a time by a semaphore
- `/health` health check — Returns EDA gRPC and Turbocharts status
- `/ui` chat client — Natural language drives all tools, with a tool panel and system theme
- `/chat` chat API — POST `{"message":"..."}` returns LLM + tool execution result
- Chat client file: `servers/chat/index.html` (in the same directory as the route)
**stdio Mode** — MCP client manages the process lifecycle, suitable for single-client debugging:
```powershell
# PyPI installation
edi-mcp --transport stdio
# Source code running
uv run python start_servers.py --transport stdio
```
> In stdio mode, do not output anything to stdout (MCP protocol channel), and the process is automatically started and stopped by the client.
**Custom Port**:
```powershell
edi-mcp --port 9000
```
## Usage
### Method 1: Start Service from Command Line
```powershell
edi-mcp --transport sse --port 50026
```
After starting, access `http://127.0.0.1:50026/ui` to use the chat interface or connect to the MCP client.
### Method 2: Python Calls Tool Functions
```python
from servers.eda.project_manage import list_epp_projects
from servers.eda.simulation import simulate_project, start_simulation_async
# Scan projects
r1 = list_epp_projects("C:/Users/JGL/Desktop")
# r1: {"success": True, "count": 3, "projects": [...]}
# Start asynchronous simulation
r2 = start_simulation_async("C:/Projects/test/test.epp")
# r2: {"success": True, "task_id": "abc123...", "status": "QUEUED"}
```
### Method 3: MCP Client Connection
Claude Code, OpenClaw, and other MCP clients connect and call all tools with natural language. No code is required.
## Client Configuration
Each computer's `127.0.0.1` points to itself, with services and files on the local machine.
| Client | Configuration |
|---|---|
| Claude Code | `.mcp.json` configured, `/mcp` reloaded |
| OpenClaw / Web | Name `eda`, SSE, `http://127.0.0.1:50026/sse` |
| Other stdio clients | `uv --directory D:/GitLabCode/mcp-grpc run python start_servers.py --transport stdio` |
Other MCP client general configuration:
```json
{
"mcpServers": {
"eda": {
"command": "uv",
"args": ["--directory", "D:/GitLabCode/mcp-grpc", "run", "python", "start_servers.py", "--transport", "stdio"],
"env": { "EDA_GRPC_SERVER": "127.0.0.1:50055" }
}
}
}
```
## Tool Reference (Default 25, 26 with Workspace Configured)
### Project Management
| Tool | Description | Parameters |
|---|---|---|
| `list_epp_projects` | Scan folder for .epp projects | `folder_path` |
| `open_edi_project` | Open .epp project | `project_path`, `timeout_seconds` (default 60) |
| `close_edi_project` | Close project | `project_path`, `need_save` (default false) |
| `list_project_components` | List all components in project | `project_path`, `schematic_name`, `component_type`, `name_contains` |
| `get_component_parameters` | Query all parameters of a single component | `project_path`, `component_id`, `schematic_name`, `include_hidden` |
| `get_project_summary` | Project overview (metadata/schematic/simulation) | `project_path`, `include_component_types`, `include_latest_result` |
### Simulation
| Tool | Description | Parameters |
|---|---|---|
| `simulate_project` | Execute project simulation (synchronous) | `project_path` | `log_source`, `timeout_seconds` (default 600) |
| `start_simulation_async` | Start asynchronous simulation | `project_path` | `log_source`, `timeout_seconds` |
| `get_simulation_async_status` | Query asynchronous simulation status | `task_id` | - |
| `get_simulation_async_result` | Get asynchronous simulation result | `task_id` | - |
| `simulate_netlist` | Simulate netlist, return RAW result | `netlist_path` | `timeout_seconds` (default 600) |
| `simulate_netlist_with_ads` | Call ADS simulation controller | `netlist_path` | `ads_path`, `timeout_seconds` (default 120) |
### Export and Analysis
| Tool | Description | Parameters |
|---|---|---|
| `export_project_netlist` | View/export project netlist | `project_path`, `timeout_seconds` (default 60) |
| `capture_schematic` | Capture schematic as image | `project_path`, `img_path`, `timeout_seconds` (default 60) |
### Model and Launch
| Tool | Description | Parameters |
|---|---|---|
| `replace_models_from_csv` | Batch replace models from CSV | `project_path`, `csv_path`, `timeout_seconds` (default 60) |
| `launch_edi` | Launch EDI client | `edi_path`, `wait_for_grpc` (default true), `wait_timeout` |
### ANSYS HFSS
| Tool | Description | Parameters |
|---|---|---|
| `open_hfss_project` | Launch AEDT and open .aedt project (COM priority/verification) | `project_path`, `aedt_path`, `wait_timeout` |
| `close_hfss_project` | Close AEDT project (COM priority/forcible) | `project_name`, `save_before_close`, `force` |
| `launch_aedt` | Launch AEDT (running detection + readiness wait) | `aedt_path`, `wait_timeout` |
| `get_hfss_project_info` | Get project list/active project/design | — |
| `start_hfss_analysis_async` | Asynchronously launch HFSS simulation | `project_path`, `design_name`, `setup_name` |
| `get_hfss_analysis_status` | Query HFSS simulation status | `task_id`, `refresh_from_aedt` |
### Image
| Tool | Description | Parameters |
|---|---|---|
| `show_image` | Return MCP ImageContent (native image) | `image_path` |
| `copy_image_to_workspace`* | Copy to workspace (need to configure OPENCLAW_WORKSPACE) | `image_path` |
### Chart
| Tool | Description | Parameters |
|---|---|---|
| `compare_simulation_results` | Compare multiple RAW curves | `result_paths`, `curve`, `img_path`, `chart_type`, `labels`, `dependency` |
| `turbocharts_convert` | ADS RAW → curve graph + CSV | `raw_path`, `img_path`, `chart_type`, `csv_path`, `linename`, `dependency`, `ac_config` |
Natural language call example:
```
Help me see what .epp projects are in C:/.../EDI-Workspace
Help me open EDA project C:/.../EDI_TEST.epp
Help me view the netlist of this project
Help me see what components this project has
Help me simulate this project
Help me convert result_tr.raw to S-parameter gain curve graph, output gain.png, curve DB_S[2,1], dependent on axis freq
```
### turbocharts_convert Parameter Details
**linename** — `unit_curvename[port]`, multiple separated by `&`:
| DB_S[2,1] (Gain) | DB_S[1,2] (Reverse Gain) | real_nf(1) (Noise) | VSWR_S[1,1] (VSWR) | real_delayS[2,1] (Delay) |
|---|---|---|---|---|
| APS_S[2,1] (Additional Phase) | MAS_S[2,1] (Attenuation State) | MV_S[2,1] (Amplitude Fluctuation) | PSS_S[2,1] (Phase Shift State) | |
**chart_type**: `SP` / `HB` / `XDB`
**ac_config** — `ac_type#bit#data#nv_type#nv_value`:
| Segment | Meaning | Example |
|---|---|---|
| ac_type | `phase` (phase) or `att` (attenuation) | `phase` |
| bit | Precision bit | `3` |
| data | Curve name | `S[2,1]` |
| nv_type | `fv` (fixed interval) or `cl` (complete list) | `fv` |
| nv_value | Interval value or comma-separated value list | `0.1` |
## Project Structure
```
├── proto/ # protobuf
│ ├── ecserver.proto
│ ├── ecserver_pb2.py
│ └── ecserver_pb2_grpc.py
├── servers/
│ ├── mcp_instance.py # Global MCP instance (decorator registration)
│ ├── registry_server.py # Tool import entry + Web route registration
│ ├── chat/ # Chat module
│ │ ├── service.py # Chat service (session/LLM/tool loop)
│ │ ├── routes.py # Web route (/health /chat /ui /tools/list)
│ │ └── index.html # Chat frontend page
│ ├── image_tools.py # Image tools — show_image + copy (2 tools)
│ ├── eda/
│ │ ├── config.py # Configuration + validate_file + ProjectReader + S-expression
│ │ ├── grpc_client.py # gRPC communication (with EDA global lock)
│ │ ├── project_manage.py # Project management (6 tools)
│ │ ├── simulation.py # Simulation (6 tools)
│ │ ├── design_export.py # Netlist/screenshot (2 tools)
│ │ ├── model_replace.py # Model replacement (1 tool)
│ │ └── edi_launcher.py # Launch EDI (1 tool)
│ ├── turbocharts/
│ │ ├── config.py # Common functions (run_turbocharts)
│ │ ├── convert_raw.py # RAW to graph (1 tool)
│ │ └── compare_results.py # Simulation comparison (1 tool)
│ └── ansys/ # ANSYS tools (6)
│ ├── config.py # Common tools (process detection/COM attachment/lock file)
│ ├── project_manage.py # Project management + information query
│ └── run_analysis.py # Asynchronous simulation
├── docs/ # Documentation
│ ├── API_REFERENCE.md # API reference
│ ├── HANDOVER.md # Handover document
│ ├── grpc接口调用.md # gRPC protocol description
│ └── EDI系统接口与外部调用汇总.md # EDI interface summary
├── start_servers.py # Entry
├── tests/ # Test suite
├── scripts/
│ ├── build.ps1 # Packaging script
│ ├── run.bat # Windows startup script
│ └── edi_mcp_server.spec # PyInstaller configuration
├── .mcp.json # Claude Code configuration
├── .env # Configuration file (not submitted to Git)
├── LICENSE # MIT license
└── pyproject.toml
```
## Frequently Asked Questions
**Port Occupation**
```powershell
netstat -ano | findstr 50026 # Check occupation
taskkill -f -pid <PID> # Close process
```
**Check EDA Status**
```powershell
netstat -ano | findstr 50055 # gRPC: LISTENING = running
tasklist | findstr EDI.exe # EDI process
```
**Startup Failure**
- Confirm that `EDA_GRPC_SERVER` configuration in `.env` is correct (`EDI_PATH`/`TURBOCHARTS_PATH` leave blank to auto-detect)
- Run `uv sync` to confirm dependencies are installed
- Confirm EDA gRPC service has started
**Health Check**
```
curl http://127.0.0.1:50026/health
# → {"status":"ok", "mcp_ready":true, "eda_grpc_ready":true}
```
---
## Precautions
- `project_path` must be an existing `.epp` file
- `timeout_seconds` must be > 0, exceeding operation limit will result in an error (open/close 300s, simulate 3600s, turbocharts 600s)
- Do not output debug information to stdout in stdio mode
- `.env` configuration is automatically loaded when the service starts
---
## Development
### Run Tests
```powershell
uv run python tests/test_project_reader.py
uv run python tests/test_component_tools.py
uv run python tests/test_turbocharts_runner.py
uv run python tests/test_health.py
uv run python tests/test_tool_registry.py
```
### Run Full Test Suite
```powershell
uv run pytest -q -p no:cacheprovider
```
### Packaging and Release
**PyPI Release** (source package):
Create `.pypirc` configuration for PyPI credentials (added to `.gitignore`, will not be committed):
```ini
[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-xxxxxxxxxxxx
```
Release:
```powershell
uv build
uv publish
```
**PyInstaller Packaging** (no-install binary package):
```powershell
powershell -File scripts/build.ps1
# Output: dist/edi-mcp/ (contains edi_mcp_server.exe + start_server.bat + .env, approximately 90 MB)
```
### Add New Tool
1. Add function + `@mcp.tool()` decorator to corresponding classification file
2. Import the module in `servers/registry_server.py` (triggers decorator registration)
### Regenerate Proto
```powershell
python -m grpc_tools.protoc -I proto --python_out=proto --grpc_python_out=proto proto/ecserver.proto
# Edit proto/ecserver_pb2_grpc.py line 5: import ecserver_pb2 → from proto import ecserver_pb2
```
### Related Documents
- [Deployment Guide](./docs/DEPLOY.md) — Usage of packaged products & configuration of intelligent body Claude Code / OpenClaw
- [API Reference](./docs/API_REFERENCE.md) — Parameters, return values, and usage examples of all 25 functions
- [Handover Document](./docs/HANDOVER.md) — Architecture, technical stack, and communication process
- [Interface Summary](./docs/EDI系统接口与外部调用汇总.md) — EDI full interface documentation
- [gRPC Protocol](proto/grpc接口调用.md) — Underlying gRPC call instructions
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
No recommendations available