Skip to content
MCP Protocol Integration

MCP Protocol Integration

PT | EN

Vectora implements Model Context Protocol (MCP), a standardized protocol that allows any IDE with MCP support to connect and use Vectora as a context server. Works natively in Claude Code and Cursor.

What is MCP?

MCP is a standardized protocol for connecting AI models to external tools. Vectora exposes its functions (search, analysis) as MCP tools that any compatible IDE can use.

IDE (Claude Code / Cursor / other with MCP)
  MCP Protocol (JSON-RPC)
Vectora Server (localhost:9090 or remote)
  12 Available Tools

Quick Start

Prerequisites

  • Node.js 18+
  • Vectora installed: npm install -g @kaffyn/vectora
  • API keys (Gemini, Voyage)
  • IDE with MCP support (Claude Code, Cursor, etc)

Step 1: Initialize Project

cd ~/your-project
vectora init --name "Your Project"

Step 2: Configure MCP in Your IDE

Config file (location varies by IDE):

  • Claude Code: ~/.claude/claude_desktop_config.json
  • Cursor: ~/.cursor/cursor_config.json
  • Other IDEs: See MCP documentation

Add Vectora:

{
  "mcpServers": {
    "vectora": {
      "command": "vectora",
      "args": ["mcp"],
      "env": {
        "GEMINI_API_KEY": "your-value",
        "VOYAGE_API_KEY": "your-value",
        "VECTORA_NAMESPACE": "your-namespace"
      }
    }
  }
}

Step 3: Test

  1. Restart your IDE
  2. Look for search_context tool in MCP menu
  3. Test: @vectora search_context "How to validate tokens?"

12 Available Tools

ToolFunction
search_contextSemantic search for chunks
search_testsFind related tests
analyze_dependenciesFind function callers
find_similar_codeFind similar code patterns
get_file_structureSummarize file structure
list_filesList indexed files
list_namespacesList namespaces
get_namespace_statsNamespace statistics
index_statusIndex status
reindexForce re-indexing
get_configGet current config
get_metricsExecution metrics

Practical Workflows

Workflow 1: Understand Feature

You: "Explain how authentication works"
IDE: @vectora search_context "authentication"
Vectora: Returns relevant chunks
IDE: Shows chunks in context

Workflow 2: Debugging

You: "Why does this test fail?"
IDE: @vectora search_context "test X"
IDE: @vectora analyze_dependencies "tested function"
Vectora: Returns relevant context

Workflow 3: Code Review

You: "Review this function"
IDE: @vectora find_similar_code "your code"
Vectora: Finds similar patterns
IDE: Compares with existing code

Advanced Configuration

Custom Namespace

{
  "mcpServers": {
    "vectora": {
      "env": {
        "VECTORA_NAMESPACE": "staging" // Use different namespace
      }
    }
  }
}

Multiple Synchronized IDEs

If using multiple IDEs, both point to same config and namespace:

// Claude Code
{
  "mcpServers": {
    "vectora": {
      "command": "vectora",
      "args": ["mcp"],
      "env": {
        "VECTORA_NAMESPACE": "your-namespace"
      }
    }
  }
}

// Cursor - same config
{
  "mcpServers": {
    "vectora": {
      "command": "vectora",
      "args": ["mcp"],
      "env": {
        "VECTORA_NAMESPACE": "your-namespace"
      }
    }
  }
}

Both see the same chunks, indices, namespaces.


Troubleshooting

“Vectora command not found”

# Check installation
npm list -g @kaffyn/vectora

# Reinstall if needed
npm install -g @kaffyn/vectora --force

“Connection refused”

Vectora is not running as server:

# Start manually
vectora mcp

# Or via config with custom port
{
  "env": {
    "VECTORA_MCP_PORT": "9091"
  }
}

“API key not found”

Check environment variables:

echo $GEMINI_API_KEY
echo $VOYAGE_API_KEY

# If empty, configure in .env or config JSON

Performance

  • Expected latency: ~300-500ms (network + APIs)
  • Local search: ~100ms (no APIs)
  • Cache: Results cached in .vectora/
  • Concurrent: Supports multiple IDEs pointing to same server

Compatible IDEs

IDESupportStatus
Claude CodeNative MCPTested
CursorNative MCPTested
VS CodeNo native MCPUse own extension
ZedMCP supportedNot tested
NeovimMCP via pluginNot tested

For VS Code, use VS Code Extension.


Next Steps


Part of Vectora ecosystem · Open Source (MIT)