# MCP Server for Full Codebase Context — Setup Guide

Last updated: April 2026 | Reading time: 6 min

The Model Context Protocol (MCP) is the new standard for connecting AI coding tools to external context sources. Cursor, Claude Code, VS Code, Windsurf, and Cline all support MCP servers — but most MCP servers just expose basic file read/search operations.

Entroly's MCP server is different. It doesn't just serve files — it serves optimally selected, compressed, dependency-aware context that gives your AI tool visibility into your entire codebase.

## What is MCP?

Model Context Protocol (MCP) is an open standard by Anthropic that lets AI tools connect to external data sources. Instead of the AI tool searching for files itself, it can call tools on an MCP server to get better context.

Think of it like a database adapter — MCP standardizes how AI tools request and receive context, so any MCP-compatible tool can benefit from better context sources.

## Why Entroly's MCP Server is Different

| Basic MCP Server | Entroly MCP Server
--- | --- | ---
Serves | Raw files | Optimally compressed context
Coverage | Files you ask for | Entire codebase at variable resolution
Dependencies | Not tracked | Auto-included
Duplicates | Sent as-is | Detected and merged (SimHash)
Token budget | No awareness | Knapsack-optimal allocation
Learning | None | RL-based weight optimization
Tools provided | 1-2 (read, search) | 10+ specialized tools

## Setup by AI Tool

### Cursor

    pip install entroly[full]
    entroly init

Entroly auto-detects Cursor and generates `.cursor/mcp.json`. Restart Cursor and the MCP server connects automatically.

### Claude Code

    pip install entroly[full]
    claude mcp add entroly -- entroly

One command. Claude Code connects to Entroly's MCP server on the next session.

### VS Code / Windsurf / Cline

    pip install entroly[full]
    entroly init

Auto-detects your IDE and generates the appropriate MCP configuration.

### Any MCP-Compatible Tool

    pip install entroly[full]
    entroly serve --transport stdio

Or with SSE transport for remote connections:

    entroly serve --transport sse --port 9378

## MCP Tools Provided by Entroly

Tool | What It Does
--- | ---
`optimize_context` | Select optimal context for a query and token budget
`remember_fragment` | Store context with auto-dedup and entropy scoring
`recall_relevant` | Sub-linear semantic recall via multi-probe LSH
`record_outcome` | Feed the reinforcement learning loop
`explain_context` | Show why each fragment was included/excluded
`checkpoint_state` | Save full session state
`resume_state` | Restore from checkpoint
`prefetch_related` | Predict and pre-load likely-needed context
`get_stats` | Session statistics and cost savings
`health_check` | Codebase health: clones, dead code, god files

## How It Works

When your AI tool makes a request:

1. The AI tool calls `optimize_context` with the user's query and token budget
2. Entroly's Rust engine scores and selects the optimal code fragments in <10ms
3. The selected context is delivered at variable resolution — full, signatures, or references
4. The AI tool receives context covering 100% of the codebase using 78% fewer tokens
5. After the AI responds, `record_outcome` feeds the learning loop

## Configuration

### Transport Options

    # stdio (default — for local IDE connections)
    entroly serve --transport stdio

    # SSE (for remote / multi-client setups)
    entroly serve --transport sse --port 9378

### Quality Presets

    entroly serve --quality balanced    # recommended
    entroly serve --quality max         # best context, slightly more latency
    entroly serve --quality speed       # fastest, lighter optimization

### Environment Variables

Variable | Default | Description
--- | --- | ---
`ENTROLY_MCP_TRANSPORT` | stdio | Transport mode
`ENTROLY_QUALITY` | 0.5 | Quality dial (0.0-1.0)
`ENTROLY_MAX_FILES` | 5000 | Max files to index

## Troubleshooting

### MCP server not connecting

    entroly doctor

Runs 7 diagnostic checks including MCP connectivity, port availability, and config validation.

### Cursor doesn't see the MCP server

Check that `.cursor/mcp.json` exists and restart Cursor. Entroly needs to be installed globally or in the same environment Cursor can access.

### High latency

Switch to a faster quality preset: `entroly serve --quality speed`. Or install the Rust engine: `pip install entroly[native]`.

### The smartest MCP server for AI coding.

Full codebase context. 78% fewer tokens. Works with every MCP-compatible tool.

    pip install entroly[full] && entroly init

View on GitHub