SS

srclight/srclight

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

59 stars 13 forks 质量 86 趋势 27MIT

为AI代理提供深度代码索引MCP服务器。25个工具:混合FTS5 + 嵌入搜索、呼叫图、git blame/hotspots、构建系统分析。

概览

SQLite FTS5 + 树置 + 嵌入 + MCP。 Srclight 构建了一个丰富且可搜索的代码库索引,AI 编码代理可以即时查询——用精确、结构化的查找替代数十次 grep/glob 调用。它是目前最全面的代码智能 MCP 服务器:42 个工具,涵盖符号搜索、关系图、社区检测、影响分析、git 变更智能、语义搜索、构建系统意识和文档提取——这些能力是其他 MCP 服务器无法兼备的。完全本地化且私密:你的代码永远不会离开你的机器。 AI编码代理(Claude代码、光标等)花费了大量时间——搜索文件、阅读代码以理解结构、寻找调用者和被调用者。Srclight消除了这些浪费。

概述(AI 翻译)

AI代理的深度代码索引。 SQLite FTS5 + 树置 + 嵌入 + MCP。

Srclight 构建了一个丰富且可搜索的代码库索引,AI 编码代理可以即时查询——用精确、结构化的查找替代数十次 grep/glob 调用。它是目前最全面的代码智能 MCP 服务器:42 个工具,涵盖符号搜索、关系图、社区检测、影响分析、git 变更智能、语义搜索、构建系统意识和文档提取——这些能力是其他 MCP 服务器无法兼备的。完全本地化且私密:你的代码永远不会离开你的机器。

为什么?

AI编码代理(Claude Code、Cursor等)花费了**40-60%的令牌用于定位——搜索文件、阅读代码理解结构、寻找调用者和被调用者。Srclight消除了这些浪费。

没有Srclight 带Srclight
8-12发grep弹搜索来电者 get_callers("lookup") — 一通电话
阅读5个文件以理解模块 codebase_map() — 即时概述
“找到能做X的代码” →20次 grep semantic_search("dictionary lookup") — 一个呼叫

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Srclight

Deep code indexing for AI agents. SQLite FTS5 + tree-sitter + embeddings + MCP.

Srclight builds a rich, searchable index of your codebase that AI coding agents can query instantly — replacing dozens of grep/glob calls with precise, structured lookups. It is the most comprehensive code intelligence MCP server available: 42 tools covering symbol search, relationship graphs, community detection, impact analysis, git change intelligence, semantic search, build system awareness, and document extraction — capabilities no other single MCP server combines. Fully local and private: your code never leaves your machine.

Why?

AI coding agents (Claude Code, Cursor, etc.) spend 40-60% of their tokens on orientation — searching for files, reading code to understand structure, hunting for callers and callees. Srclight eliminates this waste.

Without Srclight With Srclight
8-12 grep rounds to find callers get_callers("lookup") — one call
Read 5 files to understand module codebase_map() — instant overview
“Find code that does X” → 20 greps semantic_search("dictionary lookup") — one call
Edit a function, break 47 callers detect_changes() — shows blast radius before you commit
15-25 tool calls per bug fix 5-8 tool calls per bug fix

Features

  • Minimal dependencies — single SQLite file per repo, no Docker/Redis/vector DB
  • Fully offline — no API calls, works air-gapped (Ollama local embeddings)
  • Incremental — only re-indexes changed files (content hash detection)
  • 19 languages — Python, C, C++, C#, Java, Kotlin, Swift, Dart, Go, Rust, JavaScript, TypeScript, PHP, Lua, Bash, SQL, Groovy, CMake, Markdown — include fragments (.inc, .inl, .ipp, .tcc) included, plus any extension you declare with --ext
  • Says what it skipped — index_status names the extensions a run walked past, so an incomplete answer never reads as a complete one
  • 10 document formats — PDF, DOCX, XLSX, HTML, CSV/TSV, email (.eml), images (PNG/JPG/SVG/etc.), plain text, RST, Markdown
  • Optional OCR — PaddleOCR for scanned/image-only PDF pages; pytesseract for images
  • 4 search modes — symbol names, source code (trigram), documentation (stemmed), semantic (embeddings)
  • Hybrid search — RRF fusion of keyword + semantic results for best accuracy
  • Multi-repo workspaces — search across all your repos simultaneously via SQLite ATTACH+UNION
  • MCP server — works with Claude Code, Cursor, and any MCP client
  • CLI — index, search, and inspect from the terminal
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "srclight": { "command": "srclight", "args": ["serve", "--workspace", "myworkspace"] } } }