Skip to main content
Glama
anilsharmay

Country Explorer MCP Server

by anilsharmay

MCP Demo: Country Explorer with LangGraph

๐ŸŒ Country Explorer: MCP + LangGraph Integration

This project demonstrates a complete MCP (Model Context Protocol) server integrated with LangGraph to create beautiful country profiles with embedded images.

Related MCP server: Unsplash MCP Server

โœจ Features

  • ๐Ÿ” MCP Server with Unsplash Search API integration

  • ๐Ÿค– LangGraph Agent for intelligent country exploration

  • ๐Ÿ–ผ๏ธ 10 Images per Country with photographer credits

  • ๐Ÿ“„ Beautiful Markdown Profiles with embedded images

  • ๐Ÿงช Comprehensive Test Suite for validation

  • ๐Ÿ“ Organized Project Structure with profiles/ and tests/ folders

๐Ÿ—๏ธ Project Structure

mcp-demo/
โ”œโ”€โ”€ country_explorer.py          # Main LangGraph app (10 images)
โ”œโ”€โ”€ server.py                   # MCP server with Unsplash API
โ”œโ”€โ”€ profiles/                   # ๐Ÿ“ Generated country profiles
โ”‚   โ”œโ”€โ”€ india_profile.md
โ”‚   โ”œโ”€โ”€ japan_profile.md
โ”‚   โ”œโ”€โ”€ uganda_profile.md
โ”‚   โ””โ”€โ”€ usa_profile.md
โ”œโ”€โ”€ tests/                      # ๐Ÿ“ Test files
โ”‚   โ”œโ”€โ”€ test_country_explorer.py
โ”‚   โ”œโ”€โ”€ test_unsplash.py
โ”‚   โ””โ”€โ”€ search_5_mountains.py
โ””โ”€โ”€ .env                        # API keys

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13+

  • Unsplash API key

  • OpenAI API key

Installation

  1. Clone the repository:

    git clone https://github.com/anilsharmay/mcp-demo.git
    cd mcp-demo
  2. Install dependencies:

    uv sync
  3. Configure environment variables: Create .env file with your API keys:

    UNSPLASH_API_KEY=your_unsplash_api_key_here
    OPENAI_API_KEY=your_openai_api_key_here
    TAVILY_API_KEY=your_tavily_api_key_here

Running the Country Explorer

  1. Start the MCP server:

    uv run mcp dev server.py
  2. Run the Country Explorer:

    uv run python country_explorer.py
  3. Run tests:

    cd tests && uv run python test_country_explorer.py

๐ŸŽฏ MCP Server Tools

The MCP server provides these tools:

  • unsplash_search: Search for beautiful images with orientation filters

  • web_search: Search the web for country information

  • roll_dice: Roll dice with custom notation

๐Ÿค– LangGraph Agent

The Country Explorer agent:

  • Researches countries using web search

  • Finds 10 beautiful images via Unsplash

  • Creates rich markdown profiles with embedded images

  • Includes photographer credits and links

๐Ÿ“ธ Sample Output

Each country profile includes:

  • Cultural information and history

  • Geographic details and landmarks

  • 10 high-quality images with credits

  • Clean markdown formatting for easy viewing

๐ŸŽฌ Demo GIFs

India Profile:

India Profile Demo

Switzerland Profile:

Switzerland Profile Demo

USA Profile:

USA Profile Demo

๐Ÿงช Testing

Run the comprehensive test suite:

# Test MCP server
uv run python tests/test_unsplash.py

# Test Country Explorer
cd tests && uv run python test_country_explorer.py

# Test mountain search
uv run python tests/search_5_mountains.py

๐Ÿ”ง MCP Configuration

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "unsplash-mcp-server": {
      "command": "uv",
      "args": ["--directory", ".", "run", "server.py"]
    }
  }
}

๐Ÿ“š Technologies Used

  • MCP (Model Context Protocol) - Server framework

  • LangGraph - Agent orchestration

  • LangChain MCP Adapters - Tool integration

  • Unsplash API - Image search

  • OpenAI GPT-4 - Language model

  • Python 3.13 - Runtime environment

๐ŸŽ‰ Showcase

This project demonstrates:

  • โœ… MCP Server Development with custom API integration

  • โœ… LangGraph Agent Creation with tool orchestration

  • โœ… Beautiful Output Generation with embedded images

  • โœ… Clean Project Organization and testing

  • โœ… Real-world Application of AI agent frameworks

Perfect for showcasing MCP + LangGraph integration! ๐ŸŒโœจ

Available Tools

3 tools
roll_diceC

Roll the dice with the given notation

ParametersJSON Schema
NameRequiredDescriptionDefault
notationYes
num_rollsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to mention the format of accepted notation, whether the roll is random, any constraints, error behavior, or the return value. This is a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short and front-loaded, but it is under-specified. Every sentence is technically earned but the content is insufficient. It is concise at the expense of usefulness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite being a simple tool, the description is incomplete for an agent to use it correctly. It does not explain the expected notation syntax or the number of rolls, and while an output schema exists, the description does not help connect inputs to outputs. The description needs more detail to be functionally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for parameter meaning. It only vaguely references 'notation' and completely ignores the 'num_rolls' parameter. The description provides essentially no semantic information beyond the parameter names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description is essentially a restatement of the tool name ('roll dice') with a vague reference to 'given notation'. It communicates the basic action but adds no detail about what notation is or how it differs from other tools. It's minimally clear but not strongly differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives, nor any context about suitable scenarios. The description simply states the action without implying any usage conditions or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • Changedroll_dice1 field changed
      • addedInput schema / title
        Added value: +"roll_diceArguments"
    • Changedunsplash_search1 field changed
      • addedInput schema / title
        Added value: +"unsplash_searchArguments"
    • Changedweb_search1 field changed
      • addedInput schema / title
        Added value: +"web_searchArguments"
  2. 3 tool updates
    • First observedroll_dice
    • First observedunsplash_search
    • First observedweb_search

TDQS

C2.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no ambiguity: roll_dice is for dice rolling, unsplash_search is for photo searches, and web_search is for general web searches. The domains are completely separate, making misselection unlikely.

Naming Consistency2/5

The naming is inconsistent with mixed conventions: roll_dice uses snake_case, unsplash_search uses snake_case, and web_search uses snake_case, but the verb styles vary (roll vs. search). There is no predictable pattern like verb_noun consistency across tools.

Tool Count2/5

With only 3 tools, the set feels thin for a server named 'Country Explorer MCP Server', which suggests a domain focused on country-related exploration. The tools do not align with this purpose, indicating a significant mismatch in scope.

Completeness1/5

The tool surface is severely incomplete for the stated purpose of country exploration. There are no tools for retrieving country data, demographics, maps, or other relevant information, leaving obvious gaps that will cause agent failures in this domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides access to the Unsplash API, enabling AI assistants to search and retrieve high-quality photos, browse collections, view photographer profiles, and get photo statistics with advanced filtering options.
    415
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Enables users to search for high-quality photos on Unsplash with support for advanced filtering by orientation and content safety. It provides formatted photo metadata and images in either base64-encoded format or as JSON with URLs via stdio transport.
    1
    27
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching and downloading photos from Unsplash via the Unsplash API, with support for pagination, orientation filtering, and multiple resolutions.
    415
    1
    MIT