<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bobby</title>
    <description>The latest articles on Forem by Bobby (@youngbobby).</description>
    <link>https://forem.com/youngbobby</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3848656%2Fc1130499-d867-4743-9cfc-7b690b574c6e.jpeg</url>
      <title>Forem: Bobby</title>
      <link>https://forem.com/youngbobby</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/youngbobby"/>
    <language>en</language>
    <item>
      <title>I Gave Claude Access to Data on All 54 African Countries. Here's How.</title>
      <dc:creator>Bobby</dc:creator>
      <pubDate>Sun, 29 Mar 2026 18:45:25 +0000</pubDate>
      <link>https://forem.com/youngbobby/i-gave-claude-access-to-data-on-all-54-african-countries-heres-how-1oeo</link>
      <guid>https://forem.com/youngbobby/i-gave-claude-access-to-data-on-all-54-african-countries-heres-how-1oeo</guid>
      <description>&lt;p&gt;African data is hard to find, scattered across dozens of sources, and painful to work with. World Bank CSVs. UN PDF reports. Central bank websites that haven't been updated since 2019.&lt;/p&gt;

&lt;p&gt;I built an MCP server that fixes this. One &lt;code&gt;npx&lt;/code&gt; command, and Claude can pull live data on any African country -- GDP, elections, trade flows, stock markets, government officials, policy timelines, all of it.&lt;/p&gt;

&lt;p&gt;Here's how to set it up and what you can do with it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt; lets you give Claude new capabilities by connecting external tools. Instead of pasting data into your prompt, Claude calls the tools directly and gets structured responses.&lt;/p&gt;

&lt;p&gt;The Africa API MCP server exposes &lt;strong&gt;40 tools&lt;/strong&gt; across 9 domains. Claude picks the right tool based on your question, calls the API, and reasons over the results.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setup (2 minutes)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Get an API key
&lt;/h3&gt;

&lt;p&gt;Sign up at &lt;a href="https://africa-api.com" rel="noopener noreferrer"&gt;africa-api.com&lt;/a&gt; and grab a key from your dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Connect to Claude
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Claude Desktop&lt;/strong&gt; -- add this to your config file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt; (macOS)&lt;br&gt;
&lt;code&gt;%APPDATA%\Claude\claude_desktop_config.json&lt;/code&gt; (Windows)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"africa-api"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"africa-api-mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"AFRICA_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-key-here"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; -- even simpler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add africa-api &lt;span class="nt"&gt;--&lt;/span&gt; npx &lt;span class="nt"&gt;-y&lt;/span&gt; africa-api-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Claude. That's it. No &lt;code&gt;npm install&lt;/code&gt;, no cloning repos. &lt;code&gt;npx&lt;/code&gt; handles everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  What You Can Actually Do With This
&lt;/h2&gt;

&lt;p&gt;This isn't a toy. Here are real use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compare economies across countries
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"Compare GDP growth between Nigeria, Kenya, and South Africa from 2015 to 2024"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude calls &lt;code&gt;query_data&lt;/code&gt; with multiple country codes and the GDP indicator, gets the time series, and builds a comparison. It can spot trends, inflection points, and outliers on its own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Track political leadership
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"Who is the current president of Senegal? When did they take office? Who was their predecessor?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude hits &lt;code&gt;get_government_overview&lt;/code&gt;, &lt;code&gt;search_leaders&lt;/code&gt;, and &lt;code&gt;list_government_terms&lt;/code&gt; to build the full picture. Current and historical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Analyze trade relationships
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"What are Ethiopia's top 5 export partners and what products do they trade?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two tool calls -- &lt;code&gt;get_trade_partners&lt;/code&gt; and &lt;code&gt;get_trade_products&lt;/code&gt; -- and Claude has the bilateral trade data with dollar values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monitor elections
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"What elections are happening in Africa in 2026?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;get_upcoming_elections&lt;/code&gt; returns the calendar. Claude can then drill into any specific election with &lt;code&gt;get_election&lt;/code&gt; and &lt;code&gt;get_election_results&lt;/code&gt; for candidates and vote counts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check market data
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"Show me the top 10 stocks on the Nigerian Exchange by market cap"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude queries &lt;code&gt;list_tickers&lt;/code&gt; filtered by NGX, then can pull price history with &lt;code&gt;get_ticker_history&lt;/code&gt; for any security. Works across JSE, BRVM, Casablanca, and other African exchanges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Research policy and regulation
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"What major laws has Rwanda enacted in the last 5 years?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;list_policies&lt;/code&gt; with country and year filters, then &lt;code&gt;get_country_policy_timeline&lt;/code&gt; for the chronological view. Covers constitutions, laws, regulations, bills, and decrees.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get FX rates
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"What's the current exchange rate for the Nigerian Naira, Kenyan Shilling, and South African Rand against the dollar? Show me 6-month trends."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;get_fx_rates&lt;/code&gt; for current rates, &lt;code&gt;get_fx_rate_history&lt;/code&gt; for the time series.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Full Tool Set
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;What It Covers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Countries&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Profiles, real-time signals for all 54 nations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Indicators&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;127+ metrics (GDP, population, health, education), rankings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Government&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Heads of state, cabinets, terms -- current and historical&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elections&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Results, upcoming elections, candidate data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Markets&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Stock exchanges, tickers, OHLC price history, FX rates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trade&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Bilateral flows, top partners, product breakdowns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Policies&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Laws, regulations, timelines, lifecycle events&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sources&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Data provenance -- World Bank, UN, central banks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Geographies&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Continent/region/subregion hierarchy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All 40 tools are read-only. No write operations, no side effects.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works Under the Hood
&lt;/h2&gt;

&lt;p&gt;The server is a TypeScript app built on the official &lt;code&gt;@modelcontextprotocol/sdk&lt;/code&gt;. Each tool is a thin wrapper around a REST endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;get_country&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Get detailed information about a specific African country&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;country_code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ISO 3166-1 alpha-2 code (e.g. "NG", "KE", "ZA")&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;READ_ONLY&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;country_code&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;apiGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/v1/countries/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;country_code&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;apiGet&lt;/code&gt; helper handles auth, error formatting, and parameter cleaning. Claude gets back structured JSON that it can reason over.&lt;/p&gt;

&lt;p&gt;Key design decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bearer token via env var&lt;/strong&gt; -- standard MCP pattern. Set it once, forget it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Startup warning&lt;/strong&gt; if the API key is missing -- saves debugging time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clear error messages&lt;/strong&gt; on 401/403 -- tells Claude (and you) exactly what's wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read-only safety annotations&lt;/strong&gt; -- so Claude knows these tools don't modify anything.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx &lt;span class="nt"&gt;-y&lt;/span&gt; africa-api-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/africa-api-mcp" rel="noopener noreferrer"&gt;africa-api-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/africa-api/africa-api-mcp" rel="noopener noreferrer"&gt;africa-api/africa-api-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API:&lt;/strong&gt; &lt;a href="https://africa-api.com" rel="noopener noreferrer"&gt;africa-api.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built by the &lt;a href="https://africa-api.com" rel="noopener noreferrer"&gt;Africa API&lt;/a&gt; team. The API covers all 54 African nations with data from the World Bank, UN agencies, central banks, stock exchanges, and government sources.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>opensource</category>
      <category>africa</category>
    </item>
  </channel>
</rss>
