Akamai Traffic MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "EDGERC_PATH=${EDGERC_PATH}" -e "EDGERC_SECTION=${EDGERC_SECTION}" akamai-traffic -- npx mcp-remote http://localhost:8000/mcp --allow-http
Required:EDGERC_PATHEDGERC_SECTION+ 2 optional
README.md

Exposes the Akamai Reporting API v2 to enable traffic analysis and monitoring.

Akamai Traffic MCP

An MCP (Model Context Protocol) server that exposes the Akamai Reporting API v2 as tools an LLM can call directly — via Claude Desktop, any MCP-compatible client, or your own agent.

Generate traffic reports by hostname or CP code, analyse HTTP error rates, measure cache offload, and forecast future traffic trends — all through natural language.


Features

Tool What it does
list_accounts Discover all Akamai accounts accessible with your credentials
get_traffic_by_hostname Edge/origin bytes and hits grouped by hostname
get_traffic_by_cpcode Bytes, midgress, and offload % grouped by CP code
get_http_status_breakdown 4xx / 5xx error hit counts at edge and origin
get_edge_origin_offload Cache offload percentage by CP code
get_raw_traffic Flexible query with custom dimensions and metrics
predict_traffic Timeseries forecast (linear regression or EMA)
export_traffic_report Export all four reports to a multi-sheet Excel file

Key behaviours:

  • Default time window: last 15 days (adjustable per call)
  • Multi-account support via accountSwitchKey — call list_accounts() first
  • Forecasting requires no heavy ML dependencies — uses numpy only
  • Credentials never leave your machine; all auth is via Akamai EdgeGrid

Architecture

Claude Desktop / MCP client
        │  MCP (streamable-http)
        ▼
  server.py  (FastMCP)
        │
        ├── akamai_api/client.py    EdgeGrid auth + HTTP session
        ├── akamai_api/reports.py   Request body builders
        ├── forecast.py             Linear regression & EMA forecasting
        ├── export.py               Excel report writer (openpyxl)
        └── config.py               .edgerc + .env config loader

Prerequisites

  • Python 3.11+
  • An Akamai ~/.edgerc file with a [default] section (or the section name of your choice)
  • API credentials with access to:
    • Identity Management API v3 (for account switching)
    • Reporting API v2 (for traffic data)

Quick Start (local)

1. Clone and install

git clone https://github.com/gamittal-ak/traffic_report_mcp.git
cd traffic_report_mcp
python3.11 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt

2. Configure environment

cp .env.example .env

Edit .env:

EDGERC_PATH=/home/you/.edgerc   # path to your .edgerc file
EDGERC_SECTION=default           # section name inside .edgerc
MCP_HOST=0.0.0.0
MCP_PORT=8000
LOG_LEVEL=INFO

3. Start the server

python server.py

The MCP server is now available at http://localhost:8000/mcp.


Connect to Claude Desktop

Edit your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "akamai-traffic": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8000/mcp",
        "--allow-http"
      ]
    }
  }
}

Restart Claude Desktop. The Akamai traffic tools will appear automatically.


Example conversations

"Show me traffic for all my accounts over the last 7 days"

"Which hostnames had the most edge hits in the past 15 days for account ACME Corp?"

"What were my 5xx error rates last week for CP codes 12345 and 67890?"

"Forecast my edge bytes for the next 7 days using exponential moving average"

"Export a full traffic report to Excel for account XYZ"


Tool reference

`list_accounts(search="")`

Returns all accounts accessible via your API credentials. search filters by account name (optional). Always call this first to get the accountSwitchKey needed by other tools.

→ [{accountSwitchKey, accountName, accountId}, ...]

`get_traffic_by_hostname(...)`

Traffic broken down by hostname.

Param Default Description
account_switch_key "" From list_accounts()
start 15 days ago ISO-8601 UTC, e.g. 2025-02-01T00:00:00Z
end now ISO-8601 UTC
cpcode all List of CP code integers to filter
hostname all List of hostname strings to filter

Metrics returned: edgeBytesSum, edgeHitsSum, originBytesSum, originHitsSum, midgressBytesSum


`get_traffic_by_cpcode(...)`

Traffic grouped by CP code with offload percentage.

Metrics returned: edgeBytesSum, originBytesSum, midgressBytesSum, offloadedBytesPercentage


`get_http_status_breakdown(...)`

4xx and 5xx error hit counts at edge and origin. Useful for spotting error spikes and diagnosing origin health issues.


`get_edge_origin_offload(...)`

Cache offload percentage by CP code. Higher offloadedBytesPercentage = more traffic served from Akamai edge = l

Tools (8)

list_accountsDiscover all Akamai accounts accessible with your credentials.
get_traffic_by_hostnameGet edge/origin bytes and hits grouped by hostname.
get_traffic_by_cpcodeGet bytes, midgress, and offload percentage grouped by CP code.
get_http_status_breakdownGet 4xx / 5xx error hit counts at edge and origin.
get_edge_origin_offloadGet cache offload percentage by CP code.
get_raw_trafficFlexible query with custom dimensions and metrics.
predict_trafficTimeseries forecast using linear regression or EMA.
export_traffic_reportExport all traffic reports to a multi-sheet Excel file.

Environment Variables

EDGERC_PATHrequiredPath to your .edgerc file
EDGERC_SECTIONrequiredSection name inside .edgerc
MCP_HOSTHost address for the MCP server
MCP_PORTPort for the MCP server

Configuration

claude_desktop_config.json
{"mcpServers": {"akamai-traffic": {"command": "npx", "args": ["mcp-remote", "http://localhost:8000/mcp", "--allow-http"]}}}

Try it

Show me traffic for all my accounts over the last 7 days.
Which hostnames had the most edge hits in the past 15 days for account ACME Corp?
What were my 5xx error rates last week for CP codes 12345 and 67890?
Forecast my edge bytes for the next 7 days using exponential moving average.
Export a full traffic report to Excel for account XYZ.

Frequently Asked Questions

What are the key features of Akamai Traffic MCP?

Real-time traffic analysis by hostname or CP code. HTTP error rate monitoring for 4xx and 5xx status codes. Cache offload measurement and reporting. Predictive traffic forecasting using linear regression or EMA. Multi-sheet Excel report generation.

What can I use Akamai Traffic MCP for?

Diagnosing origin health issues by analyzing error spikes. Optimizing cache performance by identifying low offload CP codes. Forecasting infrastructure capacity needs based on traffic trends. Generating automated performance reports for stakeholders.

How do I install Akamai Traffic MCP?

Install Akamai Traffic MCP by running: git clone https://github.com/gamittal-ak/traffic_report_mcp.git && cd traffic_report_mcp && python3.11 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt

What MCP clients work with Akamai Traffic MCP?

Akamai Traffic MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Akamai Traffic MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare