jts-mcp

shubhranshugupta/jts-mcp

3.2

If you are the rightful owner of jts-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MCP server exposing selected library functions from library JTS (Java Topology Suite) to solve Geospatial problems using Agentic AI.

jts-mcp

MCP server exposing selected library functions from library JTS (Java Topology Suite) to solve Geospatial problems using Agentic AI

Features

  • Extensive geospatial tools exposed as Spring AI tools
  • Endpoints for geometry creation, spatial queries, and transformations

Tools

  • createPoint - Create a Point geometry from [x, y] coordinates and return WKT.
  • createLine - Create a LineString geometry from a list of [x, y] coordinates and return WKT..
  • createPolygon - Create a Polygon geometry from a list of [x, y] coordinates and return WKT.
  • bufferGeometry - Buffer a geometry by a given distance and return WKT.
  • intersects - Check if two geometries intersect..
  • contains - Check if the first geometry contains the second.
  • distance - Calculate the distance between two geometries.
  • unaryUnionLines - Merge all LineStrings into one network using UnaryUnionOp.
  • getBoundary - Extract the boundary of a geometry as a LineString.
  • intersectGeometries - Intersect two geometries and return the result as WKT.
  • mergeAndSelectLongestChain - Merge intersected boundary segments into continuous chains and pick the longest one.
  • projectOnRing - Project a point onto a ring and return the index.
  • extractSubLine - Extract a subline from a ring between two indices.
  • makePolygonFromRing - Create a Polygon from a closed LineString WKT.
  • rebuildPolygonRing - Rebuild a polygon ring by splicing source ring and target chain.
  • isValidGeometry - Check if a geometry is valid.
  • polygonize - Polygonize: Create all possible polygons from a network of LineStrings.
  • calculateArea - Calculate the area of a polygon.
  • calculateCentroid - Calculate the centroid of a polygon and return as Point WKT.
  • hausdorffDistance - Calculate the Hausdorff distance between two polygons.

Integration with Agentic AI

  • Use the SSE integration from the MCP Client to inform your LLM about available endpoints and their usage.
    • e.g configuration in MCP client:
      mcp:
        client:
          enabled: true
          name: jts-mcp-client
          version: 1.0.0
          type: SYNC
          request-timeout: 20s
          toolcallback.enabled: true
          sse:
            connections:
              jts-mcp-sse:
                url: http://localhost:8081
      
  • Example workflow:
    1. User provides a geospatial problem statement.
    2. Spring AI app sends it to LLM.
    3. LLM returns actions (e.g., buffer, intersect, fix).
    4. Spring AI app calls MCP endpoints to execute actions and sends results back to LLM.
    5. LLM iterates until the problem is solved.
    6. Final result is presented to the user.

Running the Server

mvn spring-boot:run