# Visibility Graph Path Calculator AI Agent Connect

> Visibility Graph Path Calculator MCP handles complex geometric computations for 2D navigation. It allows your AI client to build visibility graphs, calculate optimal routes using Euclidean distance, and verify that paths maintain necessary safety buffers or boundary rules when navigating around polygonal obstacles.

## Overview
- **Category:** geometry
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_EAXzf31OjyvcXeBMHHkVWg3XtGrreG0GlPeWjG1z/ai-agent-connect
- **Tags:** geometry, pathfinding, visibility-graph, collision-avoidance, 2d-navigation

## Description

You can use this MCP to solve pathfinding problems in 2D environments filled with polygonal obstacles. Instead of manually calculating coordinates, you let your agent handle the geometry. It builds a graph of all valid connections between your start and goal points while respecting the vertices of the obstacles in your way. Once the graph is ready, your agent finds the most efficient route based on the distance metrics you specify. It also handles the safety side of things, checking that your path doesn't graze an obstacle or violate specific boundary constraints. This is useful for anyone needing to automate geometric routing or collision avoidance logic within an AI-driven workflow.

## Tools

### calculate_shortest_path
This tool finds the most efficient route through a visibility graph. It uses specific cost metrics to determine the best path.

### get_visible_graph
This tool builds the visibility graph for your environment. It identifies all valid connections between the start, goal, and obstacle vertices.

### validate_boundary_compliance
This tool checks if a path follows your chosen intersection rules. It verifies if a path stays strictly outside or adheres to specific boundary conventions.

### analyze_path_clearance
This tool checks the safety buffer of a specific path. It ensures your route maintains the required distance from obstacles.

## Prompt Examples

**Prompt:** 
```
Find the shortest path from (0,0) to (10,10) avoiding a square obstacle at (4,4) with vertices (4,4), (6,4), (6,6), (4,6) and a clearance of 1.
```

**Response:** 
```
The shortest path from (0,0) to (10,10) avoiding the obstacle with a 1-unit clearance follows the vertices (0,0), (3,3), (7,7), and (10,10) for a total distance of approximately 14.14 units.
```

**Prompt:** 
```
Check if the path [(0,0), (5,5), (10,10)] is compliant with the 'strictly_outside' rule for an obstacle at (5,4), (6,4), (6,5), (5,5).
```

**Response:** 
```
The path is not compliant. The segment between (0,0) and (5,5) touches the obstacle boundary, violating the 'strictly_outside' requirement.
```

**Prompt:** 
```
What is the minimum clearance for a path going from (0,0) to (10,0) with an obstacle at (5,1), (6,1), (6,2), (5,2)?
```

**Response:** 
```
The minimum clearance for the direct path from (0,0) to (10,0) relative to the specified obstacle is 1.0 units.
```

## Capabilities

### Graph Construction
Your agent builds a complete visibility graph from start, goal, and obstacle vertices.

### Optimal Routing
Your agent calculates the shortest distance between points using Euclidean metrics.

### Safety Verification
Your agent checks if a path maintains a specific clearance buffer from obstacles.

### Boundary Validation
Your agent confirms if a path adheres to strict intersection or boundary rules.

## Use Cases

### Robot Navigation
Calculate a path for a mobile robot to move through a room full of furniture without hitting anything.

### Game AI Pathfinding
Determine the most efficient way for a character to move around walls in a 2D top-down game.

### Spatial Constraint Checking
Verify that a proposed flight or transit path stays a safe distance from restricted polygonal zones.

### Geometric Optimization
Find the absolute shortest route between two coordinates while navigating around complex shapes.

## Benefits

- Automates the construction of visibility graphs from raw vertex data.
- Calculates shortest paths using Euclidean distance metrics.
- Verifies safety buffers to prevent obstacle collisions.
- Validates path compliance against specific boundary rules.

## How It Works

You connect the MCP to your client and start sending geometric data for processing.

1. Connect your AI client to the Vinkius-hosted MCP.
2. Provide the coordinates for the start point, goal, and polygonal obstacles.
3. Your agent uses get_visible_graph to map out valid connections.
4. Your agent runs calculate_shortest_path to find the best route.
5. Your agent uses analyze_path_clearance to confirm the route is safe.

## Frequently Asked Questions

**What kind of geometry does this MCP support?**
It works with 2D planes and polygonal obstacles defined by vertices.

**How does the MCP find the shortest path?**
It uses the visibility graph and calculates the route based on Euclidean distance.

**Can I check if a path is safe?**
Yes, you can use the analyze_path_clearance tool to verify safety buffers.

**Which AI clients can use this MCP?**
You can use it with any MCP-compatible client like Claude, Cursor, or Windsurf.

**Does it handle boundary rules?**
Yes, the validate_boundary_compliance tool checks if paths follow specific intersection conventions.

**How do I ensure the path stays away from obstacles?**
You can use the `get_visible_graph` tool with a specified `clearanceMargin` to ensure all connections maintain a minimum distance from obstacle vertices and edges.

**Can I choose different distance metrics for the path?**
Yes, the `calculate_shortest_path` tool allows you to specify an `edgeCostMetric`, such as Euclidean distance.

**How do I verify if a path is safe?**
Use the `analyze_path_clearance` tool to receive a report on the minimum clearance and any potential violations found along the path segments.
