mcpField
A
africa-api-mcp

africa-api-mcp

Local
github.com/africa-apiLegal & Government0Updated 18w ago

About africa-api-mcp

africa-api-mcp connects MCP clients to Africa API data on all 54 African countries. Its read-only tools cover indicators, government, elections, markets, trade, and policy, returning text and structured JSON.

Key features

  1. 0141 read-only tools across nine domains
  2. 02Country profiles and 200+ indicators
  3. 03Government and election information
  4. 04Market, trade, and policy data
  5. 05Text and structured JSON results

Use cases

  1. 01Compare country indicators over time
  2. 02Review upcoming elections and leaders
  3. 03Explore currency, stock, or trade data
  4. 04Check policy timelines across countries

MCP support

The MCP server exposes Africa API data through read-only tools. It connects to clients using npx and the AFRICA_API_KEY environment variable.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"africa-api-africa-api": {
"command": "npx",
"args": [
"-y",
"africa-api-mcp"
],
"env": {
"AFRICA_API_KEY": "<AFRICA_API_KEY>"
}
}
}
}
Run commandnpx -y africa-api-mcp
Environment variables to set
AFRICA_API_KEYSecretYour Africa API bearer token from africa-api.com

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmafrica-api-mcp0.1.1

Tools

40

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
sortstringNoSort field
regionstringNoFilter by region (e.g. "Eastern Africa", "Western Africa")
per_pageintegerNoItems per page

Details

From the project README

Africa API MCP Server

An MCP server that gives Claude direct access to the Africa API — comprehensive data on all 54 African nations including economic indicators, markets, trade, government, elections, and policies.

Quick Start

1. Get an API key

Sign up at africa-api.com and create an API key from your dashboard.

2. Connect your client

The server runs on demand via npx — nothing to install or host. Pick your client:

Claude Code (one command):

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

Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart:

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

Cursor — add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project) with the same mcpServers block as above.

VS Code (Copilot agent mode) — one command:

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

Any other MCP client works with the same npx -y africa-api-mcp command plus the AFRICA_API_KEY environment variable. The server is also listed in the MCP Registry as io.github.africa-api/africa-api-mcp.

What You Can Ask Claude

Once connected, Claude can answer questions like:

  • "What's the GDP of Nigeria vs South Africa over the last 10 years?"
  • "Show me current FX rates for East African currencies"
  • "Who is the head of state of Kenya and when did they take office?"
  • "What elections are coming up in Africa this year?"
  • "What are Nigeria's top 5 export products?"
  • "Show me the policy timeline for Rwanda"
  • "Rank African countries by life expectancy"
  • "What stocks are listed on the Nigerian Exchange?"
  • "Compare trade flows between Kenya and Tanzania"

Available Tools

41 tools across 9 domains:

DomainToolsWhat It Covers
Countries4Country details, profiles, real-time signals for all 54 nations
Indicators & Data4200+ indicators (GDP, population, health, energy, trade, etc.), time-series queries, country rankings
Government6Heads of state, cabinets, leadership terms — current and historical
Elections5Election results, upcoming elections, country overviews
Markets8Stock exchanges, index levels, listed securities, price history, FX rates
Trade4Bilateral trade flows, top partners, product breakdowns
Policies6Laws, regulations, policy timelines, lifecycle events
Sources & platform3Data provenance and platform info — World Bank, IMF, UN, Ember, central banks
Geographies1Continent / region / subregion hierarchy

All tools are read-only (annotated readOnly + idempotent) and return both human-readable text and structured JSON output for programmatic clients.

Configuration

Environment VariableRequiredDefaultDescription
AFRICA_API_KEYYes—Your Africa API bearer token
AFRICA_API_BASE_URLNohttps://api.africa-api.comOverride for local development

Development

git clone https://github.com/africa-api/africa-api-mcp.git
cd africa-api-mcp
npm install
npm run build

# Run directly
AFRICA_API_KEY=your-key node dist/index.js

# Test with MCP inspector
AFRICA_API_KEY=your-key npx @modelcontextprotocol/inspector node dist/index.js

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.