Metadata-Version: 2.4
Name: arrowspace-mcp
Version: 0.3.0
Summary: MCP server for ArrowSpace spectral vector search
Author-email: Genefold AI Ltd <coderbot@genefold.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/Genefold/arrowspace-mcp
Project-URL: Source, https://github.com/Genefold/arrowspace-mcp
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyio
Requires-Dist: arrowspace>=0.24
Requires-Dist: mcp>=1.28
Requires-Dist: numpy
Requires-Dist: uvicorn
Requires-Dist: zarr>=3.0
Provides-Extra: spectral
Requires-Dist: scipy; extra == "spectral"
Requires-Dist: scikit-learn; extra == "spectral"
Provides-Extra: skilled
Requires-Dist: arrowspace-skills>=0.4.0; extra == "skilled"
Provides-Extra: all
Requires-Dist: arrowspace-mcp[skilled,spectral]; extra == "all"
Dynamic: license-file

# ArrowSpace MCP

MCP (Model Context Protocol) server for [ArrowSpace](https://github.com/Mec-iS/arrowspace-rs) spectral vector search.

Exposes ArrowSpace's graph-Laplacian-based spectral search as MCP tools for AI agents.

## Quick start

```bash
uv run arrowspace-mcp
```

## Client configuration

### Claude Desktop

```json
{
  "mcpServers": {
    "arrowspace": {
      "command": "uvx",
      "args": ["arrowspace-mcp"]
    }
  }
}
```

### Cursor

Add to Cursor MCP configuration:

```json
{
  "mcpServers": {
    "arrowspace": {
      "command": "uvx",
      "args": ["arrowspace-mcp"]
    }
  }
}
```

### OpenCode

```json
{
  "mcpServers": {
    "arrowspace": {
      "command": "uvx",
      "args": ["arrowspace-mcp"]
    }
  }
}
```

## Transports

| Transport | Command |
|-----------|---------|
| stdio (default) | `uv run arrowspace-mcp` |
| SSE | `uv run arrowspace-mcp --transport sse --port 8765` |

## CLI flags

| Flag | Default | Description |
|------|---------|-------------|
| `--transport` | `stdio` | Transport protocol (`stdio` or `sse`) |
| `--host` | `127.0.0.1` | Host to bind (SSE only) |
| `--port` | `8765` | Port to bind (SSE only) |
| `--allowed-paths` | `.` | Colon-separated allowed directories for `file_path` |
| `--ttl` | `3600` | Index TTL in seconds |
| `--max-indexes` | `100` | Maximum concurrent indexes |

## Tools

| Tool | Description |
|------|-------------|
| `build_index` | Build a spectral index from vectors (inline or file) |
| `search` | Query with λτ spectral gating |
| `lambdas` | Per-item λτ scores with optional summary stats |
| `lambdas_sorted` | Sorted λτ scores (least to most coherent) |
| `spectral_analysis` | Laplacian eigenvalue spectrum, components, or clusters |
| `delete_index` | Remove an index from memory |

## SSE deployment

```bash
uv run arrowspace-mcp --transport sse --host 0.0.0.0 --port 8765
```

Connect via `http://<host>:8765/sse` with messages at `http://<host>:8765/messages/`.

## Development

```bash
git clone https://github.com/Genefold/arrowspace-mcp
cd arrowspace-mcp
uv pip install -e .
uv run arrowspace-mcp
```

### With optional deps for spectral analysis

```bash
uv pip install -e ".[spectral]"
```

## License

Apache 2.0
