Skip to main content

High-performance local search and indexing engine for large codebases

Project description

Sari – 로컬 코드 검색/인덱싱 MCP 서버

Sari는 로컬에서 동작하는 코드 검색/인덱싱 MCP 서버입니다. 소스코드를 외부로 보내지 않고, 로컬에서 빠르게 검색하도록 설계되어 있습니다.

Sari is a local code search/indexing MCP server. It is designed to index and search locally without sending your source code outside your machine.


1. 소개 / Overview

(KR)

Sari는 대규모 코드베이스를 로컬에서 인덱싱하고 빠르게 검색할 수 있도록 설계된 MCP 서버입니다. MCP stdio 연동을 기본으로 하며, 다중 워크스페이스 수집과 명확한 설정/데이터 경로 분리를 제공합니다.

(EN)

Sari is an MCP server built for fast, local indexing and search across large codebases. It defaults to MCP stdio integration, supports multi-workspace collection, and keeps configuration and data paths clearly separated.


2. 설치 / Installation

2.1 (KR) 권장: venv 설치

Sari는 venv 환경에서 설치/실행하는 방식을 권장합니다.

uv venv .venv
source .venv/bin/activate
uv pip install sari

업데이트:

source .venv/bin/activate
uv pip install -U sari

2.1 (EN) Recommended: venv install

We recommend installing and running Sari inside a venv.

uv venv .venv
source .venv/bin/activate
uv pip install sari

Update:

source .venv/bin/activate
uv pip install -U sari

2.2 (KR) 전역 설치(선택)

전역 설치도 가능하지만 MCP 설정 경로가 꼬이기 쉬우므로 venv를 권장합니다.

옵션 A: uv tool

uv tool install sari

옵션 B: 시스템 설치

uv pip install --system sari

MCP 설정의 command설치된 파이썬 경로를 사용해야 합니다.

2.2 (EN) Global install (optional)

Global install is possible, but venv is safer for MCP path consistency.

Option A: uv tool

uv tool install sari

Option B: system install

uv pip install --system sari

For MCP configs, the command must point to the Python executable from the chosen install.


3. 실행 모드 / Runtime Modes

3.1 (KR) stdio (MCP 고정 운용)

stdio는 데몬 프록시로 동작합니다. stdio를 사용하려면 데몬이 필요합니다.

데몬 시작:

sari daemon start -d

stdio 실행:

python -m sari --transport stdio

3.1 (EN) stdio (MCP recommended)

stdio runs as a daemon proxy. You need the daemon for stdio.

Start daemon:

sari daemon start -d

Run stdio:

python -m sari --transport stdio

3.2 (KR) HTTP API

HTTP API 서버를 실행합니다.

python -m sari --transport http --http-api-port 47777

헬스 체크:

curl http://127.0.0.1:47777/health

3.2 (EN) HTTP API

Start the HTTP API server.

python -m sari --transport http --http-api-port 47777

Health check:

curl http://127.0.0.1:47777/health

4. MCP 클라이언트 설정 / MCP Client Setup

4.1 (KR) Gemini CLI

~/.gemini/settings.json

{
  "mcpServers": {
    "sari": {
      "command": "/abs/path/to/.venv/bin/python",
      "args": ["-m", "sari", "--transport", "stdio"],
      "env": {
        "SARI_CONFIG": "/abs/path/to/workspace/.sari/config.json"
      }
    }
  }
}

4.1 (EN) Gemini CLI

~/.gemini/settings.json

{
  "mcpServers": {
    "sari": {
      "command": "/abs/path/to/.venv/bin/python",
      "args": ["-m", "sari", "--transport", "stdio"],
      "env": {
        "SARI_CONFIG": "/abs/path/to/workspace/.sari/config.json"
      }
    }
  }
}

4.2 (KR) Codex CLI

~/.codex/config.toml

[mcp_servers.sari]
command = "/abs/path/to/.venv/bin/python"
args = ["-m", "sari", "--transport", "stdio"]
env = { SARI_CONFIG = "/abs/path/to/workspace/.sari/config.json" }

4.2 (EN) Codex CLI

~/.codex/config.toml

[mcp_servers.sari]
command = "/abs/path/to/.venv/bin/python"
args = ["-m", "sari", "--transport", "stdio"]
env = { SARI_CONFIG = "/abs/path/to/workspace/.sari/config.json" }

4.3 (KR) 기타 MCP 클라이언트/IDE

아래 템플릿을 MCP 설정에 맞게 사용하세요.

{
  "command": "/abs/path/to/python",
  "args": ["-m", "sari", "--transport", "stdio"],
  "env": {
    "SARI_CONFIG": "/abs/path/to/workspace/.sari/config.json"
  }
}

4.3 (EN) Other MCP clients/IDEs

Use the following template in your MCP settings.

{
  "command": "/abs/path/to/python",
  "args": ["-m", "sari", "--transport", "stdio"],
  "env": {
    "SARI_CONFIG": "/abs/path/to/workspace/.sari/config.json"
  }
}

5. 데이터/설치 경로 / Data & Install Paths

(KR)

  • 전역 DB: ~/.local/share/sari/index.db
  • 전역 레지스트리: ~/.local/share/sari/server.json
  • 로그: ~/.local/share/sari/logs
  • 워크스페이스 설정: <workspace>/.sari/config.json 또는 <workspace>/sari.json
  • 전역 설정: ~/.config/sari/config.json

설치 경로는 설치 방식에 따라 다릅니다.

  • venv: <workspace>/.venv/
  • uv tool: ~/.local/share/uv/tools/sari/ (실행 바이너리: ~/.local/bin/sari)
  • system install: 시스템 Python site-packages

(EN)

  • Global DB: ~/.local/share/sari/index.db
  • Global registry: ~/.local/share/sari/server.json
  • Logs: ~/.local/share/sari/logs
  • Workspace config: <workspace>/.sari/config.json or <workspace>/sari.json
  • Global config: ~/.config/sari/config.json

Install path depends on the chosen method.

  • venv: <workspace>/.venv/
  • uv tool: ~/.local/share/uv/tools/sari/ (binary: ~/.local/bin/sari)
  • system install: system Python site-packages

6. 다중 워크스페이스 / Multi-workspace

6.1 (KR) CLI

sari roots add /path/to/workspaceA
sari roots add /path/to/workspaceB
sari roots list

6.1 (EN) CLI

sari roots add /path/to/workspaceA
sari roots add /path/to/workspaceB
sari roots list

6.2 (KR) 설정 파일

{
  "workspace_roots": [
    "/path/to/workspaceA",
    "/path/to/workspaceB"
  ]
}

6.2 (EN) Config file

{
  "workspace_roots": [
    "/path/to/workspaceA",
    "/path/to/workspaceB"
  ]
}

주의/Note:

  • 상위/하위가 중첩되는 경로는 피하세요.
  • Avoid nested roots (parent/child) to prevent duplicate scans.

7. 설정 레퍼런스 / Configuration Reference

다음은 주요 설정값입니다.

Key Description (KR) Description (EN) Default
workspace_root 기본 워크스페이스 루트 Default workspace root 현재 작업 디렉토리
workspace_roots 다중 워크스페이스 목록 Multi-workspace roots [workspace_root]
db_path DB 파일 경로 DB file path ~/.local/share/sari/index.db
include_ext 인덱싱 확장자 File extensions to index .py, .js, .ts, .java, ...
include_files 확장자와 무관한 추가 파일 Extra files regardless of extension []
exclude_dirs 제외 디렉토리 Excluded directories .git, node_modules, .venv, ...
exclude_globs 제외 패턴 Excluded glob patterns .venv*, venv*, env*, *.egg-info
max_depth 탐색 최대 깊이 Max directory depth 20
scan_interval_seconds 자동 스캔 주기 Auto-scan interval (sec) 180
store_content 원문 저장 여부 Store file content true
http_api_host HTTP 호스트 HTTP host 127.0.0.1
http_api_port HTTP 포트 HTTP port 47777

8. call_graph 옵션 / call_graph Options

(KR)

call_graph는 스코프/예산을 명시할수록 안정성과 정확도가 올라갑니다.

  • repo: 레포 강제 스코프
  • root_ids: 루트 ID 스코프
  • depth: 기본 깊이 (default: 2)
  • max_nodes, max_edges, max_depth, max_time_ms: 그래프 예산
  • sort: line 또는 name
  • include_paths/exclude_paths: glob 패턴 필터

권장 예시:

{
  "symbol": "FooService",
  "repo": "my-repo",
  "depth": 2,
  "max_nodes": 300,
  "max_edges": 800,
  "max_time_ms": 1500
}

(EN)

call_graph becomes more stable and accurate when you provide explicit scope and budgets.

  • repo: force repository scope
  • root_ids: root id scope
  • depth: base depth (default: 2)
  • max_nodes, max_edges, max_depth, max_time_ms: graph budgets
  • sort: line or name
  • include_paths/exclude_paths: glob filters

Recommended:

{
  "symbol": "FooService",
  "repo": "my-repo",
  "depth": 2,
  "max_nodes": 300,
  "max_edges": 800,
  "max_time_ms": 1500
}

9. 업데이트 / Update

(KR)

source .venv/bin/activate
uv pip install -U sari

(EN)

source .venv/bin/activate
uv pip install -U sari

9. 트러블슈팅 / Troubleshooting

문제가 발생하면 docs/TROUBLESHOOTING.md를 확인하세요.

Please see docs/TROUBLESHOOTING.md when issues occur.


10. 부분응답 모드 / Partial-Response Mode

(KR)

DB I/O 오류나 인덱싱 미완료 상태에서도 부분 결과를 반환합니다.
응답 메타에 partial=true, db_health, index_ready가 표시됩니다.

(EN)

Even when DB I/O fails or indexing is incomplete, Sari can return partial results.
The response meta includes partial=true, db_health, and index_ready.

Project details


Release history Release notifications | RSS feed

This version

0.6.0

Download files

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

Source Distribution

sari-0.6.0.tar.gz (260.3 kB view details)

Uploaded Source

Built Distribution

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

sari-0.6.0-py3-none-any.whl (251.9 kB view details)

Uploaded Python 3

File details

Details for the file sari-0.6.0.tar.gz.

File metadata

  • Download URL: sari-0.6.0.tar.gz
  • Upload date:
  • Size: 260.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sari-0.6.0.tar.gz
Algorithm Hash digest
SHA256 0d21b358a13f7074105f6ab8df1f274ac1384adff26f20f585f97fd2d64ec9f1
MD5 5001f999767ef86b143895368f54055c
BLAKE2b-256 af3814f67e5a8596d7d7445dda21263ac196f5affdd5d4d9d8e40bcf579baf0a

See more details on using hashes here.

File details

Details for the file sari-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: sari-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 251.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sari-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cc2c9f0501a9f0a91ff9ae952cfbd402ebbd2fefacd71d34b8a3e4c1756b806
MD5 d31f055f47aceb145bdc3d2eaa630bd2
BLAKE2b-256 8db61a250a8841b11e6b1b914e207c922ae0f708a24d546863cce592b454c11f

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