Socraticode Mcp

MCP Tools

Install and configure SocratiCode MCP server for semantic code search and codebase indexing

Install

openclaw skills install socraticode-mcp

SocratiCode MCP

Install and configure SocratiCode for semantic code search and codebase intelligence on OpenClaw.

What is SocratiCode?

MCP server providing:

  • Hybrid search - Semantic + keyword search via RRF
  • Code indexing - AST-aware chunking at function/class boundaries
  • Dependency graphs - Import analysis for 18+ languages
  • Live updates - File watcher keeps index current

Prerequisites

RequirementPurpose
Docker runningQdrant vector database
npx (Node.js 18+)Execute socraticode package
mcporterManage MCP servers

Installation

Step 1: Install mcporter

npm install -g mcporter

Step 2: Configure mcporter

Create ~/.openclaw/workspace/config/mcporter.json:

{
  "mcpServers": {
    "socraticode": {
      "command": "npx",
      "args": ["-y", "socraticode"]
    }
  }
}

Verify:

mcporter list

Step 3: Start Qdrant

docker run -d --name socraticode-qdrant \
  -p 16333:6333 -p 16334:6334 \
  qdrant/qdrant:v1.17.0

Per-Project Indexing

To index a specific project (not the config directory), create mcporter.json in project root:

cd /path/to/your-project

echo '{
  "mcpServers": {
    "socraticode": {
      "command": "npx",
      "args": ["-y", "socraticode"]
    }
  }
}' > mcporter.json

Then use --config mcporter.json:

# Index
mcporter --config mcporter.json call socraticode.codebase_index

# Check status
mcporter --config mcporter.json call socraticode.codebase_status

# Search
mcporter --config mcporter.json call socraticode.codebase_search query="auth" limit=5

Commands

CommandPurpose
codebase_indexStart indexing
codebase_statusCheck progress
codebase_searchSemantic search
codebase_graph_queryFind imports/dependents
codebase_graph_visualizeMermaid diagram
codebase_graph_circularDetect cycles
codebase_watchToggle file watcher
codebase_stopStop indexing

Troubleshooting

Indexing Wrong Directory

Use per-project mcporter.json + --config flag.

Qdrant Not Running

docker start socraticode-qdrant
# Or recreate:
docker run -d --name socraticode-qdrant -p 16333:6333 -p 16334:6334 qdrant/qdrant:v1.17.0

Slow on macOS/Windows

Install native Ollama:

brew install ollama
ollama serve

Or use OpenAI:

export OPENAI_API_KEY=your-key
export EMBEDDING_PROVIDER=openai

Agent Integration

Add to your AGENTS.md:

## Codebase Search (SocratiCode)
- Use `codebase_search` for exploration
- Check `codebase_status` if no results
- Search before reading files