Wire NCI into Cursor
Drop one MCP entry into Cursor and the agent can ask exact questions about the libraries you have installed without leaving the editor. The server inherits NCI’s config-driven database resolution, so each open workspace gets the right index automatically.
Add the MCP server
Edit ~/.cursor/mcp.json, or open :
{ "mcpServers": { "nci": { "command": "npx", "args": ["-y", "@nativecontextindex/mcp"] } } }
That is the whole entry. nci-mcp reads the open workspace through the same logic nci uses for nci.config.json — there is no NCI_PROJECT_ROOT env var.
If nci is not on Cursor’s PATH, point at the binary explicitly:
{ "mcpServers": { "nci": { "command": "npx", "args": ["-y", "@nativecontextindex/mcp"], "env": { "NCI_BINARY": "/absolute/path/to/nci" } } } }
Find the absolute path with:
Apply changes
Cursor watches mcp.json and rebuilds the server list when you save — no app restart needed. Open to confirm nci is listed with two tools and three resources. If the toggle row looks stuck, the command palette’s Developer: Reload Window is the only escalation you should ever need.
Best-practice prompts
- “Look up
ZodObject.omitin the version of zod we have installed before writing the schema.” - “List the public exports of
@my-org/sharedso I can decide what to import.” - “Find every overload of
useStateand tell me which packages provide it.”
The agent picks the right nci_query subcommand. Pin package_name and package_version in the prompt when you want exact answers fast — the agent primer goes into more detail on why.
Re-index on demand
NCI’s tools read the database; they do not build it. Re-run nci index whenever the lockfile changes:
For monorepo setups see Monorepo indexing.
Troubleshooting
If Cursor reports the wrong NCI version or “binary not found”, set NCI_BINARY to the path printed by nci binary-path. The Node shim and nci-mcp both defer to it.
Skills
Cursor follows the open Agent Skills standard. NCI’s shipped skill (nci-answer-quality) drops into Cursor’s discovery path with no rewriting — see NCI Skills for the host-by-host map.