Spaces:
Running
title: PowerMCP - Power System Analysis MCP Server
emoji: ⚡
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 6.1.0
app_file: app.py
pinned: false
license: mit
tags:
- mcp
- power-systems
- electrical-engineering
- simulation
- model-context-protocol
⚡ PowerMCP - Power System Analysis MCP Server
This is an MCP-enabled Hugging Face Space for PowerMCP - an open-source collection of Model Context Protocol (MCP) servers for power system software. This Space can be added as an MCP tool to Claude Desktop, Cursor, or any other MCP-compatible client with a single click!
🌟 What is PowerMCP?
PowerMCP enables Large Language Models (LLMs) to directly interact with power system applications through the Model Context Protocol. It bridges the gap between AI and power system analysis, facilitating:
- Intelligent Power Flow Analysis: Let AI perform complex power system simulations
- Automated Contingency Analysis: AI-driven evaluation of grid contingencies
- Dynamic Simulation: Transient stability and time-domain analysis
- Energy System Optimization: Network expansion and optimal power flow
- Professional Report Generation: AI-generated analysis reports
🔧 Supported Power System Tools
🔌 pandapower
Python-based power system analysis focusing on power flow and contingency analysis.
- Create and manage power networks
- AC/DC power flow calculations
- N-1 and N-2 contingency analysis
- Network modification and optimization
⚡ PyPSA (Python for Power System Analysis)
Energy system optimization and network expansion planning.
- Multi-period optimization
- Unit commitment and economic dispatch
- Network expansion planning
- Renewable integration analysis
🌊 ANDES
Dynamic simulation and transient stability analysis.
- Time-domain simulation
- Transient stability analysis
- Small-signal stability
- Dynamic model library
🚀 Quick Start
Option 1: Install from GitHub (Local MCP Server)
# Install PowerMCP
pip install git+https://github.com/Power-Agent/PowerMCP.git
# Configure Claude Desktop (macOS)
# Edit: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"pandapower": {
"command": "powermcp-pandapower"
}
}
}
# Restart Claude Desktop and start using PowerMCP!
See INSTALL.md for detailed installation instructions.
Option 2: Use Hugging Face Space as MCP Tool
Install an MCP Client:
- Claude Desktop
- Cursor
- Windsurf
- VS Code with Cline extension
Add PowerMCP to Your Client:
- Click the MCP badge on this Space
- Select "Add to MCP tools"
- Confirm when prompted
- The tools will be available instantly in your MCP client!
Use PowerMCP in Your AI Assistant:
Ask Claude: "Create a power network and run power flow analysis" Ask Cursor: "Load test_case.json and perform N-1 contingency analysis"
Option 2: Use Web Interface
- Select a power system tool (pandapower, PyPSA, or ANDES)
- Click "List Available Tools" to see all functions
- Enter the tool name and arguments in JSON format
- Click "Execute Tool" to run
- View results in JSON format
📖 Example Usage
In MCP Clients (Claude Desktop, Cursor, etc.)
# Create and analyze a power network
create_empty_network(server="pandapower")
load_network(file_path="test_case.json", server="pandapower")
run_power_flow(server="pandapower", algorithm="nr")
get_network_info(server="pandapower")
# Run contingency analysis
run_contingency_analysis(
server="pandapower",
contingency_type="N-1",
elements=["line", "trafo"]
)
# PyPSA optimization
create_network(name="my_network", server="pypsa")
add_bus(network_name="my_network", bus_id="bus1", v_nom=380.0, server="pypsa")
run_optimization(network_name="my_network", server="pypsa")
# ANDES dynamic simulation
run_power_flow(file_path="kundur_full.json", server="andes")
run_time_domain_simulation(
file_path="kundur_full.json",
end_time=10.0,
step_size=0.01,
server="andes"
)
In Web Interface
Create an Empty Network
Tool Name: create_empty_network
Arguments: {}
Load a Network
Tool Name: load_network
Arguments: {"file_path": "PowerMCP/pandapower/test_case.json"}
Run Power Flow
Tool Name: run_power_flow
Arguments: {"algorithm": "nr"}
🎯 Available Tools by Server
pandapower Tools
create_empty_network()- Create new empty networkload_network(file_path)- Load from JSON/picklerun_power_flow(algorithm, ...)- Power flow analysisrun_contingency_analysis(contingency_type, elements)- N-1/N-2 analysisget_network_info()- Network statistics
PyPSA Tools
create_network(name, snapshots, crs)- Create PyPSA networkadd_bus(network_name, bus_id, v_nom, x, y, carrier)- Add busadd_generator(network_name, generator_id, bus, p_nom, ...)- Add generatorrun_optimization(network_name)- Optimal power flowget_network_info(network_name)- Network information
ANDES Tools
run_power_flow(file_path)- Power flow with ANDESrun_time_domain_simulation(file_path, end_time, step_size)- Dynamic simulationget_bus_results()- Bus voltage/angle results
💻 Development
Deploy Your Own Space
- Fork this repository
- Create a new Space on Hugging Face
- Choose Gradio SDK and link your repository
- The Space will automatically get the MCP badge!
Running Locally
git clone https://github.com/Power-Agent/PowerMCP.git
cd PowerMCP
pip install -r requirements.txt
python app.py
Local MCP Configuration
For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"pandapower": {
"command": "/usr/local/bin/python3",
"args": ["/path/to/PowerMCP/PowerMCP/pandapower/panda_mcp.py"]
}
}
}
🔗 Resources
- GitHub: Power-Agent/PowerMCP
- MCP Docs: modelcontextprotocol.io
- Tutorial: PowerMCP Tutorial
- Gradio MCP Guide: Building MCP Servers
🎥 Video Demos
📄 License
MIT License - See LICENSE file for details
🤝 Contributing
Contributions welcome! PowerMCP is community-driven. Help us accelerate AI adoption in power systems.
Built with ❤️ by the PowerMCP Community