Syntax
Description
Starts the MCP server in stdio mode, serving all indexed repositories. This command is typically invoked automatically by your AI editor’s MCP configuration. The MCP server:- Loads all indexed repositories from the global registry (
~/.gitnexus/registry.json) - Exposes all GitNexus tools via the Model Context Protocol
- Discovers new repositories lazily (repos indexed after the server starts are picked up automatically)
- Runs continuously until the editor closes
Multi-Repo Support
The MCP server serves all indexed repositories automatically. When you have multiple repos indexed:- Tools accept an optional
repoparameter to specify which repository to query - If only one repo is indexed, the
repoparameter is optional - If multiple repos are indexed and no
repois specified, the tool returns an error
Error Handling
The MCP server is designed to be resilient:- Uncaught exceptions are logged but don’t crash the server
- KuzuDB lock conflicts degrade gracefully
- Zero repos — The server starts even with no indexed repos. It prints a warning but remains running, and tools will discover repos lazily.
How Editors Use It
Typical MCP configuration:Manual Usage
You typically don’t run this command manually. Usegitnexus setup to configure your editor to run it automatically.
However, you can test it manually:
MCP Tools Exposed
See the MCP Tools Reference for detailed documentation.
MCP Resources Exposed
See the MCP Resources Reference for detailed documentation.
MCP Prompts Exposed
See the MCP Prompts Reference for detailed documentation.
Lazy Repository Discovery
The MCP server doesn’t require a restart when you index new repositories. Tools callrefreshRepos() internally before each operation, automatically discovering repos indexed after the server started.
This means you can:
- Start your editor (MCP server starts)
- Index a new repo:
gitnexus analyze - Use MCP tools immediately — no restart needed
Related Commands
gitnexus setup— Configure MCP for your editorgitnexus serve— Start HTTP server for web UIgitnexus list— List all indexed repositories