Africa Api Mcp

io.github.africa-api由 GitHub 账号 africa-api 发布v0.1.1更新于 Oct 25, 2026

MCP server for Africa API — access data on all 54 African countries through Claude

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

本地 MCP 服务器,让助手以只读方式访问 Africa API 关于全部 54 个非洲国家的数据,涵盖经济指标、市场、贸易、政府与政策。

可以做什么
查询全部 54 个非洲国家的国家详情、概况和实时信号,以及大洲、区域和次区域层级。查询 200 多项指标(如 GDP、人口、健康、能源),支持时间序列和国家排名。获取国家元首、内阁和任期信息,以及选举结果和即将举行的选举。查看证券交易所、指数水平、上市证券、价格历史和汇率。比较双边贸易流量、主要伙伴和产品构成,并查阅法律、法规和政策时间线。查看数据来源与平台信息,如世界银行、IMF、联合国和各国央行。
适用场景
当需要在对话中获得有来源、结构化的非洲经济、政治、市场或贸易事实时适用,例如比较各国 GDP、查询汇率或梳理政策时间线。
运行要求
通过 npx 在本地运行,需要 Node.js,无需安装或托管。需要 Africa API 账户,并通过 AFRICA_API_KEY 环境变量提供 API 密钥。需要访问 Africa API 端点的网络连接;可用 AFRICA_API_BASE_URL 覆盖默认地址。
安装前请注意
AFRICA_API_KEY 是密钥,会写入客户端配置文件,请勿放入共享或提交到版本库的配置中。所有工具据称均为只读,不会写入或修改数据。查询内容和密钥会发送给第三方 Africa API 服务。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Africa Api Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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):

bash
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:

json
{  "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:

bash
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

bash
git clone https://github.com/africa-api/africa-api-mcp.gitcd africa-api-mcpnpm installnpm run build
# Run directlyAFRICA_API_KEY=your-key node dist/index.js
# Test with MCP inspectorAFRICA_API_KEY=your-key npx @modelcontextprotocol/inspector node dist/index.js

License

MIT

来源:README.md,提交 92f8a91

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分