geo-visualization-engine
A graphical interface for real-time map interaction, facilitating data querying and visualization. It leverages a backend integration with PostgreSQL/PostGIS for managing OpenStreetMap datasets and employs Server-Sent Events (SSE) for dynamic server-to-client updates.
Author

ngoiyaeric
Quick Info
Actions
Tags
MCP-GeoViz: OpenStreetMap Data Visualization Module
This module integrates OpenStreetMap capabilities into the MCP framework, enabling users to retrieve and display geospatial information directly within the MCP environment.
Core Capabilities
- Client-side map rendering utilizing Leaflet and OpenStreetMap tiles.
- Asynchronous data pipeline employing Server-Sent Events (SSE) for pushing updates from the server.
- A suite of MCP-specific controls for manipulating the map display (e.g., adding graphical elements like markers/polygons, adjusting the viewport).
- Direct execution interface for SQL queries against the underlying OpenStreetMap data stored in a PostGIS-enabled PostgreSQL instance.
Deployment Configuration
To initialize the service, configure your environment as follows (example claude_desktop_config.json):
{
"mcpServers": {
"OSM PostgreSQL Server": {
"command": "/Users/wiseman/.local/bin/uv",
"args": [
"run",
"--env-file",
".env",
"--with",
"mcp[cli]",
"--with",
"psycopg2",
"--with-editable",
"/Users/wiseman/src/mcp-osm",
"--directory",
"/Users/wiseman/src/mcp-osm",
"mcp",
"run",
"mcp.py"
]
}
}
}
Upon successful initialization of the MCP backend server, the interactive map visualization tool becomes accessible via HTTP at http://localhost:8889/.
Runtime Parameters
Configuration of the visualization service is managed through environment variables:
FLASK_HOST- Specifies the network interface binding for the Flask web application (defaults to 127.0.0.1).FLASK_PORT- Determines the TCP port for the map server (defaults to 8889).PGHOST- The hostname or IP address for the backing PostgreSQL database (defaults to localhost).PGPORT- The port number for the PostgreSQL connection (defaults to 5432).PGDB- The target database schema name (defaults to osm).PGUSER- Credentials for database access: username (defaults to postgres).PGPASSWORD- Credentials for database access: secret key (defaults to postgres).
Available MCP Interfaces
The following remote procedure calls (RPCs) are exposed for programmatic map manipulation:
get_map_view- Retrieves the current geographic extents displayed on the map.set_map_view- Adjusts the map's center point and zoom level to specified coordinates or boundary box.set_map_title- Updates the textual label displayed in the lower-right corner of the map component.add_map_marker- Places a symbolic point of interest at specified latitude/longitude.add_map_line- Renders a path connecting a sequence of specified coordinate pairs.add_map_polygon- Draws a closed polygonal area defined by an ordered list of vertices.query_osm_postgres- Executes arbitrary SQL commands against the integrated OpenStreetMap data repository.
