strompreis-mcp
Click on "Install 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., "@strompreis-mcpWhen is the cheapest time to run my laundry today?"
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.
⚡ Strompreis MCP — Electricity Price Forecast for AI Agents
MCP server that gives AI agents real-time German electricity price forecasts.
Tells your smart home agent when to run the dishwasher, charge the car, or schedule power-hungry tasks.
Built for the Model Context Protocol — works with Claude Desktop, Cline, and any MCP-compatible client.
Architecture
┌────────────────────────────┐
│ SMARD (Bundesnetzagentur) │
│ Live-Strompreise 15min │
└──────────┬─────────────────┘
│ API
┌──────────▼─────────────────┐
│ strompreis-collector │
│ (Cron: every 15 min) │
└──────────┬─────────────────┘
│ writes
┌──────────▼─────────────────┐
│ SQLite Database │
│ ~/.strompreis/strompreis.db │
│ ├── price_data (historical) │
│ ├── api_keys (auth) │
│ └── usage_log (rate limit) │
└──────────┬─────────────────┘
│ reads
┌────────────────┼────────────────┐
│ │ │
┌─────────▼──────┐ ┌─────▼──────┐ ┌──────▼─────────┐
│ MCP Server │ │ B2C Site │ │ CLI Tools │
│ (stdio/SSE) │ │ (FastAPI) │ │ status/vacuum │
│ price_forecast │ │ savings │ │ │
│ best_hours │ │ checker │ │ │
│ db_status │ │ affiliate │ │ │
└─────────────────┘ └────────────┘ └─────────────────┘Related MCP server: germany-mcp-server
Quick Start
1. Install
pip install strompreis-mcpOr from source:
git clone https://github.com/DasClown/strompreis-mcp.git
cd strompreis-mcp
pip install -e .2. Initialize database + first data collection
# Automatic setup
bash scripts/setup.sh
# Or manual:
strompreis-collector collect
strompreis-collector status3. Add to Claude Desktop
Edit ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"strompreis": {
"command": "strompreis-mcp"
}
}
}Or with Cline / any MCP client:
{
"mcpServers": {
"strompreis": {
"command": "strompreis-mcp",
"args": []
}
}
}Tools
Tool | Parameters | Returns |
|
| JSON array: |
|
| Human-readable cheapest hours recommendation |
| none | Database health: rows, latest timestamp, usage stats |
Example Prompts
"When is the cheapest time to run my laundry today?"
→ Agent callsbest_hours(count=3)→ "Tonight 00:00-02:00 at ~28 ct/kWh"
"What's the electricity price forecast for tomorrow?"
→ Agent callsprice_forecast(hours=48)→ hourly prices in ct/kWh
"Should I charge my EV now or wait?"
→ Agent callsprice_forecast(hours=24), finds cheapest window
Database Persistence
The database lives at ~/.strompreis/strompreis.db. It persists:
Table | Purpose | Retention |
| Historical SMARD prices + generation data | Unlimited (for ML training) |
| Monetization: tier-based API access | Manual expiration |
| Rate limiting + analytics | Accumulates |
Cron Setup (recommended)
# Fetch data every 15 minutes
*/15 * * * * cd /path/to/strompreis-mcp && strompreis-collector collect
# Weekly database maintenance (Sunday 03:00)
0 3 * * 0 cd /path/to/strompreis-mcp && strompreis-collector vacuumOr use the provided crontab:
crontab deploy/crontabCLI Commands
# Fetch + store latest SMARD data
strompreis-collector collect
# Show database health
strompreis-collector status
# → 📊 Strompreis DB Status
# Total rows: 1,248
# Latest data: 2026-06-30T21:00:00+00:00
# DB file size: 180 KB
# Weekly maintenance
strompreis-collector vacuumDeployment
systemd (production)
# Edit deploy/strompreis-mcp.service paths for your system, then:
sudo cp deploy/strompreis-mcp.service /etc/systemd/system/
sudo systemctl enable --now strompreis-mcp
# Monitor
journalctl -u strompreis-mcp -fB2C Website (side-stream)
# Install dependencies
pip install strompreis-mcp[b2c]
# Run
python3 -m uvicorn b2c.server:app --host 0.0.0.0 --port 8080Then open http://localhost:8080 — users enter their annual kWh consumption and get:
✅ Savings calculation (fixed vs dynamic tariff)
✅ Tibber/Awattar affiliate comparison
✅ 24h price forecast snippet
Smithery
One-click install for Claude Desktop via Smithery.
API Key Mode (for production)
By default the server runs in keyless mode (100 req/day global limit).
For production use, set an API key:
# Generate a key
python3 -c "
from strompreis_mcp.database import create_api_key
print(create_api_key('my-app', tier='pro', daily_limit=10000))
"
# Set it
export STROMPREIS_API_KEY=sp_your_key_here
strompreis-mcpIn keyed mode:
All requests validated against
api_keystablePer-key daily rate limiting
Usage logged to
usage_logtable
Data Sources
Source | Provider | API | Data |
Day-ahead auction prices | Live, 15-min resolution | ||
Solar generation | SMARD | Chart API | Live, hourly |
Wind generation | SMARD | Chart API | Live, hourly |
Grid load | SMARD | Chart API | Live, hourly |
Planned for v0.3:
ENTSO-E Transparency (cross-border exchange, network constraints)
DWD BrightSky (weather: solar radiation, wind speed, temperature)
ML model (Random Forest on accumulated DB data)
License
MIT
Built by @DasClown — German electricity prices for AI agents.
This server cannot be installed
Maintenance
Latest Blog Posts
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DasClown/strompreis-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server