MCP Server#
DiTTo provides a Model Context Protocol (MCP) server that exposes its full reader/writer pipeline, model inspection, and documentation to LLM applications such as Claude Desktop, VS Code Copilot, and Claude Code.
Installation#
The MCP server is included with DiTTo. The mcp dependency is installed
automatically with the core package:
pip install nrel-ditto
Or install only the MCP extra:
pip install nrel-ditto[mcp]
Running the Server#
Direct execution (stdio transport)#
ditto_mcp
Or as a Python module:
python -m ditto.mcp.server
Development mode with MCP Inspector#
uv run mcp dev src/ditto/mcp/server.py --with-editable .
Claude Desktop integration#
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"ditto": {
"command": "ditto_mcp"
}
}
}
VS Code / Claude Code integration#
claude mcp add ditto -- ditto_mcp
Available Tools#
Discovery#
Tool |
Description |
|---|---|
|
List available reader formats (e.g. opendss, cim_iec_61968_13) |
|
List available writer formats (e.g. opendss) |
Loading Models#
Tool |
Description |
|---|---|
|
Load an OpenDSS model from a |
|
Load a CIM IEC 61968-13 XML model |
|
Load a previously-exported GDM JSON file |
Inspection#
Tool |
Description |
|---|---|
|
Show names of all systems currently in memory |
|
Component counts and type breakdown for a loaded system |
|
List components of a given type (buses, loads, lines, etc.) |
|
Full Pydantic model dump of a single component |
Writing / Export#
Tool |
Description |
|---|---|
|
Write a loaded system to OpenDSS |
|
Serialize a loaded system to GDM JSON |
|
Full read → write conversion between formats |
Available Resources#
Documentation pages are exposed as MCP resources under the ditto://docs/ URI
scheme:
Resource URI |
Content |
|---|---|
|
Index of all available documentation pages |
|
Project overview and architecture |
|
Installation instructions |
|
Usage guide with code examples |
|
API reference overview |
|
OpenDSS reader API docs |
|
CIM reader API docs |
|
OpenDSS writer API docs |
Available Prompts#
Prompt |
Description |
|---|---|
|
Step-by-step interactive guide for format conversion |
|
Interactive workflow for exploring a loaded model |
Example Workflow#
A typical interaction with the DiTTo MCP server:
List formats: Ask the LLM to call
list_readersandlist_writersLoad a model: Call
read_opendss_modelwith a path toMaster.dssInspect: Use
get_system_summaryto see what’s in the modelBrowse components: Use
get_componentsto list buses, loads, etc.Export: Use
write_opendssorexport_gdm_jsonto save the modelRead docs: Access
ditto://docs/usagefor detailed usage guides
Architecture#
flowchart TD
A["LLM Client\n(Claude, VS Code, etc.)"] <-->|"MCP Protocol\n(stdio)"| B["DiTTo MCP Server"]
B --> C["Tools"]
B --> D["Resources"]
B --> E["Prompts"]
C --> F["Readers\n(OpenDSS, CIM)"]
C --> G["Writers\n(OpenDSS)"]
C --> H["GDM System\nInspection"]
D --> I["Documentation\n(Markdown)"]