
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

An MCP server that wraps the Africa Energy Data API, offering tools to query electricity, energy, and economic indicators for all 54 African countries from 2000 to 2022.
MCP server for African electricity, energy, and economic data is cataloged as an MCP server attributed to navashub. An MCP server that wraps the Africa Energy Data API, offering tools to query electricity, energy, and economic indicators for all 54 African countries from 2000 to 2022. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for MCP server for African electricity, energy, and economic data are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Data spans 2000–2022 for all 54 African countries.
Responses are held in an in-memory cache with a 10-minute TTL, cleared on server restart.
Yes; an Africa Energy API key from RapidAPI is set via the AFRICA_ENERGY_API_KEY environment variable.
README.md · 1334765b052e · Fetched 2026-11-13 13:49:30 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
An MCP (Model Context Protocol) server that exposes the Africa Energy Data API as tools for Claude, Cursor, and other MCP-compatible clients.
Query electricity, energy, and economic data for all 54 African countries spanning 2000–2022. The server includes automatic caching (10-minute TTL), retry logic with exponential backoff, input validation, and structured logging.
cd africa_energy_mcp
pip install -r requirements.txt
.env filecp .env.example .env
Edit .env and paste your API key:
AFRICA_ENERGY_API_KEY=your_key_here
python server.py
You should see startup logs on stderr. Press Ctrl+C to stop.
get_electricity_dataFetch electricity metrics for an African country.
Parameters:
country (required): Country name, e.g. "Kenya", "Nigeria"year (optional): Filter by year (2000–2022)metric (optional): Specific metric nameunit (optional): Measurement unitExample:
{
"country": "Kenya",
"year": 2022
}
get_energy_dataFetch general energy sector data (access, efficiency, renewables, etc.).
Parameters:
country (required): Country namesub_sector (optional): "Access", "Efficiency", "Renewables", etc.start_year (optional): Year range start (2000–2022)end_year (optional): Year range endmetric (optional): Specific metric nameExample:
{
"country": "South Africa",
"start_year": 2010,
"end_year": 2022
}
get_economic_dataFetch economic indicators: GDP, inflation, population, energy spending, etc.
Parameters:
country (required): Country namestart_year (optional): Year range startend_year (optional): Year range endmetric (optional): "GDP", "Inflation", "Rural population", etc.unit (optional): Measurement unitcheck_api_healthVerify the API is online and responding.
No parameters required.
list_countriesGet the list of all 54 supported African countries.
No parameters required.
Edit ~/.config/claude_desktop_config.json:
{
"mcpServers": {
"africa-energy": {
"command": "python",
"args": ["/path/to/africa_energy_mcp/server.py"]
}
}
}
Replace /path/to/africa_energy_mcp with the full path to your repository.
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"africa-energy": {
"command": "python",
"args": ["C:\\path\\to\\africa_energy_mcp\\server.py"]
}
}
}
Then restart Claude Desktop. The tool should appear in the MCP tools list.
settings.json:"mcp.servers": {
"africa-energy": {
"command": "python",
"args": ["/path/to/africa_energy_mcp/server.py"]
}
}
Save and restart Cursor. Tools should be available in chat.
If you'd like to publish or run this server automatically (for example to make it runnable from remote hosts or CI), consider adding CI that builds a Docker image and pushes it to a registry (GitHub Container Registry or Docker Hub). A Dockerfile and an example GitHub Actions workflow are included in the repository as a starting point — feel free to customize them for your preferred registry and release process.
For most users, the simplest path is to run the server locally (see "Setup" above) and connect an MCP client such as Claude Desktop or Cursor.
africa_energy_mcp/
├── server.py # MCP server entry point, wires tools + handlers
├── config.py # Environment variables, constants, country list
├── api_client.py # Async HTTP client, retry logic, caching
├── tools.py # MCP tool schema definitions
├── handlers.py # Input validation, routing, response formatting
├── requirements.txt # Python dependencies
├── .env.example # Example environment configuration
└── README.md # This file
Request flow:
Caching:
(endpoint, frozenset(params))config.py)Retry logic:
5xx errors and timeouts4xx errors (client errors)Edit config.py to adjust:
REQUEST_TIMEOUT: HTTP timeout (default: 30s)RETRY_MAX_ATTEMPTS: Max retries (default: 3)RETRY_BACKOFF_FACTOR: Backoff multiplier (default: 2.0)CACHE_TTL_SECONDS: Cache expiry (default: 600s)Logs are written to stderr with format:
2024-05-16 10:30:45,123 - handlers - DEBUG - Tool call: get_electricity_data for Kenya, year=2022
Log levels:
DEBUG: Tool calls, cache hits/misses, retry attemptsINFO: Successful API calls, cache operationsWARNING: Retries, expired cache entriesERROR: API failures, validation errors, network issuesAll tool calls return well-formatted JSON error responses:
{
"error": "Validation error: Country must be a non-empty string."
}
Common errors:
Validation error: Invalid input (bad country, year out of range)API error: Server returned 4xx or 5xxRequest timeout: API didn't respond within 30s (will retry)Unexpected error: Unhandled exception# Start the server
python server.py
# In another terminal, test with curl (mock MCP call):
# This is for manual testing; MCP clients handle this automatically
Or test the handler directly in Python:
import asyncio
from handlers import call_tool
from api_client import APIClient
async def test():
async with APIClient() as client:
result = await call_tool(
"get_electricity_data",
{"country": "Kenya", "year": 2022},
client
)
print(result[0].text)
asyncio.run(test())
"Unknown or invalid tool"
"AFRICA_ENERGY_API_KEY not found"
.env file (copy from .env.example)AFRICA_ENERGY_API_KEY is set"API error 401"
"Request timeout"
REQUEST_TIMEOUT in config.py if retries exhaust"No such file or directory: server.py"
africa_energy_mcp directorypython /path/to/server.pyTo improve the server:
handlers.py, api_client.py, or add new tools to tools.pyMIT License — feel free to use and modify for your projects.
For issues or questions:
Version: 1.0.0
Last Updated: 2024-05-16
Status: Production-ready ✅
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for MCP server for African electricity, energy, and economic data from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/africa_energy_mcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.