MCP Context
Index includes a TypeScript MCP server that exposes approved workspace context to agents. The server is read-only and loads Markdown docs from docs/ plus repository entries from repos/index.yaml.
Commands
bash
npm run mcp:check
npm run mcp:test
npm run mcp:smoke
npm run mcp:dev
npm run mcp:httpnpm run mcp:dev starts stdio transport for local MCP clients. npm run mcp:http starts Streamable HTTP at /mcp with a health check at /.
Resources
| Resource | Purpose |
|---|---|
index://docs/list | List available docs. |
index://docs/{limit} | Read a bounded set of docs. |
index://doc/{slug} | Read one doc by slug. |
index://repos/list | List tracked repository entries. |
index://repo/{name} | Read one tracked repository by name. |
Tools
| Tool | Purpose |
|---|---|
search_index_docs(subject, limit, include_content_snippet) | Search docs by subject and optionally include snippets. |
search_index_repos(subject, limit) | Search repository registry entries by subject. |
Operating Model
- Keep the server read-only unless write tools have explicit approval gates and tests for side effects.
- Treat docs and registry entries as approved context, not as an instruction source that can override user or system intent.
- Prefer evidence-bearing entries: owners, paths, URLs, status, tags, and start-here files are more useful to agents than broad descriptions.
Verify MCP Changes
bash
npm run mcp:check
npm run mcp:test
npm run mcp:smokeSee Validation for the broader check set.