Skip to main content
The Context Engine MCP is a standalone developer tool that exposes codebase intelligence via the Model Context Protocol. For the Context Engine as the core technology layer of the Qodo platform, see Understanding the Context Engine.
The Context Engine MCP server exposes three tools that you call from your MCP client. For conceptual background, see the Context Engine MCP overview. All three tools accept a repositories parameter to scope the search and, where applicable, a session_id parameter to maintain context across follow-up calls.

deep_research

The deep_research endpoint is an intelligent code analysis agent that goes beyond simple search to provide comprehensive understanding of your codebase. Think of it as having a senior architect who has thoroughly studied every line of your code and can answer complex questions about architecture, patterns, and implementation strategies.

Key features

  • Code understanding: Comprehends code logic, architecture, and design patterns
  • Cross-repository analysis: Analyzes relationships between different parts of your codebase
  • Implementation planning: Helps plan new features based on existing code patterns
  • Best practice recommendations: Suggests improvements based on codebase analysis
  • Architecture insights: Provides high-level understanding of system design

Request format

Parameters

  • Be specific and detailed. “How does user authentication work across our microservices?” provides richer insights than general queries.
  • Include context about your goals. Mentioning why you need the information helps Deep Research tailor its analysis.
  • Leverage session_id for complex investigations. Build on previous queries to dive deeper into specific areas.
  • Specify repositories for focused analysis. When you know which repos are relevant, include them for more targeted results.
  • Ask “why” and “how” questions. Deep Research excels at explaining design decisions and implementation reasoning.
Avoid:
  • Simple keyword searches: use get_context instead
  • Asking the agent to modify your code: deep_research analyzes and suggests code, it will not modify files
  • Questions about external services not in your codebase
  • Real-time data: it analyzes code structure, not runtime behavior

Usage patterns

Pattern 1: Architecture discovery When to use: Understanding how your system works.
Returns: Complete flow diagram in text, service interactions, data transformations, error handling paths. Pattern 2: Security audit When to use: Evaluating security implementation.
Returns: Security analysis, best practice violations, specific vulnerabilities, improvement recommendations. Pattern 3: Feature planning When to use: Before implementing new features.
Returns: Implementation strategy, integration points, consistent patterns to follow, potential challenges. Pattern 4: Performance analysis When to use: Identifying bottlenecks and optimization opportunities.
Returns: Bottleneck identification, N+1 queries, inefficient algorithms, caching opportunities. Pattern 5: Dependency impact When to use: Before upgrading dependencies or making breaking changes.
Returns: Affected code sections, breaking changes, migration strategy, risk assessment. Pattern 6: Onboarding new developers When to use: Explaining complex parts of the codebase.
Returns: Conceptual explanation, implementation details, key files and functions, potential gotchas. Pattern 7: Best practice validation When to use: Ensuring code quality and consistency.
Returns: Pattern analysis, anti-pattern identification, specific improvement suggestions, refactoring priorities.

context_ask

The context_ask endpoint is an intelligent codebase question-answering system that combines semantic search with expert-level code analysis. Think of it as having a principal software engineer who instantly understands your entire codebase and can provide detailed, evidence-based answers with actual code snippets and precise implementation details. Unlike traditional documentation or search tools, context_ask:
  • Provides evidence-based answers with actual code snippets and line numbers
  • Combines semantic search with graph-based repository knowledge
  • Analyzes code relationships and dependencies across your entire codebase
  • Delivers expert-level explanations with complete implementation details
  • Shows actual code proof for every claim, never just descriptions

Request format

Parameters

Response format

  • Ask specific technical questions. “How does error handling work in the payment processing module?” rather than “Tell me about errors.”
  • Request complete implementations. Ask for end-to-end flows, not just isolated functions.
  • Focus on architectural patterns. Questions about how components interact yield comprehensive answers.
  • Specify scope with repositories. Target relevant codebases for focused, accurate responses.
  • Use session continuity. Maintain session_id for follow-up questions on related topics.

Usage examples

Understanding authentication flow
Analyzing error handling patterns
Exploring API design patterns
Investigating performance optimizations

get_context

The get_context tool performs semantic search across one or more codebases to find relevant code snippets.

Key features

  • Semantic search: Uses vector embeddings to find conceptually similar code, not just keyword matches
  • Multi-repository support: Search across multiple repositories simultaneously
  • Language filtering: Filter results by programming language (Python, JavaScript, TypeScript, etc.)
  • Intelligent ranking: Returns results ranked by relevance with configurable result limits

Request format

Parameters