Platform

MCP Server

Configure the Africa API MCP server to query countries, indicators, markets, trade, elections, and policies from an AI client.

The africa-api-mcp package on npm exposes read-only Africa API tools through MCP. Use it to query country records, indicators, markets, trade and government data from a compatible AI client. Available countries, dates and fields vary by dataset; see Coverage.

The examples run the server locally with npx. Install Node.js and create an API key in the dashboard before connecting. Your client must support launching a local MCP process; npx may download the package on first use.

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, then check that Africa API appears in its connected tools. Follow any approval steps shown by the client.

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"
      }
    }
  }
}

One command (Copilot agent mode):

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

For another client that supports local MCP processes, configure the npx -y africa-api-mcp command and the AFRICA_API_KEY environment variable. The configuration format depends on the client.

What the tools cover

DomainQueries
CountriesCountry records, profiles and signals
Indicators & dataIndicator discovery, time series and country rankings
GovernmentHeads of state, cabinets and leadership terms
ElectionsResults, scheduled elections and country election overviews
MarketsExchanges, index levels, tickers, price history and FX rates
TradeBilateral flows, top partners and product breakdowns
PoliciesLaws, regulations, policy timelines and lifecycle events
Sources & platformSource metadata and platform information
GeographiesContinent, region and subregion hierarchy

The tools are read-only and declare MCP safety annotations. Approval behavior depends on your client and its settings.

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