Skip to main content

MCP for interacting with Street View imagery

Project description

Street View MCP

A Model-Client-Protocol (MCP) server for Google Street View API that enables AI models to fetch and display street view imagery and create virtual tours.

Using with Claude Desktop

To use Street View MCP with Claude Desktop:

  1. Ensure you have uv installed: UV Installation Guide
  2. Clone this repository:
    git clone https://github.com/vlad-ds/street-view-mcp.git
    cd street-view-mcp
    
  3. Install dependencies:
    uv pip install -e ".[dev]"
    
  4. Get a Google Maps API key (instructions below)
  5. Add the following to your Claude Desktop claude_desktop_config.json file:
"street_view": {
  "command": "uv",
  "args": [
    "run",
    "--directory",
    "/path/to/street-view-mcp",  // Replace with your actual path
    "mcp",
    "run",
    "src/street_view_mcp/server.py"
  ],
  "env": {
    "API_KEY": "your_google_maps_api_key_here"  // Add your API key here
  }
}

After configuration, you can use Street View MCP in Claude Desktop simply by typing "/street_view".

Overview

Street View MCP provides a simple interface for AI models to:

  1. Fetch Street View images by address, coordinates, or panorama ID
  2. Save images to local files
  3. Open saved images in the default viewer
  4. Create HTML pages that compile multiple Street View images into virtual tours

Requirements

  • Python 3.9+
  • Google Maps API key with Street View API enabled
  • fastmcp package
  • uv package manager (recommended)

Installation

# Clone the repository
git clone https://github.com/vlad-ds/street-view-mcp.git
cd street-view-mcp

# Create and activate a virtual environment with uv (recommended)
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
uv pip install -e ".[dev]"

API Key Setup

The Street View MCP requires a Google Maps API key with Street View API enabled:

  1. Visit the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the "Street View Static API" in the API Library
  4. Create an API key from the Credentials page
  5. Set the API key as an environment variable:
# Set temporarily in your shell:
export API_KEY=your_api_key_here

# Or create a .env file in the project root:
echo "API_KEY=your_api_key_here" > .env

Usage

Starting the MCP Server

python -m street_view_mcp.main --host 127.0.0.1 --port 8000

The server will be available to AI models at the specified host and port.

Using as a CLI Tool

# Fetch Street View image by address
python -m street_view_mcp.street_view --address "Empire State Building, NY" --output output/empire_state.jpg

# Fetch Street View image by latitude/longitude
python -m street_view_mcp.street_view --latlong "40.748817,-73.985428" --output output/coords.jpg --heading 180

# Fetch Street View image by panorama ID
python -m street_view_mcp.street_view --pano PANO_ID --output output/panorama.jpg

MCP Tools

The Street View MCP provides the following tools for AI models:

get_street_view

Fetches a Street View image based on location, coordinates, or panorama ID and saves it to a file.

{
  "filename": "empire_state.jpg",
  "location": "Empire State Building, NY",
  "size": "600x400",
  "heading": 90,
  "pitch": 10
}

Parameters:

  • filename (required): Name for saving the image (must not already exist)
  • location (optional): Address to get image for
  • lat_lng (optional): Comma-separated coordinates (e.g., "40.748817,-73.985428")
  • pano_id (optional): Specific panorama ID
  • size (optional): Image dimensions as "widthxheight" (default: "600x400")
  • heading (optional): Camera heading in degrees (0-360, default: 0)
  • pitch (optional): Camera pitch in degrees (-90 to 90, default: 0)
  • fov (optional): Field of view in degrees (10-120, default: 90)
  • radius (optional): Search radius in meters (default: 50)
  • source (optional): Image source ("default" or "outdoor", default: "default")

Note: Exactly one of location, lat_lng, or pano_id must be provided.

get_metadata

Fetches metadata about a Street View panorama.

{
  "location": "Empire State Building, NY"
}

Parameters:

  • Same location parameters as get_street_view
  • Returns JSON metadata with status, copyright, date, panorama ID, and coordinates

open_image_locally

Opens a saved Street View image in the default application.

{
  "filename": "empire_state.jpg"
}

Parameters:

  • filename (required): The filename of the image to open (must exist in output directory)

create_html_page

Creates an HTML page that displays multiple Street View images as a virtual tour.

{
  "filename": "nyc_tour.html",
  "title": "New York City Tour",
  "html_elements": [
    "<h1>New York City Landmarks Tour</h1>",
    "<p>Explore famous landmarks through Street View images.</p>",
    "<h2>Empire State Building</h2>",
    "<img src='../output/empire.jpg' alt='Empire State Building'>",
    "<p class='location'>350 Fifth Avenue, New York, NY</p>",
    "<p class='description'>This 102-story Art Deco skyscraper was completed in 1931.</p>"
  ]
}

Parameters:

  • html_elements (required): List of HTML content elements
  • filename (required): Name for the HTML file
  • title (optional): Page title (default: "Street View Tour")

Important: When referencing images, always use the path ../output/filename.jpg.

Creating Virtual Tours

The Street View MCP enables creation of virtual tours by combining multiple Street View images with descriptive text in an HTML page.

Example workflow for creating a tour:

  1. Fetch images of different locations:
get_street_view(filename="empire.jpg", location="Empire State Building, NY")
get_street_view(filename="times_square.jpg", location="Times Square, NY")
get_street_view(filename="central_park.jpg", location="Central Park, NY")
  1. Create an HTML tour page:
create_html_page(
  filename="nyc_tour.html",
  title="New York City Tour",
  html_elements=[
    "<h1>New York City Landmarks Tour</h1>",
    "<p>Explore these famous NYC landmarks through Street View images.</p>",
    
    "<h2>Empire State Building</h2>",
    "<img src='../output/empire.jpg' alt='Empire State Building'>",
    "<p class='location'>350 Fifth Avenue, New York, NY</p>",
    "<p class='description'>An iconic 102-story Art Deco skyscraper in Midtown Manhattan.</p>",
    
    "<h2>Times Square</h2>",
    "<img src='../output/times_square.jpg' alt='Times Square'>",
    "<p class='location'>Broadway & 7th Avenue, New York, NY</p>",
    "<p class='description'>Famous for its bright lights, Broadway theaters, and as the site of the annual New Year's Eve ball drop.</p>",
    
    "<h2>Central Park</h2>",
    "<img src='../output/central_park.jpg' alt='Central Park'>",
    "<p class='location'>Central Park, New York, NY</p>",
    "<p class='description'>An urban park spanning 843 acres in the heart of Manhattan.</p>"
  ]
)

Project Structure

  • street_view_mcp/
    • __init__.py: Package initialization
    • main.py: Entry point for MCP server
    • server.py: MCP server implementation
    • street_view.py: Core Street View API client

Important Notes

  • Local Storage: This tool saves all Street View images and HTML files locally in the output/ directory
  • No Automatic Cleanup: There is no built-in mechanism to delete saved files
  • Manual Cleanup: You should periodically clean up the output/ directory to manage disk space
  • API Usage: Each image request counts toward your Google Maps API quota and may incur charges

Development

Testing

pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_vlad_ds_street_view_mcp-0.1.1.tar.gz (365.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_vlad_ds_street_view_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_vlad_ds_street_view_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 365.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_vlad_ds_street_view_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e7f9ac7ad98e6e3031aa031a0662f8b1417a3e6030302c3d9b1f90eb8c78c76
MD5 e8567ea7a0a920ac334433c948b0213f
BLAKE2b-256 d9ec03cb0a6638be77a776cf4d5698fa140d9ab2ab0e0158ce445fdb76de79cf

See more details on using hashes here.

File details

Details for the file iflow_mcp_vlad_ds_street_view_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_vlad_ds_street_view_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_vlad_ds_street_view_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d78d217bc532492d613eb9a0997c77424f114da891cd99c42fa0e13d2202a95
MD5 d2057529f53fa4bd34faf48404f66a08
BLAKE2b-256 0d29b6405584e0649548da0ed577ac01ccf39260f1ac040c417ccfd8787841e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page