codescout 0.13.0

High-performance coding agent toolkit MCP server
Documentation
[workspace]
members = [".", "crates/codescout-embed"]
resolver = "2"

[workspace.package]
edition = "2021"
license = "MIT"
authors = ["Marius Ailinca"]
repository = "https://github.com/mareurs/codescout"
homepage = "https://mareurs.github.io/codescout/"
documentation = "https://mareurs.github.io/codescout/"

[workspace.dependencies]
anyhow = "1"
thiserror = "2"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
rusqlite = { version = "0.39" }
sqlite-vec = "0.1"

[package]
name = "codescout"
version = "0.13.0"
edition = "2021"
description = "High-performance coding agent toolkit MCP server"
repository = "https://github.com/mareurs/codescout"
homepage = "https://mareurs.github.io/codescout/"
documentation = "https://mareurs.github.io/codescout/"
license = "MIT"
rust-version = "1.82"
build = "build.rs"
exclude = [".codescout/", "docs/", "scripts/", ".github/", "CLAUDE.md"]

[lib]
name = "codescout"
path = "src/lib.rs"

[[bin]]
name = "codescout"
path = "src/main.rs"

[dependencies]
tikv-jemallocator = "0.6"
fs4 = "0.12"
# Async runtime
tokio = { version = "1", features = ["full"] }

# MCP protocol (Rust SDK)
rmcp = { version = "1.3", features = ["server", "macros", "transport-io", "elicitation", "schemars"] }
schemars = "1"

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
toml = "1"

# Error handling
anyhow = "1"
thiserror = "2"
async-trait = "0.1"

# Sibling crates
codescout-embed = { path = "crates/codescout-embed", version = "0.1.0" }

# Logging / tracing
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
tracing-appender = "0.2"

# CLI
clap = { version = "4", features = ["derive"] }

# Git integration
git2 = { version = "0.20", default-features = false, features = ["vendored-libgit2"] }

# Database — SQLite with bundled libsqlite3 (used by call_edges cache +
# migrate-memories legacy reader).
rusqlite = { version = "0.39" }
sqlite-vec = "0.1"

# Retrieval stack client (Qdrant gRPC). Default features drop:
#  - download_snapshots (pulls reqwest, snapshot API unused)
#  - generate-snippets  (codegen helper, unused)
qdrant-client = { version = "1.13", default-features = false, features = ["serde"] }
reqwest = { version = "0.13", default-features = false, features = ["json", "http2", "charset", "rustls-no-provider"] }
# rustls with ring provider (smaller than default aws-lc-rs ~1.3 MiB). Provider
# is installed once at process start via rustls::crypto::ring::default_provider().
rustls = { version = "0.23", default-features = false, features = ["ring", "tls12", "std", "logging"] }

# File system traversal (respects .gitignore)
walkdir = "2"
ignore = "0.4"
globset = "0.4"

# Text / regex
regex = "1"

# Content hashing (incremental indexing)
sha2 = "0.10"
hex = "0.4"

# LSP protocol types
lsp-types = "0.97"

# URI handling (file:// ↔ path conversion, handles Windows drive letters + percent-encoding)
url = "2"

# AST parsing (tree-sitter)
tree-sitter = "0.26"

# HTTP client and local ONNX embeddings are now provided by the codescout-embed crate.
tree-sitter-rust = "0.24.0"
tree-sitter-python = "0.25.0"
tree-sitter-go = "0.25.0"
tree-sitter-typescript = "0.23.2"
tree-sitter-java = "0.23.5"
tree-sitter-kotlin-ng = "1.1.0"
tree-sitter-html = "0.23"
tree-sitter-css = "0.23"
tree-sitter-bash = "0.23"
libc = "0.2.182"

chrono = { version = "0.4", features = ["serde"] }
tempfile = "3"

# Dashboard web server (behind "dashboard" feature) and HTTP transport (behind "http" feature)
axum = { version = "0.8", features = ["json"], optional = true }
tower-http = { version = "0.6", features = ["cors", "limit", "timeout"], optional = true }
open = { version = "5", optional = true }
tokio-util = "0.7"
uuid = { version = "1.20.0", features = ["v4", "v5"] }

# Poison-free, faster synchronization primitives for short-held locks in async
# hot paths where std::sync poisoning is a correctness footgun.
parking_lot = "0.12"

# Librarian dependencies (formerly in crates/librarian-mcp, now dissolved into src/librarian/).
# All marked optional — they are only used by src/librarian/** which is
# cfg(feature = "librarian")-gated. When building --no-default-features these
# crates do not resolve, keeping the lean-build promise documented in [features].
serde_yml      = { version = "0.0.12", optional = true }
dirs           = { version = "5",      optional = true }
pulldown-cmark = { version = "0.13",   optional = true }
futures        = { version = "0.3",    optional = true }
ulid           = { version = "1",      optional = true }
minijinja      = { version = "2", default-features = false, features = ["builtins", "serde"], optional = true }
jsonschema     = { version = "0.30", default-features = false, optional = true }

[features]
default = ["remote-embed", "http", "librarian"]
# Embedded librarian (workspace doc/spec/plan index). Compiled in by
# default for dev; turn off for production publishes via `--no-default-features`.
# Runtime registration is **enabled by default** when compiled in.
# Opt out via `LIBRARIAN_ENABLED=0` env or
# `[librarian] enabled = false` in `<project>/.codescout/project.toml`.
librarian = [
    "dep:serde_yml",
    "dep:dirs",
    "dep:pulldown-cmark",
    "dep:futures",
    "dep:ulid",
    "dep:minijinja",
    "dep:jsonschema",
]
dashboard = ["dep:axum", "dep:tower-http", "dep:open"]
http = ["dep:axum", "dep:tower-http", "rmcp/transport-streamable-http-server"]
# Remote embedding via OpenAI-compatible HTTP API (Ollama, OpenAI, etc.)
remote-embed = ["codescout-embed/remote-embed"]
# Local CPU embedding via fastembed-rs (ONNX Runtime + HuggingFace model hub).
# First use downloads the chosen model (~20-300MB) to ~/.cache/huggingface/hub/.
local-embed = ["codescout-embed/local-embed"]
# Local embedding via candle (HuggingFace Rust ML — adds significant compile time)
# candle-embed = ["dep:candle-core", "dep:candle-transformers", "dep:candle-nn", "dep:hf-hub", "dep:tokenizers"]

# E2E tests — require real LSP servers installed
e2e = ["e2e-rust", "e2e-python", "e2e-typescript", "e2e-kotlin", "e2e-java"]
e2e-rust = []       # needs: rust-analyzer
e2e-python = []     # needs: pyright-langserver
e2e-typescript = [] # needs: typescript-language-server
e2e-kotlin = []     # needs: kotlin-lsp
e2e-java = []       # needs: jdtls
# Retrieval stack E2E tests — require live Qdrant + TEI/Ollama (see docker-compose.yml)
retrieval-e2e = []

[profile.dev]
opt-level = 0
debug = 1

[profile.dev.build-override]
opt-level = 3

[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 16
strip = true
# Abort on panic rather than unwind — prevents a future panic from leaving the
# MCP server in a half-alive state where the process runs but no responses are
# sent. With abort, any panic kills the process immediately and Claude Code
# triggers a clean reconnect via `/mcp`. (BUG-021 investigation, 2026-03-03)
panic = "abort"

[dev-dependencies]
tempfile = "3"
tower = "0.5"
filetime = "0.2"
mockito = "1"
tokio = { version = "1", features = ["test-util"] }
assert_cmd = "2"
predicates = "3"
serial_test = "3.4.0"