MCP Tools in DeusData: Analysis vs Scout Profiles and Query Optimization Guide

DeusData's MCP server exposes 14 graph-analysis tools via JSON-RPC 2.0, divided between the full-capability Analysis profile and the lightweight Scout profile, with each tool optimized for specific query patterns ranging from natural-language semantic search to complex Cypher analytics.

DeusData's codebase-memory-mcp repository implements a specialized Model Context Protocol (MCP) server that transforms codebases into queryable knowledge graphs. Understanding the differences between the Analysis and Scout tool profiles—and which specific queries each MCP tool optimizes for—is essential for building integrations that balance analytical depth against latency requirements.

Understanding the Two MCP Tool Profiles

The MCP server configuration determines which tools are callable through the cbm_mcp_tool_profile_t enum defined in src/mcp/mcp.h【/src/mcp/mcp.h#L97-L103】. At startup, the server loads either the Analysis or Scout profile, creating distinct capability boundaries hard-coded in src/mcp/mcp.c【/src/mcp/mcp.c#L30-L40】.

Analysis Profile (CBM_MCP_TOOL_PROFILE_ANALYSIS)

The Analysis profile unlocks all 14 graph-analysis tools, including heavy-weight mutation engines and the full Cypher query interface. This profile is ideal for CI pipelines, batch jobs, and interactive UIs where comprehensive analytical capabilities outweigh latency concerns. The allowed tools array in src/mcp/mcp.c lines 31-36 includes search_graph, query_graph, trace_path, get_code_snippet, get_graph_schema, get_architecture, search_code, list_projects, index_status, check_index_coverage, and detect_changes, plus the mutation tools manage_adr, ingest_traces, and index_repository.

Scout Profile (CBM_MCP_TOOL_PROFILE_SCOUT)

The Scout profile restricts the surface to seven read-only tools optimized for sub-second response times. According to the implementation in src/mcp/mcp.c lines 37-39, this profile permits only search_graph, trace_path, get_code_snippet, get_architecture, list_projects, index_status, and check_index_coverage. By excluding query_graph (the Cypher engine), detect_changes (change-impact analysis), and all indexing mutations, Scout enables low-latency discovery suitable for UI autocomplete, browser extensions, and edge computing environments.

The 14 MCP Tools and Their Optimized Query Patterns

Each tool in the registry is defined with specific input schemas and description strings in src/mcp/mcp.c【/src/mcp/mcp.c#L81-L165】. The following breakdown maps each tool to the query patterns it is architecturally tuned to handle.

search_graph

Core purpose: Full-text and semantic search over the knowledge graph.
Optimized queries: Natural-language BM25 search using the query parameter; regex name-pattern matching via name_pattern; vector-space semantic search using semantic_query keyword arrays.
Source: Description lines【/src/mcp/mcp.c#L81-L100】.

query_graph

Core purpose: Arbitrary Cypher query execution for multi-hop graph analytics.
Optimized queries: Complex pattern matching, aggregations across multiple node types, and cross-service relationship analysis requiring custom Cypher statements.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L36-L44】.

trace_path

Core purpose: Call-graph and data-flow traversal.
Optimized queries: Caller/callee discovery using direction parameters; data-flow propagation analysis with mode=data_flow; cross-service routing paths with mode=cross_service.
Source: Description lines【/src/mcp/mcp.c#L70-L78】.

get_code_snippet

Core purpose: Exact source retrieval for qualified symbols.
Optimized queries: Direct fetch operations following search_graph hits; guaranteed exact text retrieval without ranking algorithms. Use when you have a fully-qualified symbol name and need the canonical source text.
Source: Description lines【/src/mcp/mcp.c#L108-L113】.

get_graph_schema

Core purpose: Introspection of node-label and edge-type vocabularies.
Optimized queries: Schema discovery for UI adapters and query builders; retrieving available labels, relationship types, and property keys in the graph.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L120-L123】.

get_architecture

Core purpose: High-level architectural summaries.
Optimized queries: Language distribution analysis, package structure overview, service clustering, and route mapping. Use aspects parameter for deep-dives or omit for high-level overviews.
Source: Description lines【/src/mcp/mcp.c#L125-L133】.

search_code

Core purpose: Grep-style text search enriched with graph metadata.
Optimized queries: Quick "compact" signature-only results or "full" source window retrieval. Optimized for exact text matching across file contents rather than semantic meaning.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L146-L155】.

list_projects

Core purpose: Enumeration of indexed projects.
Optimized queries: Simple discovery operations to identify available graph contexts before executing project-specific queries.
Source: Description lines【/src/mcp/mcp.c#L172-L174】.

index_status

Core purpose: Metadata and health reporting for project indexes.
Optimized queries: Pre-flight completeness checks; retrieving node counts, coverage statistics, and git context to verify graph freshness before analytical operations.
Source: Description lines【/src/mcp/mcp.c#L176-L182】.

check_index_coverage

Core purpose: Precise coverage auditing.
Optimized queries: Verification that specific file paths or code scopes were fully indexed; essential for making negative claims or validating exhaustive analysis boundaries.
Source: Description lines【/src/mcp/mcp.c#L184-L191】.

detect_changes

Core purpose: Git diff to transitive impact set mapping (blast radius analysis).
Optimized queries: Change-impact analysis with scope=impact; directional control of dependency trees; depth-limited traversal for code review workflows.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L194-L202】.

manage_adr

Core purpose: Architecture Decision Record (ADR) lifecycle management.
Optimized queries: CRUD operations for ADR artifacts—not a query tool but a metadata management interface.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L204-L207】.

ingest_traces

Core purpose: Runtime observability data integration.
Optimized queries: Adding execution traces and telemetry to the graph; used by observability pipelines rather than analytical querying.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L209-L213】.

index_repository

Core purpose: Graph construction and maintenance.
Optimized queries: Full repository indexing or cross-repo graph building; this is a write-heavy mutation operation that constructs the graph all other tools query.
Availability: Analysis profile only.
Source: Description lines【/src/mcp/mcp.c#L47-L57】.

Practical JSON-RPC Usage Examples

The following payloads demonstrate optimized queries against the Analysis profile. These JSON-RPC 2.0 requests can be sent via HTTP to the MCP daemon endpoint.

Semantic Function Discovery

Use search_graph with vector-space semantics to find functions related to message publishing:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "tool": "search_graph",
    "args": {
      "project": "payment-service",
      "semantic_query": ["publish", "message", "event"],
      "limit": 20,
      "format": "json"
    }
  }
}

Call-Graph Traversal

Use trace_path for breadth-first traversal of CALLS edges with depth limiting:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "tool": "trace_path",
    "args": {
      "project": "payment-service",
      "function_name": "service.PaymentProcessor.process",
      "direction": "both",
      "depth": 5,
      "format": "tree"
    }
  }
}

Complex Cypher Analytics

Use query_graph for multi-hop pattern matching unavailable in the Scout profile:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "tool": "query_graph",
    "args": {
      "project": "payment-service",
      "query": "MATCH (f:Function) WHERE f.transitive_loop_depth >= 3 RETURN f.qualified_name, f.transitive_loop_depth ORDER BY f.transitive_loop_depth DESC LIMIT 50"
    }
  }
}

Scout-Optimized Architecture Overview

This request succeeds under the Scout profile because get_architecture is included in the restricted toolset:

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "tool": "get_architecture",
    "args": {
      "project": "payment-service",
      "aspects": ["overview", "languages", "packages"]
    }
  }
}

Summary

  • Two profiles, fourteen tools: DeusData's MCP server organizes tools into the full-capability Analysis profile (14 tools) and the lightweight Scout profile (7 tools) according to src/mcp/mcp.c【/src/mcp/mcp.c#L30-L40】.
  • Query-specific optimization: Each tool targets distinct patterns—search_graph for semantic discovery, query_graph for Cypher analytics, trace_path for dependency traversal, and detect_changes for impact analysis.
  • Latency vs. capability trade-off: Scout provides sub-second response for read-only discovery, while Analysis enables complex multi-hop queries and graph mutations at higher computational cost.
  • Schema enforcement: Tool availability is enforced at the JSON-RPC dispatch layer via the cbm_mcp_tool_profile_t enum defined in src/mcp/mcp.h【/src/mcp/mcp.h#L97-L103】.

Frequently Asked Questions

What is the primary difference between the Analysis and Scout MCP tool profiles?

The Analysis profile exposes all 14 tools including the Cypher query engine (query_graph), change-impact analyzer (detect_changes), and graph mutation tools (index_repository, manage_adr, ingest_traces). The Scout profile restricts the server to seven read-only tools—search_graph, trace_path, get_code_snippet, get_architecture, list_projects, index_status, and check_index_coverage—optimizing for low-latency discovery queries in resource-constrained environments.

Which MCP tool should I use for finding code by natural language description?

Use search_graph with the semantic_query parameter. This tool optimizes for vector-space similarity search combined with BM25 fallback, making it ideal for natural-language queries like "functions that handle user authentication" rather than exact symbol names.

Why does the Scout profile exclude query_graph and detect_changes?

These tools execute complex graph traversals and change-impact calculations that require significant computational resources. According to the implementation in src/mcp/mcp.c, the Scout profile is designed for "positive-discovery" queries where sub-second latency is critical, such as UI autocomplete or CLI exploration, whereas query_graph arbitrary Cypher execution and detect_changes blast-radius analysis are better suited for batch processing or CI pipelines under the Analysis profile.

How do I verify that a file was fully indexed before running dependency queries?

Use check_index_coverage with specific path or scope parameters. This tool performs precise coverage auditing to confirm that a concrete file or directory was ingested into the graph, preventing false negatives in exhaustive analysis queries. For general health checks, use index_status to retrieve node counts and git context first.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →