This document describes the Model Context Protocol (MCP) tools available in CodeGraphContext. These tools are exposed to AI assistants to enable them to interact with your codebase.
Performs a one-time scan of a local folder to add its code to the graph. Ideal for libraries or dependencies.
- Args:
path(string),is_dependency(boolean) - Returns: Job ID
Add an external package to the graph by discovering its location.
- Args:
package_name(string),language(string),is_dependency(boolean) - Returns: Job ID
- Supported Languages: python, javascript, typescript, java, c, go, ruby, php, cpp
List all repositories currently indexed in the graph.
- Args: None
- Returns: List of repositories with paths and stats
Delete a repository from the graph.
- Args:
repo_path(string) - Returns: Success message
Check the status of a background job (indexing, scanning).
- Args:
job_id(string) - Returns: Job status (running, completed, failed) and progress
List all background jobs.
- Args: None
- Returns: List of all jobs
Find code snippets related to a keyword.
- Args:
query(string),fuzzy_search(boolean),edit_distance(number) - Returns: Matches with file path, line number, and content
Analyze relationships between code elements.
- Args:
query_type(enum):find_callers,find_callees,class_hierarchy,overrides, etc.target(string): Function/class namecontext(string): Optional file path
- Returns: List of related elements
Find potentially unused functions across the codebase.
- Args:
exclude_decorated_with(list of strings) - Returns: List of unused functions
Calculate complexity for a specific function.
- Args:
function_name(string),path(string) - Returns: Complexity score
Find the most complex functions in the codebase.
- Args:
limit(integer) - Returns: List of functions sorted by complexity
Get statistics about indexed repositories.
- Args:
repo_path(string, optional) - Returns: Counts of files, functions, classes, modules
Load a pre-indexed .cgc bundle. Can download from registry if not found locally.
- Args:
bundle_name(string),clear_existing(boolean) - Returns: Success message and stats
Search for bundles in the registry.
- Args:
query(string, optional): Search termunique_only(boolean): Show only latest version per package
- Returns: List of available bundles
Continuously monitor a directory for changes and keep the graph updated.
- Args:
path(string) - Returns: Job ID for initial scan
List directories being watched.
- Args: None
- Returns: List of paths
Stop watching a directory.
- Args:
path(string) - Returns: Success message
Run a direct read-only Cypher query against the graph.
- Args:
cypher_query(string) - Returns: Raw query results
Generate a URL to visualize query results in Neo4j Browser.
- Args:
cypher_query(string) - Returns: URL