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 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 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.0.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.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for carbon_intensity_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b1a18ed5883534ae236ecb34b9ac18f2f60191b27620232dd4248c74dfa919aa
MD5 6cdae7cb6cd88fb7aa3f016e6fa0a2ac
BLAKE2b-256 3ab8bfe79bd6da5f4035308e03716f695f69689bd1fe9fcdbfb9fd1e0b3d6642

See more details on using hashes here.

Provenance

The following attestation bundles were made for carbon_intensity_mcp-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_intensity_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75d3fb4e681f696ec51b8c90f23c700f09c76bf15da638a7061d81c051daaeb8
MD5 7d24657d0dc2ca0c9dca7b8cdd119699
BLAKE2b-256 5ec4e9071fb79a770867988cbf45f71820c20c3f40b8326e641fc416f02f30b4

See more details on using hashes here.

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

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