- Automatic setup using
gitnexus setup(recommended) - Manual configuration for each editor
Automatic Setup
Run the setup command once to configure all detected editors:- Auto-detects installed editors (Claude Code, Cursor, Windsurf, OpenCode)
- Writes the correct MCP configuration for each editor
- Installs agent skills globally where supported
- Registers PreToolUse hooks for Claude Code
Example output
Example output
Global vs Project Config: The setup command creates global configuration that works for all projects. You only need to run it once per machine.
Manual Configuration
If you prefer manual setup, follow the editor-specific instructions below.Claude Code
Claude Code requires a CLI command to add MCP servers:- MCP server connection
- Skills installation (automatic via
gitnexus analyze) - PreToolUse hooks (automatic via
gitnexus setup)
For full Claude Code integration including PreToolUse hooks, run
gitnexus setup instead. See Claude Code Setup for details.Cursor
Create or edit~/.cursor/mcp.json (global configuration):
Windsurf
Windsurf uses the same configuration format as Cursor. Create or edit~/.windsurf/mcp.json:
OpenCode
Add to~/.config/opencode/config.json:
Windows Configuration
On Windows,npx must be invoked via cmd /c since it’s a .cmd script:
gitnexus setup command handles this automatically.
Global vs Project Configuration
Global Configuration (Recommended)
The configurations shown above are global — they work for all projects on your machine:- Claude Code:
~/.claude/(settings, skills, hooks) - Cursor:
~/.cursor/mcp.jsonand~/.cursor/skills/ - Windsurf:
~/.windsurf/mcp.json - OpenCode:
~/.config/opencode/config.jsonand~/.config/opencode/skill/
Project Configuration
Some editors support project-specific configuration:- Cursor:
.cursorrules(project-level rules, but MCP must be global) - Claude Code: Project-level hooks via
.claude/settings.json(advanced)
Recommendation: Use global MCP configuration. The GitNexus MCP server automatically serves all indexed repos from the global registry (
~/.gitnexus/registry.json).Verification
After configuration:Test MCP connection
Ask your AI agent:
“List all indexed repositories”Or explicitly call:
“Use the list_repos tool”
Troubleshooting
MCP server not starting
- Verify Node.js is installed:
node --version(requires >= 18) - Check npx works:
npx gitnexus --version - Test MCP manually:
npx gitnexus mcp(should not exit immediately)
Tools not appearing
- Check editor MCP logs (location varies by editor)
- Verify configuration file syntax (valid JSON)
- Restart your editor after configuration changes
”No repositories indexed” error
- Run
npx gitnexus analyzein your repository - Verify index exists:
ls .gitnexus/meta.json - Check global registry:
cat ~/.gitnexus/registry.json
Next Steps
Claude Code Setup
Full integration with skills and hooks
Cursor Setup
MCP and skills for Cursor
Multi-Repo Usage
Work with multiple indexed repositories
Using the Tools
Learn how to use GitNexus tools effectively