Skip to main content
Glama
README.md
# sn-docs-mcp

A local MCP server that lets Claude answer ServiceNow product questions from the public ServiceNow docs, by release family, with a link for every claim. It can also search your own tested notes and keeps them clearly apart from the docs.

It reads your own clone of the public [ServiceNowDocs](https://github.com/ServiceNow/ServiceNowDocs) repository. It ships no docs text, and it never fetches, checks out or writes to that clone.

## What it does

Ask Claude something like "Can a WSD user reserve a desk on behalf of someone else in Brazil, and did that change since Zurich?" Claude calls the tools below and answers with a short answer, one line per release when releases are named, numbered sources with links, a "From your notes (tested, not docs)" section when your notes apply, and a "Not in the docs" line when nothing covers part of the question.

| Tool | What it returns |
|---|---|
| `list_families` | Release families in your clone, with index status |
| `list_products` | Product keys from your products.tsv, if set |
| `search_docs` | Ranked topics for a query, filtered by family and product, each with a snippet and link |
| `get_topic` | The text of one topic, with its link |
| `what_changed` | Release note and delta entries for a product between two families, optionally filtered by a query |
| `search_notes` | Matches from your own notes folder, labelled as your notes |

## Install

Needs Python 3.12 or later, [uv](https://docs.astral.sh/uv/), git, and a clone of the docs:

```bash
git clone https://github.com/ServiceNow/ServiceNowDocs ~/Projects/ServiceNowDocs
git clone https://github.com/arunsaravanen/sn-docs-mcp ~/Projects/sn-docs-mcp
cd ~/Projects/sn-docs-mcp && uv sync
```

Build the indexes once (about 20 seconds per family). The server also builds a missing or stale index in the background on first use:

```bash
uv run sn-docs-mcp index brazil zurich
```

To pick up new docs, run `git fetch` in the docs clone yourself. The server sees the new commit and rebuilds that family's index on its next use.

## Add it to Claude Code

```bash
claude mcp add sn-docs --scope user \
  -e SN_PRODUCTS=/path/to/products.tsv \
  -e SN_NOTES=/path/to/notes \
  -- uv --directory ~/Projects/sn-docs-mcp run sn-docs-mcp
```

Both `-e` lines are optional.

## Add it to Claude Desktop

Claude Desktop renders the answer formatted, which is the easiest way to read it. Add this to `~/Library/Application Support/Claude/claude_desktop_config.json` under `mcpServers`, then restart Claude Desktop:

```json
"sn-docs": {
  "command": "/full/path/to/uv",
  "args": ["--directory", "/Users/you/Projects/sn-docs-mcp", "run", "sn-docs-mcp"],
  "env": {
    "SN_PRODUCTS": "/path/to/products.tsv",
    "SN_NOTES": "/path/to/notes"
  }
}
```

Use the full path to `uv` (`which uv`), because Claude Desktop does not read your shell's PATH.

## Settings

| Variable | Default | Meaning |
|---|---|---|
| `SN_DOCS` | `~/Projects/ServiceNowDocs` | Your docs clone |
| `SN_DOCS_CACHE` | `~/.cache/sn-docs-mcp` | Where the indexes live |
| `SN_PRODUCTS` | none | A products.tsv mapping product keys to docs paths (columns `key`, `docs_globs`, `store_globs`, `delta_glob`) |
| `SN_NOTES` | none | A folder of markdown notes with YAML front matter |

## Disk use

Each family index takes about 400 MB, because the full topic text is stored to cut snippets from. During a rebuild the old and new index exist side by side, so allow about twice that for the family being rebuilt. Delete a family's `.db` file in the cache folder to drop it. The small `.lock` files there are expected and safe to leave.

## Development

```bash
uv run pytest -q
```

Tests build small fixture repositories in temp folders and never touch a real clone.

## License

MIT. ServiceNow docs content belongs to ServiceNow and is not included here.