MCP server that indexes Python codebases and exposes intelligent tools for code exploration and search
SaferSkills independently audited code-intelligence-mcp (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Model Context Protocol (MCP) server that indexes Python codebases and exposes intelligent tools for code exploration and search.
This server analyzes a Python project at startup, building an in-memory index that includes:
The indexed data powers 8 MCP tools that let an AI assistant navigate and query codebases semantically.
Run directly without installing:
uvx code-intelligence-mcp --root D:\path\to\your\projectNote: On Windows, use double backslashes or forward slashes for paths.
code_intelligence_mcp/
├── main.py # Entry point - run this to start the server
├── mcp_client.py # Test client that connects to the server
├── pyproject.toml # Package configuration
├── README.md # This file
├── src/
│ ├── __init__.py # Package exports
│ ├── __main__.py # Package entry point (for python -m src)
│ ├── types.py # SymbolInfo, CodeIndex data classes
│ ├── indexer.py # AST parsing and codebase indexing
│ ├── search.py # BM25 search setup and search logic
│ └── tools.py # MCP tool definitions (create_tools, handle_tool)
└── code_intelligence.py # Original monolithic file (kept for reference)uv package managerlangchain-mcp-adapters>=0.3.0mcp>=1.27.2rank-bm25>=0.2.2From the repo root:
uv add mcp rank-bm25If you already have them installed, skip this step.
uvx code-intelligence-mcp --root D:\path\to\your\projectcd code_intelligence_mcp
uv run python main.py --root D:\path\to\your\projectcd code_intelligence_mcp
uv run python -m src --root D:\path\to\your\projectNote: On Windows, pass the root path with normal backslashes and useuv run pythoninstead of callinguvdirectly as the subprocess command.
The server will print indexing progress and then wait for MCP requests:
[code-intel] Indexing: D:\path\to\project
[code-intel] Setting up BM25 search index...
[code-intel] Done — 42 files, 156 symbols, 320 BM25 chunksHigh-level overview of the entire codebase. Call this first to orient yourself.
Get the full source of a specific file by relative path.
path (string) - relative path to the fileLook up a class or function by exact name.
name (string) - class or function nameFull-text search using BM25 algorithm - good for finding code by keyword or phrase.
query (string, required) - search keyword/phrasetop_k (integer, default=5) - number of resultsGet all imports for a specific file - what modules/names it depends on.
path (string) - relative path to the fileFind every location in the codebase where a given name is referenced (calls, attribute access, variable use).
name (string, required) - symbol name to findlimit (integer, default=20) - max resultsList ALL classes in the codebase with their file, line, and method signatures.
List ALL top-level functions with their file, line, signature, and docstring.
import asyncio
from langchain_mcp_adapters.client import MultiServerMCPClient
async def main():
client = MultiServerMCPClient(
{
"project-intel": {
"transport": "stdio",
"command": "uv",
"args": [
"run",
"python",
"main.py",
"--root",
"D:\\path\\to\\your\\project",
],
}
}
)
tools = await client.get_tools()
print(f"Loaded {len(tools)} tools:")
for tool in tools:
print(f" - {tool.name}")
if __name__ == "__main__":
asyncio.run(main())Run with:
uv run python mcp_client.pyAfter publishing, users can install and run:
# Install globally
uv pip install code-intelligence-mcp
# Or run directly with uvx (recommended)
uvx code-intelligence-mcp --root D:\path\to\your\projectmcp.shared.exceptions.McpError: Connection closed usually means the server subprocess failed to start correctly.uv run python command works manually before using it inside mcp_client.py.--root is valid and accessible.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.