MCP.so
登录

Africa Energy Data Mcp

@Navashub

关于 Africa Energy Data Mcp

Exposes historical electricity, energy and economic indicators for 54 African countries (2000–2022). MCP tools: get_electricity_data, get_energy_data, get_economic_data, check_api_health, list_countries.

基本信息

分类

数据与分析

传输方式

stdio

发布者

Navashub

提交者

Navas Herbert

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "africa-energy": {
      "command": "py",
      "args": [
        "server.py"
      ],
      "description": "Run locally with Python: requires AFRICA_ENERGY_API_KEY in .env"
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Africa Energy Data Mcp?

An MCP (Model Context Protocol) server that exposes the Africa Energy Data API as tools for Claude, Cursor, and other MCP-compatible clients. It allows querying electricity, energy, and economic data for all 54 African countries spanning 2000–2022.

How to use Africa Energy Data Mcp?

Clone the repository, install dependencies with pip install -r requirements.txt, get an API key from RapidAPI, create a .env file with your AFRICA_ENERGY_API_KEY, and run python server.py. Then configure the MCP client (Claude Desktop or Cursor) by adding the server path to its settings JSON.

Key features of Africa Energy Data Mcp

  • 5 tools for electricity, energy, economic data, health, and country list
  • Automatic in-memory caching with 10-minute TTL
  • Retry logic with exponential backoff (up to 3 attempts)
  • Input validation for country names, years, and year ranges
  • Structured logging to stderr for debugging
  • Modular architecture with separate config, API client, and handlers

Use cases of Africa Energy Data Mcp

  • Retrieve electricity metrics (e.g., access, consumption) for any African country by year
  • Fetch energy sector data including access, efficiency, and renewables over a year range
  • Get economic indicators such as GDP, inflation, and population for analysis
  • Verify the API is online and responding before running other queries
  • List all 54 supported African countries for selection in an application

FAQ from Africa Energy Data Mcp

What API does Africa Energy Data Mcp rely on?

It uses the Africa Energy Data API available on RapidAPI; a free tier is available and an API key is required.

What are the runtime requirements?

Python is required. All dependencies are listed in requirements.txt and installed with pip install -r requirements.txt.

How does caching work?

Responses are cached in memory for 10 minutes (configurable in config.py). The cache is cleared on server restart.

What happens if the API key is missing or invalid?

The server will log “AFRICA_ENERGY_API_KEY not found” and return an error. Create a .env file with a valid RapidAPI key.

Does the server retry failed requests?

Yes, it retries up to 3 times with exponential backoff (1s, 2s, 4s) on 5xx errors and timeouts, but does not retry 4xx client errors.

评论

数据与分析 分类下的更多 MCP 服务器