turbovec-mcp

turbovec-mcp

Enables local semantic code search using compressed vectors from turbovec and any OpenAI-compatible embeddings endpoint.

Category
访问服务器

README

turbovec-mcp

Local semantic code search over MCP, backed by turbovec (Google's TurboQuant: ~16x vector compression, fast on Apple Silicon). Bring your own OpenAI-compatible embeddings endpoint - nothing leaves your machine.

code -> chunker -> [your embeddings endpoint] -> turbovec index -> search
  • embedder: any OpenAI-compatible /v1/embeddings (a llama.cpp server, etc). Dimension is auto-detected.
  • store: turbovec IdMapIndex, persisted per-repo under .turbovec/.
  • orchestrator: this MCP server (chunk, embed, index, search).

Install / run

uvx turbovec-mcp        # run directly, no install (recommended)
# or
pipx install turbovec-mcp

Requires a running embeddings endpoint. Example with llama.cpp:

llama-server -m nomic-embed-text-v1.5.Q8_0.gguf --embedding --pooling mean --port 8081

Configure (environment)

var default meaning
TURBOVEC_EMBED_ENDPOINT http://127.0.0.1:8081/v1 OpenAI-compatible base URL
TURBOVEC_EMBED_MODEL nomic-embed-text-v1.5.Q8_0.gguf model name sent in the request
TURBOVEC_EMBED_API_KEY sk-local bearer token (unused locally, must be non-empty)
TURBOVEC_DOC_PREFIX auto prefix for documents; auto = search_document: when model name contains "nomic", else ""
TURBOVEC_QUERY_PREFIX auto prefix for queries; auto = search_query: when model name contains "nomic", else ""
TURBOVEC_BATCH_SIZE 64 embedding inputs per request
TURBOVEC_TIMEOUT 120 embedding request timeout (seconds)
TURBOVEC_MAX_EMBED_CHARS 1800 hard char cap per embedded input
TURBOVEC_BIT_WIDTH 4 turbovec quantization bits (2 or 4)
TURBOVEC_CHUNK_LINES 60 lines per chunk
TURBOVEC_CHUNK_OVERLAP 12 overlap between chunks
TURBOVEC_MAX_FILE_MB 2 skip files larger than this
TURBOVEC_EXTRA_EXTENSIONS "" comma list of extra extensions to index
TURBOVEC_EXTRA_SKIP_DIRS "" comma list of extra dirs to skip

With the default nomic model the prefixes auto-resolve, so a bare setup needs no env exports at all. Set the env vars (or pass another model) only for a non-nomic embedder.

Setup

With the default nomic embedder this is the whole flow - no config editing, no env exports:

# (a) run the embeddings endpoint
llama-server -m nomic-embed-text-v1.5.Q8_0.gguf --embedding --pooling mean --port 8081
# (b) register + seed file selection (writes .mcp.json AND opencode.jsonc)
turbovec-mcp init .
# (c) build the index
turbovec-mcp index .
# (d) restart your agent so it picks up the new MCP server

init registers the turbovec MCP server into both project-local configs automatically:

  • <repo>/.mcp.json (Claude Code) - merged in, other servers preserved.
  • <repo>/opencode.jsonc - created if absent, surgically merged if it's plain JSON. Only an existing opencode.jsonc that contains comments is left untouched; in that one case init prints a snippet to paste under its "mcp" key. Your global ~/.config/opencode config is never touched.

The registered command is the absolute path to the installed turbovec-mcp (reliable today); once published to PyPI you can use uvx turbovec-mcp instead.

Pass --no-register to seed config.json only and skip writing both config files.

Chunking

AST-aware via tree-sitter. Each function / class / method that fits the embedder becomes one chunk on clean boundaries; a god-class too large to embed whole is split into its methods; any lines not covered by a definition (imports, top-level code, a giant leaf function) are line-windowed, so coverage is total. Unsupported languages / parse failures fall back to plain line-window chunking - nothing is skipped.

Supported out of the box: Python, JS/TS/TSX, Go, Rust, Java, Kotlin, Scala, Swift, C/C++, C#, Ruby, PHP, Lua, Perl, R, Julia, Bash, Fortran (f90/f95). Add more file extensions with TURBOVEC_EXTRA_EXTENSIONS.

Tools

Workflow is two steps: tv_search for terse triage, then tv_fetch to read the locations you picked.

  • tv_search(query, k=10, path=".") - semantic search. Terse: each hit is score + location (path:start-end) + the chunk's signature line. No source bodies.
  • tv_fetch(locations, path=".") - full source for a list of "path:start-end" locations (the ones tv_search returned).
  • tv_index(path=".") - (re)build the index for a repo. Run once before searching, and after large changes.
  • tv_status(path=".") - whether a repo is indexed + basic stats.

The index lives in <repo>/.turbovec/ - add it to .gitignore.

File selection

<repo>/.turbovec/config.json is the source of truth for which files get indexed: its include / exclude glob lists decide everything. Seed it with:

turbovec-mcp init [path]     # seed config + register both agents (-f to rewrite)

init does two things:

  1. Seeds <repo>/.turbovec/config.json, filling exclude from the default skip dirs plus any nested .gitignores in the tree.
  2. Registers the turbovec MCP server into project-local <repo>/.mcp.json (Claude Code) and <repo>/opencode.jsonc (opencode). Both preserve any other servers and are idempotent; pass -f to rewrite the entry. The registered command is the absolute path to the installed turbovec-mcp. opencode.jsonc is created if absent and surgically merged if it's plain JSON; an existing comment-bearing opencode.jsonc is left alone and a paste-snippet is printed instead. The global ~/.config/opencode config is never touched.

Pass --no-register to seed config.json only and skip writing both config files.

Edit the globs, then run turbovec-mcp index.

CLI

For testing from the terminal:

turbovec-mcp init [path]                  # seed config + register .mcp.json + opencode.jsonc; --no-register to skip
turbovec-mcp index <path>                 # build/rebuild the index
turbovec-mcp status <path>
turbovec-mcp search <path> <query> [-k N] # terse: score  path:lines  signature
turbovec-mcp fetch <path> <location>...   # full source for path:start-end

License

BSD-3-Clause

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选