npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rest-countries-mcp

v1.0.1

Published

MCP server for REST Countries API - query country information through Model Context Protocol

Readme

REST Countries MCP Server

A Model Context Protocol (MCP) server that wraps the REST Countries API, built with FastMCP.

Features

This MCP server provides 12 tools for querying country information:

| Tool | Description | |------|-------------| | get_all_countries | Get a list of all countries | | search_country_by_name | Search countries by name (partial match supported) | | get_country_by_code | Get country by ISO 3166-1 code (alpha-2 or alpha-3) | | get_countries_by_codes | Get multiple countries by codes | | get_countries_by_currency | Filter countries by currency | | get_countries_by_language | Filter countries by language | | get_countries_by_capital | Search by capital city | | get_countries_by_region | Filter by region (Africa, Americas, Asia, Europe, Oceania) | | get_countries_by_subregion | Filter by subregion | | get_country_neighbors | Get neighboring countries | | get_country_details | Get comprehensive country information | | compare_countries | Compare multiple countries side by side |

Installation

Prerequisites

  • Node.js 16+
  • Python 3.10+
  • pip

Install from npm

npm install -g rest-countries-mcp

Install Python Dependencies

pip install fastmcp httpx

Usage

Configure in Claude Desktop

Add the following to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Method 1: Using npx (Recommended)

{
  "mcpServers": {
    "rest-countries": {
      "command": "npx",
      "args": ["-y", "rest-countries-mcp"]
    }
  }
}

Method 2: Global Installation

npm install -g rest-countries-mcp
{
  "mcpServers": {
    "rest-countries": {
      "command": "rest-countries-mcp"
    }
  }
}

Method 3: Direct Python

{
  "mcpServers": {
    "rest-countries": {
      "command": "python",
      "args": ["path/to/node_modules/rest-countries-mcp/server.py"]
    }
  }
}

Run Standalone

# Using npm
npx rest-countries-mcp

# Or if installed globally
rest-countries-mcp

# Or directly with Python
python server.py

Development Mode

fastmcp dev server.py

Example Queries

Once configured, you can ask Claude questions like:

  • "What countries are in Asia?"
  • "Tell me about Japan"
  • "What countries use the Euro?"
  • "Which countries speak Spanish?"
  • "Compare US, China, and India"
  • "What are the neighboring countries of Germany?"
  • "Search for countries with 'united' in their name"

API Response Format

Each country includes:

{
  "name": "Japan",
  "official_name": "Japan",
  "cca2": "JP",
  "cca3": "JPN",
  "capital": ["Tokyo"],
  "region": "Asia",
  "subregion": "Eastern Asia",
  "population": 125836021,
  "area": 377930,
  "languages": ["Japanese"],
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen",
      "symbol": "¥"
    }
  ],
  "flag_png": "https://flagcdn.com/w320/jp.png",
  "flag_svg": "https://flagcdn.com/jp.svg"
}

Resources

The server also provides two resources:

  • countries://regions - List of available regions
  • countries://info - Server information and available tools

Data Source

All country data is sourced from the REST Countries API (v3.1).

License

MIT