Skip to main content

MCP Server PROJ

A Model Context Protocol (MCP) server for coordinate system transformations and map projections.

Features

  • Multiple coordinate system format support:
    • EPSG codes
    • WKT (Well-Known Text)
    • Proj string format
  • Batch coordinate transformation
  • Simple and intuitive API
  • Dual-mode operation: server or library

Installation

pip install mcp-server-proj

Usage

Server Mode

mcp-server-proj

Library Mode

from mcp_server_proj import CoordinateTransformer

# Create transformer instance
transformer = CoordinateTransformer()

# Set source and target coordinate systems
transformer.set_source_crs("EPSG:4326")  # WGS84
transformer.set_target_crs("EPSG:3857")  # Web Mercator

# Initialize transformer
transformer.initialize_transformer()

# Transform coordinates
x, y = transformer.transform_point(116.3, 39.9)
print(f"Transformed coordinates: ({x}, {y})")

API Documentation

CoordinateTransformer

The main coordinate transformation class provides the following methods:

  • set_source_crs(crs: str): Set source coordinate system
  • set_target_crs(crs: str): Set target coordinate system
  • initialize_transformer(): Initialize the transformer
  • transform_point(x: float, y: float) -> tuple[float, float]: Transform a single point

Server

The MCP protocol server provides two tools:

  • transform-coordinates: Transform coordinates between different systems

    {
      "source_crs": "EPSG:4326",
      "target_crs": "EPSG:3857",
      "coordinates": [
        {"x": 116.3, "y": 39.9}
      ]
    }
    
  • list-supported-crs: List all supported coordinate systems

Supported Coordinate Systems

1. EPSG Codes

Standard identifiers for coordinate reference systems:

  • EPSG:4326 - WGS84 Geographic
  • EPSG:3857 - Web Mercator
  • And many more...

2. WKT Format

Example of a geographic coordinate system:

GEOGCS["WGS 84",
  DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563]],
  PRIMEM["Greenwich",0],
  UNIT["degree",0.0174532925199433]]

3. Proj Format

Example of WGS84:

+proj=longlat +datum=WGS84 +no_defs +type=crs

Development

Debugging

For the best debugging experience, use the MCP Inspector:

npx @modelcontextprotocol/inspector mcp-server-proj

Dependencies

  • Python >= 3.12
  • mcp >= 1.3.0
  • pyproj >= 3.0.0

License

MIT

Author

radial-hks (radialjiajie@gmail.com)

Contributing

Issues and Pull Requests are welcome!

Metadata

Release files for mcp-server-proj 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-proj 1.0.0
File Size Uploaded Provenance Actions
mcp_server_proj-1.0.0.tar.gz 111.9 kB Without provenance Details for mcp_server_proj-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-proj 1.0.0
File Interpreter ABI Platform Actions
mcp_server_proj-1.0.0-py3-none-any.whl Python 3 none any Details for mcp_server_proj-1.0.0-py3-none-any.whl

Total release size: 119.4 kB

Release files / mcp_server_proj-1.0.0.tar.gz

Download URL mcp_server_proj-1.0.0.tar.gz
Size 111.9 kB
Tags Source
SHA-256 checksum
How to use checksums
21296b0eb03dcfc781370b9f47dc08701b5783d5f8dbea82f3968c345c409749
BLAKE2b-256 checksum
How to use checksums
63e2a3305f65606abc0c3682f0e7b4680b8da8138891a6fa5374a148ae114c93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / mcp_server_proj-1.0.0-py3-none-any.whl

Download URL mcp_server_proj-1.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3a0e70e09ca39fedc17be6502c80cb861fb5cebab7c065878daaa76b0d5c4e6
BLAKE2b-256 checksum
How to use checksums
a04b06f2d4a2586a4dce2acaa7e326aef62c433fa5b0fae45c47368e92e43bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for mcp-server-proj 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page