Skip to main content

Crate vibe_graph_mcp

Crate vibe_graph_mcp 

Source
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.

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 pattern
  • get_dependencies - Get incoming/outgoing edges for a node
  • impact_analysis - Analyze which nodes are impacted by changes
  • get_git_changes - Get current uncommitted git changes
  • get_node_context - Get a node and its neighbors for context
  • list_files - List files in the graph with filters

Modules§

gateway
MCP Gateway for multi-project support.

Structs§

EdgeInfo
Information about an edge/dependency.
GetDependenciesInput
Input for the get_dependencies tool.
GetDependenciesOutput
Output for the get_dependencies tool.
GetGitChangesInput
Input for the get_git_changes tool.
GetNodeContextInput
Input for the get_node_context tool.
GitChangesOutput
Output for the get_git_changes tool.
GitChangesSummary
Summary of git changes by kind.
GitFileChange
A single git file change.
HealthResponse
Health check response.
ImpactAnalysisInput
Input for the impact_analysis tool.
ImpactAnalysisOutput
Output for the impact_analysis tool.
ListFilesInput
Input for the list_files tool.
ListFilesOutput
Output for the list_files tool.
ListProjectsOutput
Output for the list_projects tool.
NodeContextOutput
Output for the get_node_context tool.
NodeInfo
Information about a single node in the graph.
ProjectInfo
Project info for list_projects tool.
ProjectRegistry
Thread-safe registry of all projects served by the gateway.
RegisterProjectRequest
Request to register a project with the gateway.
RegisterProjectResponse
Response from project registration.
RegisteredProject
A registered project in the MCP gateway.
SearchNodesInput
Input for the search_nodes tool.
SearchNodesOutput
Output for the search_nodes tool.
VibeGraphMcp
Vibe-Graph MCP Server.