Metadata-Version: 2.4
Name: sari
Version: 0.5.9
Summary: High-performance local search and indexing engine for large codebases
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: peewee>=3.17.0
Requires-Dist: tenacity>=8.2.0
Requires-Dist: filelock>=3.12.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: click>=8.0.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: starlette>=0.27.0
Requires-Dist: uvicorn>=0.22.0
Requires-Dist: structlog>=23.1.0
Requires-Dist: tree-sitter>=0.22.0
Requires-Dist: tree-sitter-languages>=1.10.0
Requires-Dist: tree-sitter-java>=0.21.0
Requires-Dist: tree-sitter-javascript>=0.21.0
Requires-Dist: tree-sitter-typescript>=0.21.0
Requires-Dist: tree-sitter-python>=0.21.0
Requires-Dist: tree-sitter-bash>=0.21.0
Requires-Dist: tree-sitter-php>=0.21.0
Requires-Dist: lindera-python>=0.2.0
Requires-Dist: tiktoken>=0.5.0
Requires-Dist: tantivy>=0.25.1
Requires-Dist: pathspec>=0.12.0
Requires-Dist: watchdog>=4.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: tree-sitter-swift>=0.0.1
Requires-Dist: tree-sitter-kotlin>=0.3.0
Requires-Dist: tree-sitter-ruby>=0.20.0
Requires-Dist: tree-sitter-yaml>=0.5.0
Dynamic: license-file

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

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

---

## 0. 소개

Sari는 다음을 제공합니다.
- 대규모 코드베이스 로컬 인덱싱/검색
- MCP stdio 기반 연동
- 다중 워크스페이스 수집
- 명확한 설정/데이터 경로 분리

---

## 1. 설치

Sari는 **현재 활성화된 파이썬 환경**에 설치됩니다. `uv`를 쓰는 경우 **venv가 필요**합니다.

### 1.1 uv + venv (권장)
```bash
uv venv .venv
uv pip install sari
```

업데이트:
```bash
uv pip install -U sari
```

### 1.2 pip
```bash
pip install sari
```

---

## 2. stdio (MCP 기본 운용)

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

### 2.1 데몬 시작
```bash
sari daemon start -d
```

### 2.2 실행 (stdio)
```bash
python -m sari --transport stdio
```

### 2.3 Gemini CLI 설정 (stdio)
`~/.gemini/settings.json`
```json
{
  "mcpServers": {
    "sari": {
      "command": "/abs/path/to/.venv/bin/python",
      "args": ["-m", "sari", "--transport", "stdio"],
      "env": {
        "SARI_CONFIG": "/abs/path/to/project/.sari/config.json"
      }
    }
  }
}
```

### 2.4 Codex CLI 설정 (stdio)
`~/.codex/config.toml`
```toml
[mcp_servers.sari]
command = "/abs/path/to/.venv/bin/python"
args = ["-m", "sari", "--transport", "stdio"]
env = { SARI_CONFIG = "/abs/path/to/project/.sari/config.json" }
```

---

## 3. HTTP 모드 (선택)

HTTP 모드는 **stdio와 분리된 별도 프로세스**로 운영합니다.

```bash
python -m sari --transport http --http-api
```

기본 엔드포인트:
```
http://127.0.0.1:47777/mcp
```

---

## 4. 데이터/로그 경로

- 전역 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`

---

## 5. 다중 워크스페이스

### 5.1 CLI
```bash
sari roots add /path/to/workspaceA
sari roots add /path/to/workspaceB
sari roots list
```

### 5.2 설정 파일
```json
{
  "workspace_roots": [
    "/path/to/workspaceA",
    "/path/to/workspaceB"
  ]
}
```

주의:
- 상위/하위가 중첩되는 경로는 피하세요.

---

## 6. 설정 예시

```json
{
  "workspace_root": "/path/to/workspace",
  "workspace_roots": ["/path/to/workspaceA", "/path/to/workspaceB"],
  "db_path": "/custom/path/index.db",
  "include_ext": [".py", ".js", ".ts", ".java", ".rs"],
  "include_files": ["Dockerfile", "Makefile"],
  "exclude_dirs": [".git", "node_modules", ".sari"],
  "exclude_globs": ["**/dist/**"],
  "max_depth": 20,
  "scan_interval_seconds": 180,
  "store_content": true
}
```

---

## 7. 업데이트

```bash
uv pip install -U sari
```

---

## 8. 트러블슈팅

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