Expand description
MCP (Model Context Protocol) server for Vibe-Graph.
Exposes the Vibe-Graph codebase analysis capabilities as MCP tools, enabling LLM-powered agents to query code structure, analyze impact, and understand dependencies.
§Gateway Mode (Recommended)
The gateway mode allows multiple projects to be served through a single
MCP endpoint. Run vg serve --mcp from any project directory - it will
either start a gateway or register with an existing one.
use vibe_graph_mcp::gateway::{GatewayState, run_gateway, DEFAULT_GATEWAY_PORT};
use tokio_util::sync::CancellationToken;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cancel = CancellationToken::new();
let state = GatewayState::new(cancel);
run_gateway(state, DEFAULT_GATEWAY_PORT).await?;
Ok(())
}§Single-Project Mode (Legacy)
For backwards compatibility, single-project mode is still supported:
use vibe_graph_mcp::VibeGraphMcp;
use vibe_graph_ops::Store;
use std::sync::Arc;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let store = Store::new(".");
let graph = store.load_graph()?.expect("No graph found");
let server = VibeGraphMcp::new(store, Arc::new(graph), ".".into());
server.run_stdio().await?;
Ok(())
}§Tools
list_projects- List all registered projects (gateway mode)search_nodes- Search for nodes by name/path patternget_dependencies- Get incoming/outgoing edges for a nodeimpact_analysis- Analyze which nodes are impacted by changesget_git_changes- Get current uncommitted git changesget_node_context- Get a node and its neighbors for contextlist_files- List files in the graph with filters
Modules§
- gateway
- MCP Gateway for multi-project support.
Structs§
- Edge
Info - Information about an edge/dependency.
- GetDependencies
Input - Input for the
get_dependenciestool. - GetDependencies
Output - Output for the
get_dependenciestool. - GetGit
Changes Input - Input for the
get_git_changestool. - GetNode
Context Input - Input for the
get_node_contexttool. - GitChanges
Output - Output for the
get_git_changestool. - GitChanges
Summary - Summary of git changes by kind.
- GitFile
Change - A single git file change.
- Health
Response - Health check response.
- Impact
Analysis Input - Input for the
impact_analysistool. - Impact
Analysis Output - Output for the
impact_analysistool. - List
Files Input - Input for the
list_filestool. - List
Files Output - Output for the
list_filestool. - List
Projects Output - Output for the
list_projectstool. - Node
Context Output - Output for the
get_node_contexttool. - Node
Info - Information about a single node in the graph.
- Project
Info - Project info for list_projects tool.
- Project
Registry - Thread-safe registry of all projects served by the gateway.
- Register
Project Request - Request to register a project with the gateway.
- Register
Project Response - Response from project registration.
- Registered
Project - A registered project in the MCP gateway.
- Search
Nodes Input - Input for the
search_nodestool. - Search
Nodes Output - Output for the
search_nodestool. - Vibe
Graph Mcp - Vibe-Graph MCP Server.