Metadata-Version: 2.4
Name: mightyspatial-mcp
Version: 0.1.0
Summary: MCP server for Mighty Spatial's IFC-to-GIS conversion API
Project-URL: Documentation, https://mightyspatial.com/docs
Project-URL: Web Converter, https://mightyspatial.com/convert
Project-URL: Dashboard, https://mightyspatial.com/dashboard
Project-URL: Homepage, https://mightyspatial.com
License-Expression: MIT
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp[cli]>=1.2.0
Description-Content-Type: text/markdown

# Mighty Spatial MCP Server

An MCP (Model Context Protocol) server that provides tools for converting IFC (BIM) files to GIS formats using the [Mighty Spatial](https://mightyspatial.com) API.

> **Try it in the browser:** [Web Converter](https://mightyspatial.com/convert) | [API Docs](https://mightyspatial.com/docs) | [Dashboard](https://mightyspatial.com/dashboard)

## Pricing

| Tier | Conversions | Max File Size | Price |
|------|------------|---------------|-------|
| **Free** | 5/month | 50 MB | Free |
| **Pro** | Pay-as-you-go | 500 MB | $0.50/conversion |
| **Enterprise** | Custom | Custom | Contact us |

Get your API key at [mightyspatial.com/dashboard](https://mightyspatial.com/dashboard).

## Python SDK

For programmatic access outside of MCP, install the Python SDK:

```bash
pip install mightyspatial
```

## Features

- **convert_ifc** - Convert IFC files to GeoJSON, GeoPackage, Shapefile, or FileGDB
- **list_formats** - List supported output formats and tier requirements
- **preview_ifc** - Upload and preview an IFC file, returning layer summaries
- **generate_pipes** - Generate 3D pipe geometry from polyline layers

## Installation

```bash
cd mcp-server
pip install -e .
```

Or with `uv`:

```bash
cd mcp-server
uv pip install -e .
```

## Configuration

Set these environment variables as needed:

| Variable | Description | Default |
|---|---|---|
| `MIGHTY_SPATIAL_API_URL` | API base URL | `https://mightyspatial.com/api` |
| `MIGHTY_SPATIAL_API_KEY` | API key for authenticated access | (none - uses free tier) |

## Claude Desktop Setup

Add this to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

### Using uv (recommended)

```json
{
  "mcpServers": {
    "mightyspatial": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/path/to/mightyspatial-web/mcp-server",
        "mightyspatial-mcp"
      ],
      "env": {
        "MIGHTY_SPATIAL_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

### Using pip

```json
{
  "mcpServers": {
    "mightyspatial": {
      "command": "mightyspatial-mcp",
      "env": {
        "MIGHTY_SPATIAL_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

## Usage Examples

Once configured, you can ask Claude things like:

- "Convert this IFC file to GeoPackage" (provide a URL or local path)
- "Preview the layers in my IFC file at /path/to/building.ifc"
- "What output formats does Mighty Spatial support?"
- "Generate 3D pipe geometry from the polyline layer in my previewed file"

## Tool Reference

### list_formats

No parameters required. Returns supported formats with tier info.

### convert_ifc

| Parameter | Type | Required | Description |
|---|---|---|---|
| `file_url` | string | one of url/path | URL to download the IFC file from |
| `file_path` | string | one of url/path | Local path to the IFC file |
| `output_format` | string | no | `geojson` (default), `geopackage`, `shapefile`, `filegdb` |
| `target_epsg` | string | no | EPSG code, e.g. `EPSG:28356` |
| `strip_prefix` | string | no | Prefix to strip from entity names |
| `strip_suffix` | string | no | Suffix to strip from entity names |
| `include_csv` | bool | no | Include CSV attribute tables |

### preview_ifc

| Parameter | Type | Required | Description |
|---|---|---|---|
| `file_url` | string | one of url/path | URL to download the IFC file from |
| `file_path` | string | one of url/path | Local path to the IFC file |
| `source_crs` | string | no | EPSG code for the source CRS |

### generate_pipes

| Parameter | Type | Required | Description |
|---|---|---|---|
| `job_id` | string | yes | Job ID from a previous `preview_ifc` call |
| `source_layer` | string | yes | Name of the polyline layer |
| `diameter_field` | string | no | Attribute field with pipe diameters |
| `config_field` | string | no | Attribute field with pipe configuration |
| `uom` | string | no | Unit of measurement: `mm`, `m`, `in`, `ft` (default: `mm`) |
| `default_diameter` | float | no | Default diameter (default: 300) |
| `centerline_mode` | string | no | `centerline` or `invert` (default: `centerline`) |
| `bank_centerline_mode` | string | no | `centerline` or `invert` (default: `centerline`) |
| `bank_stack_direction` | string | no | `bottomUp` or `topDown` (default: `bottomUp`) |
| `bank_gap` | float | no | Gap between pipes in a bank (default: 50) |

## Development

```bash
# Run the server directly
uv run mightyspatial-mcp

# Test with MCP inspector
npx @modelcontextprotocol/inspector uv run mightyspatial-mcp
```
