aeso-mcp
Provides agent-native, strongly typed access to Alberta's electricity market data via official AESO APIs, including current market snapshots, historical prices, load, generation, interchange, reserves, and deterministic analytics.
README
aeso-mcp
<!-- mcp-name: io.github.bchoi-qwe/aeso-mcp -->
Agent-native, strongly typed access and analytics for Alberta's electricity market using official AESO data.
Independent open-source project. Not affiliated with or endorsed by the Alberta Electric System Operator (AESO).
What it is
aeso-mcp is a Model Context Protocol (MCP) server that exposes Alberta electricity-market observations and deterministic analytics to AI clients. It is designed for energy analysts, researchers, developers, journalists, market participants, and AI agents that need reliable, structured AESO data—not a thin REST decorator layer.
Features
- Typed MCP tools with Pydantic inputs/outputs and structured results
- Current market snapshot combining price, load, generation, interchange, and reserves
- Historical Pool Price and System Marginal Price retrieval with explicit units and timezones
- Deterministic analytics: period comparison, price-event detection, condition evidence
- GridStatus-backed AESO adapters plus a direct APIM httpx client for contracts (not a full second production stack)
- Query bounds, caching, retries, and secret-safe error handling
- Resources for glossary, dataset catalog, and methodology notes
Implemented datasets
| Dataset | Tool | Notes |
|---|---|---|
| Market snapshot | get_market_snapshot |
Current cohesive view |
| Pool Price | get_pool_prices |
Hourly CAD/MWh |
| System Marginal Price | get_system_marginal_prices |
Minute-level CAD/MWh |
| Alberta Internal Load | get_load |
MW; optional forecast |
| Generation / fuel mix | get_generation |
Current all fuels; historical wind/solar |
| Interchange | get_interchange |
Current path flows MW |
| Operating reserves | get_reserves |
Current MW indicators |
| Generator outages | get_outages |
Hourly outage capacity by fuel/technology |
| Approved Tx outages | get_approved_transmission_outages |
AESO-approved planned transmission outages |
| Long-range Tx outages | get_long_range_transmission_outages |
Tentative ~24-month significant outages |
| MCSINR | get_monthly_cumulative_net_revenue |
Cumulative net revenue vs offer-cap trigger |
| Secondary offer limit | get_secondary_offer_price_limit |
Whether secondary offer cap is in effect |
| Assets | get_assets |
Registry with filters |
Analytics: compare_market_periods, find_price_events, explain_market_conditions,
compare_forecast_to_actual.
Architecture
MCP clients
|
v
FastMCP adapter (aeso_mcp/mcp)
|
v
Domain services (market, grid, assets, analytics)
|
+------------------+
| |
v v
GridStatus provider Direct AESO APIM (httpx)
| |
+---------+--------+
|
v
AESO APIs
Domain code does not depend on FastMCP. Framework changes should stay in aeso_mcp/mcp/.
Requirements
- Python 3.13+
- AESO APIM API key from developer-apim.aeso.ca
uvrecommended
Installation
See LIMITATIONS.md for an honest gap inventory. PyPI publication is deferred until after human review.
From GitHub (current)
Until the package is published to PyPI:
export AESO_API_KEY=your-key
uvx --from git+https://github.com/bchoi-qwe/aeso-mcp.git aeso-mcp
Or install editable for development:
git clone https://github.com/bchoi-qwe/aeso-mcp.git
cd aeso-mcp
uv sync --group dev
cp .env.example .env # set AESO_API_KEY
uv run aeso-mcp
From PyPI (deferred)
Not published yet. After review and an intentional publish, install with:
export AESO_API_KEY=your-key
uvx aeso-mcp
Docker
docker build -t aeso-mcp .
docker run --rm -e AESO_API_KEY=your-key -p 8000:8000 aeso-mcp
Obtaining an AESO API key
- Register at the AESO developer portal
- Subscribe to the AESO public API product
- Copy the primary/secondary subscription key
- Set
AESO_API_KEYin your environment (never commit it)
Missing credentials produce an actionable startup error. The key is never returned through MCP tools or logged.
Example MCP client configuration
Cursor / Claude Desktop style (stdio)
{
"mcpServers": {
"aeso": {
"command": "uvx",
"args": ["--from", "git+https://github.com/bchoi-qwe/aeso-mcp.git", "aeso-mcp"],
"env": {
"AESO_API_KEY": "your-key"
}
}
}
}
HTTP transport
uv run aeso-mcp --transport http --host 127.0.0.1 --port 8000
Example prompts
- What is Alberta's current grid situation?
- What is the current pool price?
- Show Alberta pool prices over the last 24 hours.
- Compare today's pool prices with yesterday's.
- Which hours had the highest prices this week?
- How much wind and solar are producing right now?
- What happened during the largest price spike this week?
- Explain the evidence associated with today's price increase.
Tools
| Tool | Purpose |
|---|---|
get_market_snapshot |
Current market overview |
get_pool_prices |
Hourly Pool Price history |
get_system_marginal_prices |
Minute-level SMP history |
get_load |
Alberta Internal Load |
get_generation |
Fuel mix / renewable history |
get_interchange |
Intertie flows |
get_reserves |
Operating reserve indicators |
get_outages |
Hourly generator outage capacity by fuel |
get_assets |
Asset registry |
compare_market_periods |
Aggregate period comparison |
find_price_events |
High-price event detection |
explain_market_conditions |
Structured evidence (not causal prose) |
compare_forecast_to_actual |
AIL forecast vs actual accuracy |
All tools are read-only, non-destructive, and network-dependent.
Resources
| URI | Content |
|---|---|
aeso://glossary |
Market terminology |
aeso://datasets |
Dataset catalog |
aeso://methodology/pool-price |
Pool Price interpretation |
aeso://methodology/system-marginal-price |
SMP interpretation |
Data semantics
- Timezone:
America/Edmonton(AESO market time). DST days may have 23 or 25 local hours. - Intervals: Explicit
interval_start/interval_end(half-open ranges in requests). - Units: Pool Price / SMP → CAD/MWh; load / generation / interchange / reserves → MW.
- Status: Metadata includes
actual/forecast/ etc. Forecasts are never implied to be settled actuals. - Finality: Operational feeds may be preliminary; do not assume final settlement.
Development
uv sync --group dev
uv run ruff check src tests
uv run pyright src
uv run pytest tests/unit tests/contract tests/mcp --cov=aeso_mcp
uv build
Optional live tests:
AESO_API_KEY=... uv run pytest tests/integration -m integration
MCP Inspector:
# Prefer the console entrypoint; or point Inspector at:
# uv run aeso-mcp
npx @modelcontextprotocol/inspector uv run aeso-mcp
Tests
tests/unit— time, bounds, analytics, configtests/contract— AESO APIM fixtures viarespxtests/mcp— tool/resource discovery and structured outputstests/integration— opt-in live AESO calls
Security
See SECURITY.md. Highlights: no arbitrary URL/shell/SQL tools, host allow-list, secret hygiene, bounded queries, stderr logging for stdio.
Roadmap
- Human review against LIMITATIONS.md before any PyPI / MCP Registry publish
- See docs/data-sources.md for APIM vs public-report backlog (MCSINR, secondary offer cap, merit order via APIM)
- Merit order, metered volumes, and unit commitments via APIM (do not scrape ETS copies)
- Optional DuckDB/Parquet historical analytics store
- Broader forecast vs actual tools
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
Disclaimer
This project is an independent open-source interface to publicly documented AESO APIs. It is not an official AESO product and is not affiliated with or endorsed by AESO. Market data may be preliminary or incomplete; verify critical decisions against official AESO publications.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。