Syntax
Description
One-time global MCP configuration writer. Detects installed AI editors and writes the appropriate MCP config so the GitNexus MCP server is available in all projects. This command auto-detects your editors and configures them to use GitNexus MCP server globally. You only need to run it once.Supported Editors
Cursor
Writes to~/.cursor/mcp.json:
~/.cursor/skills/.
Claude Code
Prints manual installation command (MCP must be added via CLI):- Installs agent skills to
~/.claude/skills/ - Registers PreToolUse hooks in
~/.claude/settings.jsonfor automatic context enrichment
OpenCode
Writes to~/.config/opencode/config.json:
~/.config/opencode/skill/.
Agent Skills
The setup command installs the following skills globally:gitnexus-exploring— Navigate unfamiliar code using the knowledge graphgitnexus-debugging— Trace bugs through call chainsgitnexus-impact-analysis— Analyze blast radius before changesgitnexus-refactoring— Plan safe refactors using dependency mappinggitnexus-guide— General usage guidegitnexus-cli— CLI reference
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - OpenCode:
~/.config/opencode/skill/
Claude Code Hooks
For Claude Code, the setup command registers a PreToolUse hook that automatically enrichesGrep, Glob, and Bash tool calls with knowledge graph context.
The hook is written to ~/.claude/hooks/gitnexus/gitnexus-hook.cjs and registered in ~/.claude/settings.json:
Windows Support
On Windows, the MCP entry usescmd /c npx instead of npx directly, since npx is a .cmd script.
Usage Example
Output Example
When to Run
You only need to run this command once per machine. It configures MCP globally for all projects. If you install a new editor later, rungitnexus setup again to configure it.
Related Commands
gitnexus analyze— Index a repositorygitnexus mcp— Start MCP server manually