# Midnight Manual ## docs - [Add to your AI client](/docs/add-to-ai-client.md): mnm mcp serve speaks MCP (JSON-RPC 2.0) over stdio. One command wires it into your assistant as an MCP tool. Prefer HTTP? See Serving over HTTP below. - [Configuration](/docs/cli/configuration.md): The mnm config file, environment variables, and config show --effective. - [Models](/docs/cli/models.md): mnm models — inspect the corpus's active embedding model and understand VoyageAI remote processing. - [CLI overview](/docs/cli/overview.md): The mnm CLI command map, global flags, and scripting with --json. - [Reading content](/docs/cli/reading.md): mnm chunks and mnm documents — follow neighbours, size a document, and read window by window. - [Searching with mnm search](/docs/cli/searching.md): mnm search — query modes, filters, reranking, and machine-readable output. - [Skills and telemetry](/docs/cli/skills-telemetry.md): mnm skills add — install the advanced-search skill; mnm telemetry — opt out of usage tracking. - [Confidence = trust × relevance](/docs/concepts/confidence.md): How Midnight Manual blends source trust with retrieval relevance into a confidence score, and the per-factor breakdown it returns. - [Hybrid retrieval & RRF](/docs/concepts/hybrid-retrieval.md): How Midnight Manual fuses lexical and semantic candidate lists with Reciprocal Rank Fusion to catch both exact-term and conceptual matches. - [Models](/docs/concepts/models.md): The VoyageAI embedding and reranking models used by Midnight Manual — what they are, where they run, and how to bring your own key. - [Multi-query & HyDE](/docs/concepts/multi-query-hyde.md): How advanced_search fuses multiple query formulations with RRF to improve recall — including hypothetical document embeddings and step-back rephrases. - [The smart chunker](/docs/concepts/smart-chunker.md): How Midnight Manual splits Markdown and source code into semantically-bounded, attributable chunks. - [Your first search](/docs/first-search.md): Once mnm is installed, you can search the Midnight corpus from your terminal without any client setup: - [Install mnm](/docs/install.md): Prebuilt binaries are available for macOS (Apple silicon) and Linux (x86-64 + aarch64, gnu). Windows is served via WSL (it runs the Linux build); Intel macOS and musl are out of scope. Building from source requires a Rust toolchain (1.93+). - [Introduction](/docs/intro.md): midnight-manual is a retrieval engine for the Midnight Network. It gives your AI assistant live search over the real Midnight docs and source code, and every result points to the exact doc or source file it came from. - [The Advanced Search skill](/docs/mcp/advanced-search-skill.md): What the midnight-advanced-search skill teaches, how to install it, and which AI harnesses it supports. - [Corpus and diagnostics](/docs/mcp/corpus-diagnostics.md): The status, list_sources, and facets tools for inspecting the corpus and checking service health. - [How the MCP server works](/docs/mcp/how-it-works.md): What the Midnight Manual MCP server is, what it exposes, and how its hybrid retrieval and reranking work. - [Rate limits](/docs/mcp/rate-limits.md): Tiers, the uplift mechanism, response headers, and checking your current rate-limit state. - [Reading a hit in context](/docs/mcp/reading-in-context.md): The seven tools for walking from a search hit to its surrounding text — get_chunks, get_chunk_next/prev/neighbors/parents, get_document, get_document_chunks. - [Searching the corpus](/docs/mcp/searching.md): The search and advanced_search tools — query modes, filters, code_mode, and what each result contains. - [Privacy & telemetry](/docs/privacy.md): What midnight-manual collects, what it never touches, how to opt out, and how the canary test enforces those promises. - [CLI reference](/docs/reference/cli.md): The mnm CLI (also installed as midnight-manual) is the command-line interface to the Midnight Manual corpus. This page documents the everyday subcommand tree, sourced from crates/midnight-manual/src/cli.rs and crates/midnight-manual/src/commands/. Operator and admin commands for running your own server are documented in Operator & admin reference. - [Configuration reference](/docs/reference/configuration.md): Configuration resolves in a fixed precedence order: command-line flag › environment variable › config file › compiled-in default. You can override anything at any layer without touching the others. - [Embeddings and third-party processing](/docs/reference/embeddings.md): Telemetry is the easy half of the privacy story: it carries no content at all. Embedding is the harder half, because a search query is content, and turning it into a vector means a model has to read it. This page documents exactly where your text goes. - [MCP tools reference](/docs/reference/mcp-tools.md): The Midnight Manual MCP server exposes 13 tools across four categories. This page documents each tool's purpose, input parameters, and output shape, sourced directly from crates/mnm-mcp/src/tools.rs. - [Building from source](/docs/self-hosting/building-from-source.md): Build the midnight-manual CLI and cloud-server binaries from a checkout with cargo, including the optional Cargo features that gate Compact chunking and the tree-sitter language grammars. - [Cloud server & deploy](/docs/self-hosting/cloud-server.md): Architecture and full provisioning runbook for midnight-manual-server on Fly.io — Postgres, secrets, OAuth, VoyageAI, and first deploy. - [Ingestion pipeline](/docs/self-hosting/ingestion-pipeline.md): How content moves from a manifest through chunking, embedding, and atomic promotion into the live corpus. - [Manifests](/docs/self-hosting/manifests.md): What a hierarchy.yaml manifest is, how to author one, and how to use mnm manifest init / generate / check to build and validate manifests. - [Operator & admin reference](/docs/self-hosting/operator-reference.md): The admin-only mnm subcommands and operator config keys for running your own server — keys, users, login, ingest, ratelimits, tokenlimits, and server-side settings. - [Running an ingest](/docs/self-hosting/running-an-ingest.md): How to use mnm ingest plan and mnm ingest run to get content into your corpus, with worked examples for docs sites and code repos. - [Users & access](/docs/self-hosting/users-access.md): How Midnight Manual manages admin principals — Ed25519 keypairs, the user store TOML, nonce-signed JWT authentication, and the mnm keys / users / login commands. - [Versions & rate limits](/docs/self-hosting/versions-rate-limits.md): How to inspect, roll back, and retire source versions, and how to manage per-CIDR rate-limit overrides with mnm versions and mnm ratelimits. - [When to self-host](/docs/self-hosting/when-to-self-host.md): How the hosted Midnight Manual instance compares to running your own, and when it makes sense to operate your own server.