Sign inSign up

ibaz/paparats-server

By ibaz

Updated 17 days ago

Semantic code search MCP server with AST chunking, symbol graph, and Qdrant + Ollama

Image
Machine learning & AI
Developer tools
Databases & storage
0

10K+

ibaz/paparats-server repository overview

Paparats MCP Server

Semantic code search for AI coding assistants. This is the core MCP server for the Paparats project. It enables Claude Code, Cursor, Windsurf, Codex, and other MCP-compatible tools to search your codebase by meaning, not keywords. Everything runs locally - your code never leaves your machine.

Key Features

  • AST-aware chunking - tree-sitter parses code into natural boundaries (functions, classes, methods) for 11 languages: TypeScript, JavaScript, TSX, Python, Go, Rust, Java, Ruby, C, C++, C#. Regex fallback for Terraform and others
  • Symbol graph - AST-based extraction of defined symbols and symbol usages per chunk. Cross-chunk edges: calls/called_by, references/referenced_by. Powers the find_usages tool
  • Dual MCP endpoints - coding (/mcp) for developers and support (/support/mcp) for bots and support teams, each with its own tool set and system instructions
  • Query expansion - abbreviations, case variants, plurals, filler word removal. All variants searched in parallel, merged by max score
  • Task-specific embeddings - Jina Code Embeddings 1.5B with automatic prefix detection (nl2code, code2code, techqa)
  • Git history per chunk - who modified it, when, and linked tickets (Jira, GitHub, custom patterns)
  • Real-time file watching - edit a file, re-indexed in ~2 seconds
  • Embedding cache - SQLite cache with content-hash keys, unchanged code is never re-embedded
  • Multi-project workspaces - group multiple repos into one search scope
  • Prometheus metrics - opt-in via PAPARATS_METRICS=true for operational visibility

MCP Tools

Coding Endpoint (/mcp)
ToolDescription
search_codeSemantic search with confidence scores and symbol info
get_chunkRetrieve a chunk by ID with optional surrounding context
find_usagesSymbol relationships: callers, dependencies, or both directions
health_checkIndexing status per group
reindexTrigger full reindex
Support Endpoint (/support/mcp)

All coding tools plus:

ToolDescription
get_chunk_metaGit history and ticket references for a chunk
search_changesSemantic search filtered by last commit date
explain_featureFeature analysis: code locations + changes + modules
recent_changesTimeline of changes with commits and tickets
impact_analysisDependency subgraph: blast radius + service graph

Quick Start

# Install CLI
npm install -g @paparats/cli

# One-time setup (starts Docker containers, downloads ~1.6 GB model)
paparats install

# In your project
cd your-project
paparats init    # creates .paparats.yml
paparats index   # index the codebase
paparats watch   # keep index fresh

Docker Usage

docker pull ibaz/paparats-server:latest
# docker-compose.yml
services:
  paparats:
    image: ibaz/paparats-server:latest
    ports:
      - "9876:9876"
    environment:
      QDRANT_URL: http://qdrant:6333
      OLLAMA_URL: http://host.docker.internal:11434
    volumes:
      - paparats_data:/data

  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
    volumes:
      - qdrant_data:/qdrant/storage

volumes:
  paparats_data:
  qdrant_data:

Use paparats install for automated setup with all options (local/Docker Ollama, developer/server/support modes).

Configuration

Port 9876 (configurable via PORT env var).

Environment Variables
VariableDefaultDescription
PORT9876HTTP server port
QDRANT_URLhttp://localhost:6333Qdrant vector database URL
OLLAMA_URLhttp://host.docker.internal:11434Ollama embedding service URL
PAPARATS_METRICSfalseEnable Prometheus metrics at /metrics
QUERY_CACHE_MAX_ENTRIES1000Max cached search queries
QUERY_CACHE_TTL_MS300000Cache TTL in milliseconds
Volumes
PathDescription
/dataEmbedding cache (SQLite) and metadata store
Endpoints
PathDescription
/mcpMCP coding endpoint (Streamable HTTP)
/sseMCP coding endpoint (SSE)
/support/mcpMCP support endpoint (Streamable HTTP)
/support/sseMCP support endpoint (SSE)
/api/*HTTP API (index, search, stats, health)
/healthHealth check
/metricsPrometheus metrics (when enabled)

Connecting MCP

Cursor
{
  "mcpServers": {
    "paparats": {
      "type": "http",
      "url": "http://localhost:9876/mcp"
    }
  }
}
Claude Code
claude mcp add --transport http paparats http://localhost:9876/mcp

Architecture

AI Assistant (Cursor/Claude) -> MCP Client -> [This Container] -> Qdrant
                                                     |
                                               Host: Ollama (embeddings)

The server receives MCP tool calls from AI assistants, performs semantic search against Qdrant, and returns only the relevant code chunks with symbol information, confidence scores, and metadata.

ImageDescription
ibaz/paparats-indexerAutomated repo indexer - clones and indexes on a schedule
ibaz/paparats-ollamaOllama with pre-baked Jina Code Embeddings model

Support

Part of the Paparats MCP project - local, private semantic code search for AI coding assistants.

Tag summary

Content type

Image

Digest

sha256:2f379fbb7

Size

84 MB

Last updated

17 days ago

docker pull ibaz/paparats-server