MCP server for UK Carbon Intensity API
Project description
Carbon Intensity MCP Server
An MCP (Model Context Protocol) server that provides access to the UK Carbon Intensity API from National Energy System Operator (NESO).
Features
- Get current carbon intensity data for Great Britain
- Retrieve historical and forecast carbon intensity data
- Access regional carbon intensity data by postcode or region ID
- Get generation mix data (renewable vs non-renewable sources)
- Statistical analysis of carbon intensity trends
- Carbon intensity factors for different fuel types
Installation
From Source
git clone https://github.com/benomahony/carbon-intensity-mcp.git
cd carbon-intensity-mcp
uv sync
From PyPI (when published)
uv add carbon-intensity-mcp
Usage
Add to your MCP client configuration:
{
"mcpServers": {
"carbon-intensity": {
"command": "uv",
"args": ["--directory", "/path/to/carbon-intensity-mcp", "run", "carbon-intensity-mcp"]
}
}
}
Important: Replace /path/to/carbon-intensity-mcp with the actual absolute path to your cloned repository.
For the example configuration provided:
cp example-config.json ~/.config/claude/mcp_servers.json
# Edit the path in the file to match your setup
Or if installed globally:
{
"mcpServers": {
"carbon-intensity": {
"command": "carbon-intensity-mcp"
}
}
}
Testing
Test the server works:
# From the project directory
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {"tools": {}}, "clientInfo": {"name": "test", "version": "1.0.0"}}}' | uv run carbon-intensity-mcp
Available Tools
National Intensity
get_current_intensity- Get carbon intensity for current half hourget_intensity_today- Get carbon intensity for todayget_intensity_by_date- Get carbon intensity for specific dateget_intensity_by_date_period- Get carbon intensity for specific date and periodget_intensity_by_datetime- Get carbon intensity for specific datetimeget_intensity_forward_24h- Get 24h forward forecastget_intensity_forward_48h- Get 48h forward forecastget_intensity_past_24h- Get past 24h dataget_intensity_range- Get data for date range (max 14 days)
Statistics
get_intensity_statistics- Get statistics for date range (max 30 days)get_intensity_statistics_blocks- Get block average statistics
Generation Mix
get_current_generation_mix- Get current fuel mixget_generation_mix_past_24h- Get past 24h generation mixget_generation_mix_range- Get generation mix for date range
Regional Data
get_regional_current- Get all GB regions current dataget_regional_england- Get England dataget_regional_scotland- Get Scotland dataget_regional_wales- Get Wales dataget_regional_by_postcode- Get data by UK postcodeget_regional_by_region_id- Get data by region ID
Factors
get_intensity_factors- Get carbon intensity factors by fuel type
API Coverage
This server provides access to the complete UK Carbon Intensity API v2.0.0:
- National Intensity: Current, historical and forecast carbon intensity
- Regional Intensity: Regional data by postcode or region ID
- Generation Mix: Fuel mix breakdown (gas, nuclear, renewables, etc.)
- Statistics: Statistical analysis of carbon intensity trends
- Factors: Carbon intensity factors by fuel type
License
CC BY 4.0 (following the source API license)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file carbon_intensity_mcp-0.1.0.tar.gz.
File metadata
- Download URL: carbon_intensity_mcp-0.1.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1a18ed5883534ae236ecb34b9ac18f2f60191b27620232dd4248c74dfa919aa
|
|
| MD5 |
6cdae7cb6cd88fb7aa3f016e6fa0a2ac
|
|
| BLAKE2b-256 |
3ab8bfe79bd6da5f4035308e03716f695f69689bd1fe9fcdbfb9fd1e0b3d6642
|
Provenance
The following attestation bundles were made for carbon_intensity_mcp-0.1.0.tar.gz:
Publisher:
publish.yaml on benomahony/carbon-intensity-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carbon_intensity_mcp-0.1.0.tar.gz -
Subject digest:
b1a18ed5883534ae236ecb34b9ac18f2f60191b27620232dd4248c74dfa919aa - Sigstore transparency entry: 413023696
- Sigstore integration time:
-
Permalink:
benomahony/carbon-intensity-mcp@b9777f935fa60140c7fda987f4e5db4785e2b4aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/benomahony
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b9777f935fa60140c7fda987f4e5db4785e2b4aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file carbon_intensity_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: carbon_intensity_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d3fb4e681f696ec51b8c90f23c700f09c76bf15da638a7061d81c051daaeb8
|
|
| MD5 |
7d24657d0dc2ca0c9dca7b8cdd119699
|
|
| BLAKE2b-256 |
5ec4e9071fb79a770867988cbf45f71820c20c3f40b8326e641fc416f02f30b4
|
Provenance
The following attestation bundles were made for carbon_intensity_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on benomahony/carbon-intensity-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
carbon_intensity_mcp-0.1.0-py3-none-any.whl -
Subject digest:
75d3fb4e681f696ec51b8c90f23c700f09c76bf15da638a7061d81c051daaeb8 - Sigstore transparency entry: 413023712
- Sigstore integration time:
-
Permalink:
benomahony/carbon-intensity-mcp@b9777f935fa60140c7fda987f4e5db4785e2b4aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/benomahony
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b9777f935fa60140c7fda987f4e5db4785e2b4aa -
Trigger Event:
workflow_dispatch
-
Statement type: