
AESO MCP
io.github.bchoi-qwePublished by GitHub account bchoi-qwev0.3.0Updated Oct 24, 2026
Typed Alberta electricity market data and analytics via official AESO APIs.
Overview
Local MCP server giving assistants typed access to official Alberta (AESO) electricity market data plus deterministic market analytics.
- What you can do
- Retrieve current and historical market data: snapshots, Pool Price, SMP, load, generation, interchange, reserves, outages, intertie capability, metered volumes and asset registry
- Fetch official forecasts, supply adequacy/surplus, FFR schedules, dispatch-down service, TMR reference price, system events and research archives
- Query operating-reserve prices, forecasts and activations
- Run deterministic analytics: period comparison, price events and statistics, capture prices, net load, supply stack, generation mix, ramps, outage impact, forecast error, revenue and participant concentration
- Sync an optional local DuckDB/Parquet history store and read glossary, dataset and methodology resources
- When to use it
- Useful for energy analysts, researchers, journalists and market participants who want an assistant to pull and analyze Alberta electricity market data from official AESO sources, including reproducible event studies and forecast-versus-actual comparisons.
- Requirements
- Runs locally as a Python package (Python 3.13+, uv/uvx recommended) over stdio, or as an HTTP listener. Requires an AESO APIM subscription key in AESO_API_KEY; non-loopback HTTP binds also require AESO_MCP_HTTP_BEARER_TOKEN. Network access to AESO endpoints is needed.
Installation
In SourceWeft
- Open AESO MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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
- Stable FastMCP 4.0.10 runtime targeting MCP
2026-07-28, with FastMCP's per-connection negotiation for legacy session-based clients - Current market snapshot combining price, load, generation, interchange, and reserves
- Paginated historical Pool Price, System Marginal Price, load, and generation retrieval
- Official individual-asset Historical CSD Generation Data at hourly and five-minute resolution
- Optional incremental DuckDB index and partitioned Parquet snapshots for repeatable research
- Official AIL, Pool Price, wind, solar, and combined wind/solar forecast publications through
one typed
get_forecastcontract, with persisted publication vintages and point-in-timeas_ofselection that excludes unknown publication chronology - Official supply-adequacy, supply-surplus, FFR Net Schedule, Dispatch Down Service, TMR reference-price, and AIES system-event reports
- Official historical adequacy/cushion web codes, transmission outages, planning-area hourly load/generation, constrained volume, EEA events, operating-reserve directives, and the current Pool Participant registry through one typed research-archive contract
- Authenticated APIM reports for merit order, commitments, capability/outages, interties, metered volumes, and operating-reserve offer control
- Deterministic analytics: compact history summaries, period comparison, event detection, condition evidence, price distributions, capture price, net load, supply stack, generation, outage association, generalized forecast accuracy, asset gross energy revenue, CSD-versus- metered comparisons, ramps, supply-surplus associations, and transparent supply-tightness indicators, plus participant concentration, regional, constrained-volume, scarcity, and compact system-frequency analysis
- Deterministic research manifests identify exact input publications, parameters, methodology, completeness, and degradation warnings for multi-source market-event analysis
- Public operating-reserve active/standby prices, seven-day forecasts, activations, and summaries
- One complete server package and startup path:
AESO_API_KEYis always required; there is no reduced credential-free server mode - Query bounds, cache provenance, completeness metadata, upstream
Retry-Afterhandling, and secret-safe machine-readable errors - Hardened HTTP transport with Host/Origin validation, bearer authentication required for non-loopback binds by default, rate/concurrency limits, request-size bounds, probes, and correlation IDs
- Reusable MCP prompts plus glossary, capability, dataset, and methodology resources
Implemented datasets
Analytics: summarize_market_history, assess_supply_tightness, compare_market_periods,
find_price_events, explain_market_conditions, compare_forecast_to_actual,
get_price_statistics, get_price_duration_curve, analyze_market_event,
calculate_capture_prices, analyze_net_load, analyze_supply_stack,
analyze_intertie_utilization, analyze_generation_mix, analyze_asset_dispatch,
analyze_outage_impact, analyze_forecast_error, calculate_asset_energy_revenue,
compare_csd_to_metered, analyze_ramps, analyze_supply_surplus_events,
summarize_operating_reserve_market, analyze_participant_concentration,
analyze_regional_load_generation, analyze_constrained_volume, analyze_scarcity, and
analyze_system_frequency.
Architecture
The documentation site includes a full architecture and MCP Inspector walkthrough and an MCP interoperability and security matrix.
Domain code does not depend on FastMCP. Framework changes should stay in aeso_mcp/mcp/.
All upstream clients are implementation details of this single server: the APIM key is sent only
to apimgw.aeso.ca and is never sent to the allow-listed ETS or Box hosts.
Requirements
- Python 3.13+
- AESO APIM API key from developer-apim.aeso.ca
uvrecommended
Installation
See LIMITATIONS.md for an honest gap inventory.
From PyPI (recommended)
For incremental DuckDB/Parquet historical storage:
From GitHub
To run the current repository version directly:
Development
Docker
Send the same token in the MCP client's Authorization: Bearer ... header. The image binds to
0.0.0.0, so it intentionally requires bearer authentication by default. The built-in HTTP listener
does not terminate TLS; for off-host traffic, terminate TLS at a trusted reverse proxy and never
send bearer credentials over public plaintext HTTP. See MCP interoperability and security.
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
See the documentation site's MCP client configurations for maintained Codex, ChatGPT desktop app, Claude Desktop, Claude Code, and Cursor setup instructions.
Cursor / Claude Desktop style (stdio)
HTTP transport
HTTP always validates Host and Origin. A non-loopback bind now refuses to start unless
AESO_MCP_HTTP_BEARER_TOKEN is configured. The built-in listener is plain HTTP; terminate TLS at a
trusted ingress before exposing it beyond a trusted private network. An explicit
AESO_MCP_HTTP_ALLOW_INSECURE_REMOTE=true override exists for isolated environments that accept
the risk; it is never the default. Also set AESO_MCP_HTTP_ALLOWED_HOSTS and
AESO_MCP_HTTP_ALLOWED_ORIGINS for the deployment. /healthz and /readyz contain no market data
or secrets. See .env.example for all bounded runtime settings.
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?
- How inaccurate was the seven-day wind forecast during that event?
- Was AESO publishing a supply-surplus or tight supply-cushion status at the time?
- What gross Pool Price energy revenue did this asset's metered MWh earn?
- Explain the evidence associated with today's price increase.
Tools
Market and research tools are read-only. sync_historical_store writes only to the configured
local historical-store root; it does not mutate AESO or another external system.
Resources
Prompts: daily_market_brief, investigate_price_event, and compare_market_days.
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.
- Point-in-time forecasts:
as_ofselects only vintages with known issue/publication times and retrieval times at or before the boundary. Unknown chronology is excluded; target intervals absent from persisted history remain unobserved rather than being backfilled from a later publication. - Completeness: Metadata reports available/missing series and expected/missing observations where the source cadence is known. Optional enrichment failures are surfaced as partial or degraded results with warnings.
- Pagination: Raw price, SMP, load, generation, and operational reports return
pagemetadata withnext_offset. Usesummarize_market_historybefore retrieving long raw series. - Cache timing:
retrieved_atidentifies the upstream fetch;served_at,cache_hit, andcache_ageidentify when and how the response was served. - Research identity:
analyze_market_event.analysis_manifestrecords exact sources, parameters, methodology version, warnings, and a deterministic SHA-256analysis_id.
Development
Optional live tests:
MCP Inspector:
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.
Development status
Version 0.4.0 includes the historical store, full CSD generation adapter, official forecast/report providers, general research analytics, operating-reserve market surface, eval suite, and documentation site. It also includes point-in-time forecast vintages, reproducibility manifests, release-policy hardening, and the verified official research-data archive.
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.
Source: README.md at commit b9cc6c3
Tools
0Version history
1- v0.3.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts