feat: add local agent MCP tools and optional source-grounded AI answers
Core CI / core (ubuntu-latest) (push) Failing after 3m6s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 5m41s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s

This commit is contained in:
karl committed 2026-10-12 20:28:38 +02:00
1 parent 70746ef428
commit f5b03c6fb0
27 files changed
+2988 -13

No files matched your search

+21
View File
@@ -7,6 +7,7 @@ use clap::{Parser, Subcommand};
use searchi_core::metrics::{MetricsMode, SearchResponse, TraceCollector};
use searchi_core::{IndexOptions, SearchIndex, SearchOptions};
use searchi_service::HybridSearch;
mod mcp;
#[derive(Debug, Parser)]
#[command(name = "searchi", version, about = "Search your local files offline")]
@@ -17,6 +18,17 @@ struct Cli {
#[derive(Debug, Subcommand)]
enum Command {
/// Serve read-only local agent tools over MCP stdio (no HTTP listener).
Mcp {
#[arg(long)]
db: PathBuf,
#[arg(long, requires = "embedding_worker")]
model_dir: Option<PathBuf>,
#[arg(long, requires = "model_dir")]
embedding_worker: Option<PathBuf>,
#[arg(long,default_value_t=1,value_parser=clap::value_parser!(u8).range(1..=8))]
cpu_threads: u8,
},
/// Set up the required Google model in the default local cache.
Setup {
/// Override the platform-local model cache directory.
@@ -112,6 +124,15 @@ enum Command {
fn main() -> Result<()> {
match Cli::parse().command {
Command::Mcp {
db,
model_dir,
embedding_worker,
cpu_threads,
} => {
require_existing_index(&db)?;
mcp::serve(db, model_dir, embedding_worker, usize::from(cpu_threads))?;
}
Command::Setup { model_dir } => {
let directory = model_dir
.map(Ok)