DRP Grid Planning MCP Server
Provides tools for querying PG&E's DRP Compliance / GRIP ArcGIS FeatureServer, including listing and inspecting layers, running SQL and spatial queries, searching substations and feeders, checking ICA hosting capacity, retrieving 8760 load profiles, looking up High Fire Threat District tiers, and querying GNA grid deficiencies and planned investments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DRP Grid Planning MCP ServerShow ICA hosting capacity for feeders near Manteca"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PG&E Electric Distribution & DRP Grid Planning AI Suite
Model Context Protocol (MCP) Server & Deep Agents Conversational Assistant
An enterprise-grade electric distribution engineering suite providing structured, high-performance conversational AI and MCP tooling over Pacific Gas & Electric's (PG&E) Grid Resource Integration Portal (GRIP) / Distribution Resource Plan (DRP) Compliance ArcGIS FeatureServer.
Built to comply with California Public Utilities Commission (CPUC) regulatory mandates for Distributed Energy Resource (DER) hosting capacity, solar PV interconnection, 8760 hourly load profiles, High Fire Threat Districts (HFTD), and Grid Needs Assessment (GNA) non-wires alternatives (NWA).
πΈ Interface Preview
1. Conversational Grid Planning & Formatted Engineering Tables
Inspect multi-feeder capacity, transformer bank constraints, and deficiency projections in clean, styled Markdown tables:

2. Multi-Facility Substation Comparison
Compare substations by operating voltage (kV), bank capacity, installed distributed generation, and queued projects with instant latency:

3. Automated 1-Click Verification Test Bench
Live end-to-end regression suite validating all 6 core electric distribution domains directly against PG&E FeatureServer endpoints:

Related MCP server: mcp-arcgis-fairfield
β‘ Core Architecture
graph TD
User([User / Browser]) <--> WebUI[FastAPI Glassmorphic Web App\nhttp://127.0.0.1:8000]
IDE([Antigravity / Claude Desktop / Cursor]) <--> MCPServer[Node.js MCP Server\nStdio Transport: src/index.js]
WebUI <--> DeepAgent[LangChain Deep Agent Engine\nchatbot/agent.py]
DeepAgent <--> Rotator[Resilient Model Rotation Pool\nGemini Flash-Lite β Flash β Ollama]
DeepAgent <--> SQLite[(SQLite Session Memory\ndata/chatbot_sessions.db)]
DeepAgent <--> Tools[Abstracted Python Grid Tools\nchatbot/tools.py]
MCPServer <--> ToolsJS[10 MCP Tools\nsrc/tools.js]
Tools <--> ArcGIS[(PG&E DRP Compliance FeatureServer\n21 Layers & 2 Tables)]
ToolsJS <--> ArcGISπΊοΈ FeatureServer Architecture & Layer Inventory
Base REST URL:
https://services2.arcgis.com/mJaJSax0KPHoCNB6/ArcGIS/rest/services/DRPComplianceRelProd/FeatureServerNative Spatial Reference: EPSG:102100 / EPSG:3857 (Web Mercator) with automatic transformation to EPSG:4326 (WGS84 Lat/Long).
Service Specs: 21 Feature Layers, 2 Non-spatial Attribute Tables, Max 2,000 records/request.
Layer ID | Name | Type | Geometry | Records | Functional Domain & Description |
0 |
| Feature Layer | Point | 776 | Electric Distribution Substations. Contains voltage ( |
1 |
| Feature Layer | Point | 0 | Electric Transmission Substations placeholder. |
2 |
| Feature Layer | Polyline | 3,259 | Distribution Feeders. Tracks customer counts (Residential, Commercial, Industrial, Agricultural) and DG totals. |
3 |
| Feature Layer | Polyline | 2,086,800 | ICA Primary Layer. Over 2 million line segments with |
4 |
| Feature Layer | Polyline | 734,746 | Feeder segments where ICA calculations are currently not available or not evaluated. |
5 |
| Feature Layer | Polyline | 2,439 | Transmission lines with SAP functional location and rated kV. |
6 |
| Feature Layer | Polygon | 2 | Specialized secondary grid network buffer zones. |
8 |
| Feature Layer | Point | 157 | Planned and in-flight substation expansion projects (ratings, CPUC/CAISO approval, in-service dates). |
9 |
| Feature Layer | Polyline | 99 | Transmission line upgrade projects and milestones. |
10 |
| Feature Layer | Polyline | 552 | Grid Needs Assessment line section view with deficiency dates and ratings. |
11 |
| Feature Layer | Polyline | 3,165 | Grid Needs Assessment circuit-level deficiency and need overview. |
12 |
| Feature Layer | Polyline | 2,727 | Circuit-level DER forecast (446 attributes) for Battery Storage, Solar PV, and EV adoption (2026β2035). |
13 |
| Feature Layer | Polyline | 3,050 | Distribution Forecast (DF) circuit loading and ratings. |
18 |
| Feature Layer | Polygon | 5,336 | CPUC High Fire Threat Districts: Tier 2 (Elevated) and Tier 3 (Extreme). |
19 |
| Feature Layer | Polyline | 30,758 | Formally submitted and known interconnect load requests with expected MW amount. |
28 |
| Feature Layer | Point | 4,457 | GNA substation peak facility deficiency projections (MW and %) for years 2026β2035. |
29 |
| Feature Layer | Point | 1,340 | Locational Net Benefits Analysis (LNBA) planned investments and deferrable projects ($/unit/yr). |
30 |
| Feature Layer | Point | 360 | Distribution Upgrade Requirements (DUR) tracking: scoping, design, and construction status. |
31 |
| Feature Layer | Point | 4,316 | Distribution Forecast peak facility loading % projections (2026β2035). |
32 |
| Feature Layer | Polygon | 36 | California Title 24 Climate Zones ( |
33 |
| Feature Layer | Polyline | 108 | Interconnect requests under preliminary review. |
23 |
| Table | None | 637,056 | 8760 Feeder Load Curves. Hourly low and high loads (kW) by MonthHour ( |
25 |
| Table | None | 182,856 | 8760 Substation Load Curves. Hourly low and high loads (MW) by MonthHour. |
π οΈ Tooling & Capabilities
Python LangChain Tools (chatbot/tools.py)
search_substations: Search distribution substations by name, ID, division, or minimum DG thresholds.search_feeders: Search circuits by feeder ID, feeder name, parent substation, or customer categories.check_ica_hosting_capacity: Inspect line section ICA load & gen capacity kW, PV capacity, and Screen L pass status.get_load_profile_summary: Query 8760 hourly load profiles and calculate peak high, minimum low, and average kW/MW curves.check_fire_hazard_zone: Spatial point-in-polygon check to determine if coordinates fall within CPUC Tier 2 or Tier 3 fire zones.check_grid_deficiencies: Query GNA grid deficiencies (overload MW/%) and LNBA planned investments.query_layer_direct: Direct SQL query for any layer or table in the FeatureServer catalog.
Model Context Protocol (MCP) Tools (src/tools.js)
Exposes 10 native MCP tools over Stdio transport for IDE integration with Google Antigravity, Claude Desktop, and Cursor:
arcgis_list_layers,arcgis_get_layer_details,arcgis_query_layer,arcgis_spatial_queryarcgis_search_substations,arcgis_search_feeders,arcgis_get_ica_capacityarcgis_get_load_profile,arcgis_get_fire_threat_info,arcgis_get_grid_deficiencies
π Dynamic Model Rotation Pool
To guarantee uninterrupted service and avoid downtime from LLM rate limits (HTTP 429), the chatbot features an automatic Model Rotation Pool:
google_genai:gemini-flash-lite-latest: Primary ultra-low latency model (~1.2s β 2.4s end-to-end turns).google_genai:gemini-3.5-flash: High-reasoning cloud fallback.google_genai:gemini-3.1-flash-lite: Supplementary fast tier.google_genai:gemini-3.6-flash: High capacity fallback.google_genai:gemini-2.5-flash: Stable general tier.ollama:llama3.2: Local offline guaranteed fallback running on localhost.
When quota exhaustion is detected, the engine instantly rotates to the next available model in 400ms without dropping the user's conversation state.
π Quick Start Guide
1. Clone & Set Up Environment
git clone https://github.com/SrikarPrayaga06/pge-drp-grip-ai-assistant.git
cd pge-drp-grip-ai-assistant
# Create Python virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Install Node dependencies for MCP
npm install2. Configure API Keys
Copy the example environment file and provide your Google Gemini API key:
cp .env.example .env
# Edit .env and paste your GOOGLE_API_KEY3. Launch Web Application
.venv/bin/uvicorn chatbot.server:app --host 127.0.0.1 --port 8000Visit http://127.0.0.1:8000 in your browser to access:
π¬ Chat Assistant: Interactive grid planning assistant with session persistence.
π§ͺ Verification Bench: 1-Click live testing suite for all 6 core grid domains.
π Layer Explorer: Ad-hoc SQL querying across all 21 layers.
4. Run Interactive CLI
.venv/bin/python3 -m chatbot.cli5. Run Verification Suites
# Run Python Chatbot & Agent Test Suite (8 tests in ~12s)
.venv/bin/python test_chatbot.py
# Run Node.js MCP Integration Suite (10 tools tested)
npm testπ Configuring in MCP Clients (Claude Desktop / Antigravity / Cursor)
Add to your mcp_config.json:
{
"mcpServers": {
"arcgis-drp-grip": {
"command": "node",
"args": [
"/path/to/pge-drp-grip-ai-assistant/src/index.js"
]
}
}
}π License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
GIS tools for AI agents: 65 free tools + 8 paid (hazard/site-scouting/GeoJSON export)
Read-only energy market data: ISO prices, load, generation, regulatory dockets and weather.
Solar, weatherization, EV charging, battery and heat-pump decision tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables searching and querying City of Pittsburgh GIS open geospatial data (parcels, zoning, public works) through ArcGIS feature services via MCP tools.16 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search and query City of Fairfield, California open geospatial datasets (parcels, zoning, public works) via ArcGIS Feature Services.152 npmMIT
- AlicenseNot gradedqualityCmaintenanceOpen-source MCP servers exposing US solar data (production, resource, economics, market, forecast) as agent-accessible tools with a consistent data envelope.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to compile distribution feeders, run power flow, voltage and thermal violation checks, short-circuit and ThΓ©venin impedance studies, hosting capacity and QSTS analyses, and add or edit elements, through 20 typed tools that return structured JSON or Markdown with the inputs that produced the results.20MIT