mcpField
G
get-code-context-exa

get-code-context-exa

github.com/exa-labsDevelopment5.2k49 installsUpdated today
Repository

About get-code-context-exa

A code-research skill that retrieves programming examples with get_code_context_exa and returns concise, deduplicated snippets with constraints. It covers API, SDK, configuration, framework, and debugging questions.

Key features

  1. 01Programming example retrieval
  2. 02Language- and version-aware queries
  3. 03Snippet extraction and deduplication
  4. 04Token sizing guidance
  5. 05Code and constraint summaries

Use cases

  1. 01Finding API or SDK usage examples
  2. 02Checking framework setup patterns
  3. 03Investigating programming errors with code references

MCP support

It uses the get_code_context_exa tool and provides an MCP configuration example for connecting to the Exa server.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/exa-labs/exa-mcp-server --skill get-code-context-exa

After installing, type/get-code-context-exain Claude Code to confirm it loaded.

Details

From the project README

Code Context (Exa)

Tool Restriction (Critical)

ONLY use get_code_context_exa. Do NOT use other Exa tools.

Token Isolation (Critical)

Never run Exa in main context. Always spawn Task agents:

  • Agent calls get_code_context_exa
  • Agent extracts the minimum viable snippet(s) + constraints
  • Agent deduplicates near-identical results (mirrors, forks, repeated StackOverflow answers) before presenting
  • Agent returns copyable snippets + brief explanation
  • Main context stays clean regardless of search volume

When to Use

Use this tool for ANY programming-related request:

  • API usage and syntax
  • SDK/library examples
  • config and setup patterns
  • framework "how to" questions
  • debugging when you need authoritative snippets

Inputs (Supported)

get_code_context_exa supports:

  • query (string, required)
  • tokensNum (number, optional; default ~5000; typical range 1000–50000)

Query Writing Patterns (High Signal)

To reduce irrelevant results and cross-language noise:

  • Always include the programming language in the query.
    • Example: use "Go generics" instead of just "generics".
  • When applicable, also include framework + version (e.g., "Next.js 14", "React 19", "Python 3.12").
  • Include exact identifiers (function/class names, config keys, error messages) when you have them.

Dynamic Tuning

Token strategy:

  • Focused snippet needed → tokensNum 1000–3000
  • Most tasks → tokensNum 5000
  • Complex integration → tokensNum 10000–20000
  • Only go larger when necessary (avoid dumping large context)

Output Format (Recommended)

Return:

  1. Best minimal working snippet(s) (keep it copy/paste friendly)
  2. Notes on version / constraints / gotchas
  3. Sources (URLs if present in returned context)

Before presenting:

  • Deduplicate similar results and keep only the best representative snippet per approach.

MCP Configuration

{
  "servers": {
    "exa": {
      "type": "http",
      "url": "https://mcp.exa.ai/mcp?tools=get_code_context_exa"
    }
  }
}

Comments

Markdown supported