Skip to main content
Glama
README.md
# CrimeWatch MCP

Connect a local MCP client to CrimeWatch for police-reported location risk, city comparisons, and coverage. The server runs over stdio and forwards tool calls to the hosted CrimeWatch API. Use Node.js 22 or later.

## Run from source

```sh
npm ci
```

Add the following to a client that supports local MCP servers. Use absolute paths to Node.js and to this checkout.

```json
{
  "mcpServers": {
    "crimewatch": {
      "command": "/absolute/path/to/node",
      "args": ["/absolute/path/to/crimewatch-mcp/src/cli.mjs"]
    }
  }
}
```

Once the package is published to npm, the same entry can use `"command": "npx"` and `"args": ["-y", "@crimewatch/mcp-server@0.1.0"]`.

The hosted service accepts anonymous sandbox calls subject to rate limits. For a metered account, set `CRIMEWATCH_API_KEY` in the MCP client's secret environment. Free developer keys include 100 REST or MCP calls per month. [Developer dashboard](https://www.crimewatches.com/developers/)

## Tools

| Tool | Sample arguments |
| --- | --- |
| `list_covered_cities` | `{"country_code":"CA","query":"toronto","limit":1}` |
| `score_location_risk` | `{"lat":43.6534,"lng":-79.3841,"city_id":"toronto","radius_km":1,"days":30}` |
| `compare_cities_risk` | `{"city_a":"toronto","city_b":"us-ny-new-york","days":30}` |

Start with coverage and check `confidence_grade`, `granularity`, and `window.data_through` when interpreting a location score. For `h3-city-percentile-v2`, the score ranks the coordinate's H3 cell against other cells in the same city. Seasonal baselines depend on archive coverage and model validation. Use the data for environmental location context. [Methodology and limitations](https://www.crimewatches.com/methodology/)

## Try the hosted service

This anonymous request returns coverage for Toronto without installing a client or creating a key.

```sh
curl --fail-with-body https://www.crimewatches.com/api/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_covered_cities","arguments":{"query":"toronto","limit":1}}}'
```

Tool arguments, including coordinates, are sent to `https://www.crimewatches.com/api/mcp`. If configured, the API key is sent in the `X-API-Key` header. Keep keys in the client's secret environment and use public test locations when sharing examples.

## Verify a release

```sh
npm test
CRIMEWATCH_LIVE_SMOKE=1 npm test
npm pack --dry-run
```

The live test checks all three tools over stdio against the public sandbox. `server.json` provides the MCP Registry listing for the npm release. Its package and manifest versions advance together. [MCP Registry publishing guide](https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/quickstart.mdx)