SocratiCode MCP for Openclaw

An advanced MCP server that equips your AI agent with semantic code search, AST-aware codebase indexing, and live dependency graph analysis.

adelpro
v1.2.0
Mar 17, 2026
0
446
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install socraticode-mcp

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install socraticode-mcp using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is SocratiCode MCP?

SocratiCode MCP is a high-performance Model Context Protocol (MCP) server designed to bring semantic code search and deep codebase intelligence directly to your AI workflow. By leveraging SocratiCode, developers can empower their AI agents to dynamically index local codebases, analyze complex dependency graphs, and resolve code navigation queries in real-time. This skill elevates your agent environment by enabling AST-aware chunking at class and function boundaries, ensuring search results retain precise syntax context rather than arbitrary text splits.

As part of the ecosystem of Openclaw Skills, this server integrates smoothly with your existing agent configurations. Using a combination of semantic and keyword search via Reciprocal Rank Fusion (RRF) and a backend Qdrant vector database, it transforms raw directories into fully searchable, queryable, and visualizable architectures, providing the exact context your agent needs to write better code.

SocratiCode MCP Use Cases

  • Navigating large, unfamiliar codebases where traditional keyword search falls short.
  • Performing complex semantic searches to locate functional logic across multiple modules.
  • Constructing visual dependency graphs or detecting circular dependencies in complex multi-language codebases.
  • Enhancing developer agent autonomy by providing real-time file-watching and live indexing updates.

How SocratiCode MCP Works

  1. Initialize Configuration: The agent reads the local config file containing the registered SocratiCode MCP server commands.
  2. Vector DB Setup: A local Qdrant docker instance runs in the background to handle vectors and similarity queries.
  3. AST-Aware Indexing: SocratiCode parses the project directory, chunking files logically based on syntactic boundaries such as functions and classes.
  4. Vector Generation: Code chunks are translated into embeddings using either a local LLM or an API-based provider, then uploaded to Qdrant.
  5. Semantic Retrieval: The AI agent queries the codebase through MCP-exposed endpoints, executing hybrid semantic-keyword searches to pull highly contextual, relevant code snippets.

SocratiCode MCP Setup

1. Install Dependencies

First, install the mcporter command-line tool globally:

npm install -g mcporter

2. Configure MCPorter

Create your MCP config file at ~/.openclaw/workspace/config/mcporter.json to register SocratiCode:

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

Verify your server is registered by running mcporter list.

3. Spin up Qdrant Vector DB

SocratiCode relies on Qdrant. Start the Qdrant container with Docker:

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

4. Per-Project Indexing Configuration

To index files inside a specific repository instead of the global configuration directory, create a mcporter.json in your project root:

cd /path/to/your-project

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

Now use the --config parameter to run index, status check, or search commands:

mcporter --config mcporter.json call socraticode.codebase_index

SocratiCode MCP Data Schema & Taxonomy

Data Architecture and Storage

The SocratiCode MCP server uses a local vector storage architecture coupled with configuration schemas to structure its code intelligence:

Component Type / Location Description
Vector Database Qdrant Docker (Ports 16333/16334) Stores multi-dimensional vectors representing code chunks for similarity search.
AST Chunking AST Parser (18+ Languages) Breaks source files down by logical syntactic blocks (classes, functions, methods) rather than static line length.
Configuration mcporter.json JSON configuration mapped either globally (~/.openclaw/workspace/config/) or per-project.
Dependency Graph Mermaid Diagrams / Cycle Detection Built dynamically via import tracking commands.

SocratiCode MCP Advanced Features

  • Hybrid Search Engine: Employs Reciprocal Rank Fusion (RRF) to combine semantic vector matching and classic keyword searches.
  • AST-Boundary Splitting: Avoids breaking context by chunking specifically around functions, classes, and method boundaries for over 18 languages.
  • Live File Watcher: Features a background file watcher (codebase_watch) that dynamically re-indexes code on saves to keep the model context fresh.
  • Dependency & Diagram Analysis: Offers tools for generating interactive Mermaid architectural diagrams (codebase_graph_visualize) and detecting circular dependencies (codebase_graph_circular).
  • Configurable Embeddings: Swappable backend support for local embeddings with Ollama (brew install ollama) or high-performance remote APIs like OpenAI.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*