gkg server
Manage the GitLab Knowledge Graph HTTP server, providing a web interface, HTTP API, and optional file watching for automatic re-indexing.
Synopsis
Section titled “Synopsis”gkg server start [OPTIONS]Description
Section titled “Description”The gkg server command starts a long-running HTTP server that provides:
- Web Interface: Browser-based UI for exploring the knowledge graph
- HTTP API: RESTful endpoints for programmatic access to workspace and graph data
- Real-time Events: Server-Sent Events (SSE) for live progress updates during indexing
- File Watching: Automatic re-indexing when files change (optional)
- Background Jobs: Queue-based processing for concurrent operations
- MCP Integration: Model Context Protocol support for AI tools with dedicated tools for code analysis
The server is designed for ongoing development workflows, providing continuous access to the knowledge graph and automatic updates as your code changes.
Options
Section titled “Options”--register-mcp <FILE>
Section titled “--register-mcp <FILE>”Register the server with MCP (Model Context Protocol) configuration.
- Type: File path
- Default: None
- Example:
~/.gitlab/duo/mcp.json
This option automatically registers the GitLab Knowledge Graph server with your MCP configuration file, enabling AI tools to discover and use the knowledge graph API.
Example:
gkg server start --register-mcp ~/.gitlab/duo/mcp.json--enable-reindexing
Section titled “--enable-reindexing”Enable automatic file watching and re-indexing.
- Type: Flag
- Default:
false
When enabled, the server monitors registered workspaces for file changes and automatically queues re-indexing jobs. This keeps the knowledge graph up-to-date as you develop.
Currently, reindexing is in active development and does not support Ruby, as it involves resolving cross-file references, and will result in undefined behavior. All other languages supported by
gkgwill work, but until GA (General Availability) ofgkgis reached, use at your own risk.
Example:
gkg server start --enable-reindexing--detached
Section titled “--detached”Starts the server in detached (background) mode. This is useful when the server should not be bound to a terminal session, for example, when running it in a CI pipeline for integration testing or registering it for system autostart.
Example:
gkg server start --detachedStopping the server
Section titled “Stopping the server”You can stop both foreground and background servers from any terminal session with:
gkg server stopThe server also respects SIGINT and SIGTERM signals on Unix-like systems. You can gracefully stop the server from the attached terminal by pressing Ctrl+C.