Skip to main content

Args

Struct Args 

Source
pub struct Args {
Show 25 fields pub memory_file: Option<String>, pub transport: Transport, pub bind: String, pub log_level: String, pub auth_token: Option<String>, pub auth_token_file: Option<String>, pub mmap_size: i64, pub page_size: i64, pub cache_size_mb: i64, pub busy_timeout_ms: u64, pub wal_flush_ms: u64, pub lru_cache_size: usize, pub read_pool_size: usize, pub tls_cert: Option<String>, pub tls_key: Option<String>, pub vectors: bool, pub embedding_dims: u32, pub vec_metric: VecMetric, pub vec_quantization: VecQuant, pub vec_connectivity: usize, pub vec_expansion_add: usize, pub vec_expansion_search: usize, pub vec_index: VecIndex, pub ivf_nlist: usize, pub ivf_nprobe: usize,
}

Fields§

§memory_file: Option<String>

Path to the memory file

§transport: Transport

Transport to listen on: stdio, tcp, or http

§bind: String

Address to bind for the tcp and http transports

§log_level: String

Log level

§auth_token: Option<String>

Bearer token required on the tcp (first line) and http (Authorization header) transports. Overrides --auth-token-file and the MCP_MEMORY_AUTH_TOKEN env var. stdio is never authenticated.

§auth_token_file: Option<String>

Path to a file whose trimmed contents are the bearer token. An empty file is rejected (fail closed). Ignored if --auth-token is set.

§mmap_size: i64

SQLite mmap size in bytes (default: 256 MiB).

§page_size: i64

SQLite page size in bytes; power of two (default: 4096, matches the Linux page / filesystem block size). Only applies to a freshly-created database.

§cache_size_mb: i64

SQLite page cache size in MiB (default: 50).

§busy_timeout_ms: u64

SQLite busy timeout in milliseconds (default: 5000).

§wal_flush_ms: u64

Interval in milliseconds for a background wal_checkpoint(PASSIVE) that bounds the durability window in async mode (default: 250). 0 disables it.

§lru_cache_size: usize

Entity-metadata LRU cache capacity (0 falls back to 10000).

§read_pool_size: usize

Number of read-only SQLite connections backing concurrent reads. WAL mode allows readers to run in parallel with each other and the single writer; a larger pool raises read concurrency at the cost of a little memory (each connection carries its own page cache). 0 (default) auto-scales to the CPU count, clamped to [1, 32].

§tls_cert: Option<String>

Path to a PEM certificate chain to serve the http transport over TLS (HTTPS). Requires –tls-key. Falls back to the MCP_TLS_CERT env var. When unset, the http transport stays plaintext.

§tls_key: Option<String>

Path to the PEM private key matching –tls-cert. Falls back to the MCP_TLS_KEY env var.

§vectors: bool

Enable vector / semantic search: exposes the vector_* and hybrid_search tools backed by a usearch HNSW index. Off by default (a pure knowledge-graph server). The --embedding-dims / --vec-* flags only take effect when this is set.

§embedding_dims: u32

Embedding dimension for vector search (default: 384). Requires –vectors.

§vec_metric: VecMetric

Distance metric for the vector index. Requires –vectors.

§vec_quantization: VecQuant

Scalar quantization for the vector index (lower = less memory). Requires –vectors.

§vec_connectivity: usize

HNSW graph degree M (higher = better recall, more memory). Requires –vectors.

§vec_expansion_add: usize

HNSW efConstruction (higher = better index quality, slower inserts). Requires –vectors.

§vec_expansion_search: usize

HNSW efSearch (higher = better recall, slower queries). Requires –vectors.

§vec_index: VecIndex

ANN index backend: hnsw (default) or ivf (IVF-Flat). Requires –vectors.

§ivf_nlist: usize

IVF: number of Voronoi cells / centroids (default: 256). Requires –vec-index ivf.

§ivf_nprobe: usize

IVF: cells probed per query — higher = better recall, slower (default: 8). Requires –vec-index ivf.

Implementations§

Source§

impl Args

Source

pub fn vector_config(&self) -> VectorConfig

Build the vector index configuration from the --embedding-dims / --vec-* / --ivf-* flags. Only meaningful when --vectors is set.

Trait Implementations§

Source§

impl Args for Args

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl CommandFactory for Args

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Args

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Args

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Args

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnsafeUnpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more