Skip to main content

MCP server: semantic code search with SQLite + local free embeddings

Project description

semantic-code-index-mcp

MCP server cho Claude / Claude Code: index semantic vào SQLite, embedding chạy local (miễn phí, không API), công cụ tìm kiếm và thống kê token ước lượng.

Cài đặt

cd /path/to/semantic-code-index-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Lần đầu chạy, fastembed sẽ tải model ONNX (khoảng vài chục MB).

Biến môi trường

  • SEMANTIC_CODE_ROOT hoặc WORKSPACE_ROOT: thư mục gốc project cần index (mặc định: thư mục làm việc của process MCP).

Claude Code / Cursor MCP

Thêm server (stdio), ví dụ trong cấu hình MCP của client:

{
  "mcpServers": {
    "semantic-code-index": {
      "command": "semantic-code-index-mcp",
      "env": {
        "SEMANTIC_CODE_ROOT": "/absolute/path/to/your/repo"
      }
    }
  }
}

Nếu không set SEMANTIC_CODE_ROOT, đặt cwd của server trỏ vào repo hoặc truyền root_path trong từng tool call.

Tools

Tool Mô tả
index_project Index lại toàn bộ
sync_index Chỉ cập nhật file thay đổi / mới / xóa
semantic_search Tìm theo ngôn ngữ tự nhiên
token_usage_stats Ước lượng token “đọc full repo” vs tích lũy từ search

Database: <root>/.semantic_index/index.sqlite3.

Ghi chú

  • Đếm token dùng tiktoken encoding cl100k_base (xấp xỉ Claude/GPT-4), không phải billing thực tế.
  • Vector search hiện quét toàn bộ chunk trong SQLite; repo rất lớn có thể cần mở rộng (sqlite-vec / ANN).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantic_code_index_mcp-0.2.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semantic_code_index_mcp-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file semantic_code_index_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: semantic_code_index_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for semantic_code_index_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f15cc60e4351be822cc8504da187535cd537858ee2b34b252552008fbb46f5dd
MD5 80f23fcadc0dd35f8ef50528df086960
BLAKE2b-256 32809295d71231ef1e0fab4140a5c9b68bf6af048f810e2ca845c803e2e93aee

See more details on using hashes here.

File details

Details for the file semantic_code_index_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: semantic_code_index_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for semantic_code_index_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d2729e70267d911ea89a3ead986a3c6ab124747be6b4da51124ee6899e3748f
MD5 5fc69975c851212bb7c074bc84ba0bb7
BLAKE2b-256 1a09e3d7f52b9f6ffb109430f960b15e64c5db9f021bf1d3b42c3f757a2f20d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page