open-index/open-npm huggingface dataset:
npm package: @sorty/mcp
Description: Sorty MCP server - local product map + cloud knowledge graph for your IDE
Latest version: 1.1.1

# Sorty MCP Server

MCP server for Cursor and other IDEs. Exposes Sorty's product map and knowledge graph so the AI can answer questions like "which features implement auth?" or "what does this file belong to?".

## Modes

### Local (product map from workspace)

Reads `.sorty/product-map.json` from your workspace. No cloud required.

**Tools:** `get_product_map`, `search_features`, `get_files_for_feature`, `get_features_for_file`, `get_goals`, `get_feature_description`, `trace_goal_to_code`, `search_by_purpose`, `get_related_features`

**Setup:** Run from a workspace that has run Sorty Detect (extension), or set `SORTY_WORKSPACE_ROOT`.

### Cloud (knowledge graph)

Queries Sorty's cloud API. Requires product link.

**Tools:** `search_knowledge_graph`, `trace_evidence`, `query_graph`

- **query_graph** – Run read-only Cypher on the graph. Use for: "most connected component" (degree centrality), pattern matches, shortest path, etc. Query must filter by `productId`. Max 100 rows, 15s timeout.

**Setup:** Set `SORTY_PRODUCT_ID`, `SORTY_API_KEY`. Set `SORTY_SERVER_URL` to your Sorty API: `https://sorty.app/api/mcp/proxy` (production) or `http://localhost:3000/api/mcp/proxy` (local dev).

### Both

You can enable both. Local tools use the workspace product map; cloud tools use the linked product.

## Install (npm)

```bash
npx @sorty/mcp
```

Or install globally: `npm install -g @sorty/mcp`

## Config (Cursor / VS Code)

**VS Code** (`.vscode/mcp.json`):

```json
{
  "servers": {
    "sorty": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@sorty/mcp"],
      "env": {
        "SORTY_WORKSPACE_ROOT": "${workspaceFolder}",
        "SORTY_PRODUCT_ID": "YOUR_PRODUCT_UUID",
        "SORTY_API_KEY": "sorty-dev-token",
        "SORTY_SERVER_URL": "https://sorty.app/api/mcp/proxy"
      }
    }
  }
}
```

**Cursor** (Settings → MCP or `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "sorty": {
      "command": "npx",
      "args": ["-y", "@sorty/mcp"],
      "env": {
        "SORTY_WORKSPACE_ROOT": "${workspaceFolder}",
        "SORTY_PRODUCT_ID": "YOUR_PRODUCT_UUID",
        "SORTY_API_KEY": "sorty-dev-token",
        "SORTY_SERVER_URL": "https://sorty.app/api/mcp/proxy"
      }
    }
  }
}
```

**Local only** (no cloud): Omit `SORTY_PRODUCT_ID` and `SORTY_API_KEY`. Ensure `.sorty/product-map.json` exists (run Detect in the Sorty extension).

## Build from source

```bash
cd packages/sorty-mcp && npm run build
```