eggsearch/lib.rs
1//! eggsearch: a lightweight MCP (Model Context Protocol) metasearch
2//! server for AI agents.
3//!
4//! This crate is a single binary. Its submodules are:
5//!
6//! - [`core`]: source card model, config, error, query types.
7//! - [`meta`]: metasearch adapter with vendored search engines.
8//! - [`mcp`]: MCP server (rmcp) exposing `web_search`,
9//! `web_fetch`, and `provider_status` tools.
10//!
11//! The `mock` feature exposes the test-only mock engine harness used by
12//! the integration tests.
13//!
14//! # Example
15//!
16//! Construct and validate a [`core::WebSearchRequest`] the same way the
17//! MCP `web_search` tool does:
18//!
19//! ```
20//! use eggsearch::core::WebSearchRequest;
21//!
22//! let mut req = WebSearchRequest::new("rust axum middleware");
23//! req.max_results = Some(5);
24//! req.providers = vec!["duckduckgo".to_string(), "brave".to_string()];
25//! req.validate(512).expect("request is valid");
26//! ```
27
28#![warn(missing_docs)]
29
30pub mod core;
31pub mod fetch;
32pub mod mcp;
33pub mod meta;