Platform

MCP Server

Connect AI assistants to live African data with the official Africa API MCP server. 40 read-only tools across countries, indicators, markets, trade, elections, and policies.

Africa API ships an official MCP server, africa-api-mcp on npm. It gives Claude, Cursor, and any other MCP client direct, read-only access to the platform: 40 tools across countries, indicators and time series, markets, FX, trade, elections, policies, and government records for all 54 African countries.

The server runs locally via npx, so there is nothing to install or host. You only need an API key from the dashboard.

Connect your client

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "africa-api": {
      "command": "npx",
      "args": ["-y", "africa-api-mcp"],
      "env": {
        "AFRICA_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Desktop and the tools appear automatically.

One command:

claude mcp add africa-api -e AFRICA_API_KEY=your-api-key-here -- npx -y africa-api-mcp

Add the same server definition to .cursor/mcp.json in your project (or the global Cursor MCP settings):

{
  "mcpServers": {
    "africa-api": {
      "command": "npx",
      "args": ["-y", "africa-api-mcp"],
      "env": {
        "AFRICA_API_KEY": "your-api-key-here"
      }
    }
  }
}

Any other MCP-compatible client works with the same npx -y africa-api-mcp command and the AFRICA_API_KEY environment variable.

What the tools cover

DomainToolsWhat it covers
Countries4Country records, curated profiles, current signals for all 54 nations
Indicators & data4127+ indicators, time-series queries, country rankings
Government6Heads of state, cabinets, leadership terms, current and historical
Elections5Results, upcoming elections, country election overviews
Markets7Stock exchanges, tickers, price history, FX rates
Trade4Bilateral flows, top partners, product breakdowns
Policies6Laws, regulations, policy timelines, lifecycle events
Sources2Data provenance: World Bank, UN, FAOSTAT, central banks
Geographies1Continent, region, subregion hierarchy

Every tool is read-only and carries MCP safety annotations, so clients can run them without write-risk prompts.

What you can ask once connected

  • "Compare GDP for Nigeria and South Africa over the last 10 years."
  • "Show current FX rates for East African currencies."
  • "Who is Kenya's head of state and when did they take office?"
  • "Which African elections are coming up this year?"
  • "Rank African countries by under-five mortality."
  • "What are Nigeria's top export products?"

For agents reading this programmatically

  • Condensed docs index: /llms.txt
  • Full docs as plain text: /llms-full.txt
  • OpenAPI schema: https://api.africa-api.com/openapi.json
  • Base URL: https://api.africa-api.com/v1 with Authorization: Bearer auth (authentication guide)

On this page