Sponsored by Deepsite.site

Valencia Smart City MCP Server

Created By
sosanzma8 months ago
MCP server providing real-time traffic, bike-sharing, air quality and weather data from Valencia,
Content

Valencia Smart City MCP Server

MCP server providing real-time traffic, bike-sharing, air quality and weather data from Valencia, Spain for Claude and other LLMs.

Features

  • Real-time traffic conditions across Valencia
  • Valenbisi bike station availability
  • Air quality monitoring data from city stations
  • Weather data from Open-Meteo API (current, forecast, and historical)
  • Traffic congestion analysis
  • Search capabilities for specific roads, bike stations, or air quality information

Demo

Check out a live demos of this MCP in action with Claude Desktop :

Air quality: Claude MCP Demo Chat Air quality

Bike-sharing with Valenbisi : Claude MCP Demo Chat Valenbisi

Traffic : Claude MCP Demo Chat Traffic

Weather : Claude MCP Demo Chat Weather

This shared conversation demonstrates how Claude can access and analyze real-time Valencia urban data through the MCP.

Requirements

  • Python 3.10+
  • Claude Desktop or other MCP-compatible client
  • Internet connection

Installation

# Clone the repository
git clone https://github.com/yourusername/SmartCityMCP.git
cd SmartCityMCP

# Install dependencies
pip install -r requirements.txt

Tools

The server exposes these tools:

Traffic Tools

  • get_traffic_status

    • Get current traffic status for road segments
    • Input: state_filter (optional, integer[]) - Filter by traffic state codes
    • Returns: List of road segments with their traffic states
  • get_congestion_summary

    • Get summary of current traffic congestion in Valencia
    • Returns: Statistics including congested segments and percentages
  • search_road_segment

    • Search for specific road segments by name
    • Input: name_query (string) - Case-insensitive search term
    • Returns: List of matching road segments with current state

Bike Sharing Tools

  • find_available_bikes

    • Find bike stations with available bikes
    • Inputs:
      • min_bikes (integer, default: 1) - Minimum number required
      • near_address (string, optional) - Address to search near
    • Returns: List of stations matching criteria with availability info
  • get_bike_station_status

    • Get detailed status of bike stations
    • Input: station_id (string, optional) - For specific station
    • Returns: Detailed status including bikes available and free slots

Air Quality Tools

  • get_air_quality_summary

    • Get overview of air quality across Valencia
    • Returns: Summary statistics of pollutant levels and air quality ratings
  • find_nearest_air_station

    • Find closest air quality monitoring station to coordinates
    • Inputs:
      • latitude (float) - Latitude coordinate
      • longitude (float) - Longitude coordinate
    • Returns: Nearest station details with distance and current readings
  • get_station_data

    • Get detailed information about air quality monitoring stations
    • Input: station_name (string) - Name to search for (partial match)
    • Returns: Detailed pollutant data for matching stations
  • get_pollutant_levels

    • Get levels of a specific pollutant across all stations
    • Input: pollutant (string) - Pollutant type (so2, no2, o3, co, pm10, pm25)
    • Returns: Measurements of specified pollutant with statistics
  • get_air_quality_map

    • Get geospatial data of air quality stations for mapping
    • Returns: Location data with quality ratings and pollutant levels

Weather Tools

  • get_current_weather

    • Get current weather conditions in Valencia
    • Returns: Current weather data including temperature, humidity, wind speed, and weather description
  • get_weather_forecast

    • Get weather forecast for Valencia
    • Input: days (integer, default: 3) - Number of days to forecast (1-7)
    • Returns: Hourly weather forecasts for the requested period
  • get_historical_weather

    • Get historical weather data for Valencia
    • Inputs:
      • start_date (string) - Start date in YYYY-MM-DD format
      • end_date (string) - End date in YYYY-MM-DD format
    • Returns: Historical weather data for the specified period
  • get_daily_weather_summary

    • Get daily weather summary for Valencia
    • Input: day_offset (integer, default: 0) - Day offset (0=today, 1=tomorrow, etc.)
    • Returns: Daily weather summary with min/max/avg values

Claude Desktop Integration

Add this to your claude_desktop_config.json (typically found in %APPDATA%\Claude on Windows or ~/Library/Application Support/Claude on macOS):

{
  "mcpServers": {
    "valenciaSmartCity": {
      "command": "uv",
      "args": ["run", "valencia_traffic_mcp.py"]
    }
  }
}

Alternatively, install directly with:

mcp install valencia_traffic_mcp.py --name "Valencia Smart City"

Development

Run the server directly:

# Run with MCP Inspector for development
mcp dev valencia_traffic_mcp.py

# Run directly (stdio transport)
python valencia_traffic_mcp.py

Example Queries

  • "How's the traffic in Valencia right now?"
  • "Are there any congested streets in downtown Valencia?"
  • "Where can I find a Valenbisi bike near the City Hall?"
  • "What's the air quality like in Valencia today?"
  • "Which areas of Valencia have the highest pollution levels?"
  • "What's the nearest air quality monitoring station to the train station?"
  • "Show me the NO2 levels across Valencia"
  • "What's the weather forecast for Valencia this week?"
  • "Will it rain tomorrow in Valencia?"
  • "What were the temperatures in Valencia last week?"
  • "Is it a good day for cycling in Valencia today?"

Data Sources

This server connects to the following data sources:

  • Valencia's open data platform:

    • Traffic data: estat-transit-temps-real-estado-trafico-tiempo-real
    • Bike stations: valenbisi-disponibilitat-valenbisi-disponibilidad
    • Air quality: estacions-contaminacio-atmosferiques-estaciones-contaminacion-atmosfericas
  • Open-Meteo API:

    • Current weather data
    • Weather forecast
    • Historical weather data

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.