Skip to main content

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 PyPI (Recommended)

# No installation needed - uvx will handle it automatically
uvx carbon-intensity-mcp --help

From Source

git clone https://github.com/benomahony/carbon-intensity-mcp.git
cd carbon-intensity-mcp
uv sync

Usage

If using from PyPI

Add to your MCP client configuration:

{
  "mcpServers": {
    "carbon-intensity": {
      "command": "uvx",
      "args": ["carbon-intensity-mcp"]
    }
  }
}

If installed from source

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

Testing

Test the server works:

# If using from PyPI
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {"tools": {}}, "clientInfo": {"name": "test", "version": "1.0.0"}}}' | uvx carbon-intensity-mcp

# If installed from source
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 hour
  • get_intensity_today - Get carbon intensity for today
  • get_intensity_by_date - Get carbon intensity for specific date
  • get_intensity_by_date_period - Get carbon intensity for specific date and period
  • get_intensity_by_datetime - Get carbon intensity for specific datetime
  • get_intensity_forward_24h - Get 24h forward forecast
  • get_intensity_forward_48h - Get 48h forward forecast
  • get_intensity_past_24h - Get past 24h data
  • get_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 mix
  • get_generation_mix_past_24h - Get past 24h generation mix
  • get_generation_mix_range - Get generation mix for date range

Regional Data

  • get_regional_current - Get all GB regions current data
  • get_regional_england - Get England data
  • get_regional_scotland - Get Scotland data
  • get_regional_wales - Get Wales data
  • get_regional_by_postcode - Get data by UK postcode
  • get_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carbon_intensity_mcp-0.1.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carbon_intensity_mcp-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file carbon_intensity_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: carbon_intensity_mcp-0.1.1.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

Hashes for carbon_intensity_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ef2d47e3b4f54aa2d91e0a1002df73775b0533e76cfce494da1f43228054c8d
MD5 c5c76eb8aff0ad94b0ddc68dd2eddde2
BLAKE2b-256 914f7631b5380fd8623fa684059c261d651850becd5d9e283c5725b665c37980

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_intensity_mcp-0.1.1.tar.gz:

Publisher: publish.yaml on benomahony/carbon-intensity-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file carbon_intensity_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_intensity_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac842d24f883551060d93070d297afd57d11108ea8a61f19b33c7cf5b250f782
MD5 9602e5c06e969b68e0015e3893a495b8
BLAKE2b-256 052b1269a23855891850a4093597d19aa3e6adcda7a4d71bb8646667d84088a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_intensity_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yaml on benomahony/carbon-intensity-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page