Ferritin — Rust documentation

rs.ferritin由 ferritin.rs 發布官方發布者v2026.7.21更新於 Oct 24, 2026

Search and read Rust documentation for the standard library and any crate on crates.io

已驗證Streamable HTTP可網頁執行知識與記憶開發者工具

概覽

AI 產生的概覽

一個遠端 MCP 伺服器,讓助理查閱並搜尋 Rust 標準函式庫與 crates.io 各 crate 的文件。

可以做什麼
依路徑查詢某個 Rust 項目的文件,例如標準函式庫型別或某個 crate 的 trait,並在對話中回傳文件內容與簽章資訊。在指定 crate 的文件內搜尋符合的項目,或在不指定 crate 時搜尋,以找出該用哪個 crate。兩者合起來涵蓋常見流程:先找到合適的 crate,再直接閱讀特定項目的文件,不必離開助理。
適用情境
在撰寫或除錯 Rust 程式、希望助理核對 std 或 crates.io 上 crate 的真實 API 文件而非憑記憶回答時適用。也適合在多個 crate 之間做選擇,或尋找不知道確切路徑的項目。
執行需求
遠端 MCP 端點;未宣告需要本機安裝、帳號、API 金鑰或環境變數。助理需要能連上該端點的網路,伺服器會視需要從 docs.rs 取得 crate 文件。
安裝前請注意
此伺服器只做唯讀的文件查詢,但查詢內容與請求的項目路徑會傳送到第三方端點,crate 文件也從 docs.rs 取得,因此這些服務可見你的查詢。文件對應已發布的 crate 版本,可能落後於最新發行版。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ferritin — Rust documentation,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/rs.ferritin%2Frustdoc/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "ferritin-rust-documentation": {
      "type": "http",
      "url": "https://ferritin.rs/mcp"
    }
  }
}

README

🩸 Ferritin

[ci] [codecov] [crates.io version badge]

A terminal-based Rust documentation viewer

Ferritin reads rustdoc JSON output to display Rust documentation directly in your terminal. It supports local workspace crates, standard library documentation, and crates from crates.io, with search functionality and modern terminal features including mouse support, syntax highlighting, and clickable links.

Features

  • Interactive documentation browser with keyboard and mouse navigation
  • One-shot CLI for quick documentation lookups in the terminal
  • Search across crates or within specific crates
  • Works seamlessly across three contexts:
    • Local workspace crates (requires nightly toolchain)
    • Standard library (requires rust-docs-json rustup component)
    • Crates from crates.io (fetched from docs.rs on demand)
  • Modern terminal UI with features like italics, unicode box drawing, syntax highlighting, OSC8 hyperlinks, cursor changes in terminals that support it, and mouse hover previews
  • Fast navigation with history and breadcrumb trail

Installation

Prebuilt binary (recommended)

Prebuilt binaries skip compilation and are available for x86_64/aarch64 macOS, x86_64 Linux, and x86_64 Windows.

If you have cargo-binstall, it reads the release metadata and installs the right binary for your platform:

bash
cargo binstall ferritin

Otherwise, the installer scripts detect your platform, download the matching binary, and place it in ~/.cargo/bin:

macOS and Linux:

bash
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/jbr/ferritin/releases/download/ferritin-latest/ferritin-installer.sh | sh

Windows (PowerShell):

powershell
powershell -c "irm https://github.com/jbr/ferritin/releases/download/ferritin-latest/ferritin-installer.ps1 | iex"

Both of the above always install the most recent release. You can also pick a specific version or download archives directly from the releases page.

From source

To build from source (or for a platform without a prebuilt binary):

bash
cargo install ferritin

Optional: Standard library documentation

To view documentation for std, core, and alloc:

bash
rustup component add rust-docs-json

For local workspace documentation

Local crate documentation requires a nightly toolchain:

bash
rustup toolchain install nightly

Note: There is a relationship between ferritin's version and the nightly toolchain version. Ferritin supports a range of recent rustdoc JSON format versions, and if your nightly generates a newer format, ferritin will make a best effort at parsing it.

Usage

Interactive mode

Launch the interactive browser:

bash
ferritin -i

Once running, use h or ? to see available keybindings. Basic navigation:

  • g - go to an item by path (e.g., std::vec::Vec)
  • s - search (Tab to toggle between current crate and all crates)
  • l - list available crates
  • Arrow keys, j/k, or mouse to navigate
  • Click on links to follow them

CLI mode

View documentation for a specific item:

bash
ferritin get std::vec::Vecferritin get serde::Serialize

Search for items:

bash
ferritin search "hash map"ferritin search --crate tokio "spawn"

List available crates in your workspace:

bash
ferritin list

Output format

Ferritin auto-detects how to render: ANSI colors on a terminal, plain text when piped, and a compact markdown-flavored format under a coding agent. Override it with --format <tty|plain|agent|json>. --format json emits a structured representation — of the resolved item for get, or of the results for search/list — for scripting and programmatic consumers:

bash
ferritin get std::vec::Vec --format json

(The JSON shape is still settling as the library API evolves; a published JSON Schema is planned.)

Caching and Storage

Ferritin keeps its caches under a single directory — $FERRITIN_HOME if set, else $XDG_CACHE_HOME/ferritin, else ~/.cache/ferritin. Everything in it is reconstructible (fetched or derived), so it is always safe to delete:

  • Crates.io documentation: raw rustdoc JSON at docs/{crate}/{version}/{format-version}.json, with derived binary caches beside it (an rkyv archive for fast partial loads, and a .index file generated lazily on first search)
  • crates.io metadata: the crate-names artifacts (crate-names/) used for version resolution and typeahead, and per-crate version lookups (crates-io-versions/)
  • Standard library search indices: written to {rustc sysroot}/share/doc/rust/json/ if available
  • Local workspace documentation: built into the workspace's own target/doc/, not the shared cache

Earlier versions cached under $CARGO_HOME/rustdoc-json; a cache found there is migrated automatically on first run.

Environment Variables

VariableMeaning
FERRITIN_HOMECache root override (see above)
FERRITIN_THEMEDefault color theme (equivalent to --theme)
FERRITIN_CRATE_NAMES_URL, FERRITIN_CRATE_DESCRIPTIONS_URLOverride where the crate-names artifacts are fetched from (e.g. a mirror)

ferritin serve (the opt-in serve/acme features; not present in distributed binaries) is configured 12-factor style:

VariableMeaning
HOST, PORTBind address (:: binds dual-stack)
FERRITIN_CACHE_BYTESIn-memory crate-cache weight cap
FERRITIN_RSS_HIGH_WATER_BYTESRSS guard threshold (Linux only): shed cache weight when anonymous RSS exceeds it
FERRITIN_RATELIMITPer-client /api requests per minute
FERRITIN_ACME_DOMAINActivates automatic HTTPS via Let's Encrypt for this domain
FERRITIN_ACME_CACHE_DIRRequired with ACME: persists the account key and certificates
FERRITIN_ACME_CONTACTOptional ACME contact email
FERRITIN_ACME_PRODUCTIONUse the Let's Encrypt production directory (default: staging)

Development-only knobs (not part of the stable interface): FERRITIN_TEST_MODE (normalized snapshot-test output), FERRITIN_REINDEX (rebuild search indexes in memory, bypassing the disk cache), and the search-scoring probes FERRITIN_NAME_WEIGHT, FERRITIN_ANCESTOR_WEIGHTS, and FERRITIN_NAME_PREFIX_COUNT.

Current Status

Ferritin is at version 0.x and actively used by the author as a primary documentation interface. It's ready for general use, though the output format should be considered unstable and may change between versions.

If you're scripting against ferritin's output, be aware that the text format may change. Pin to a specific version or be prepared to update your scripts.

Platform Support

Ferritin is developed primarily on Unix-like systems and is also tested on Windows, where both the CLI and interactive TUI work (prebuilt x86_64 Windows binaries are provided). If you encounter issues on any platform, please open an issue or pull request.

Related Projects

Ferritin was originally developed to support the rustdoc-mcp MCP server, which provides Rust documentation access for Claude Code and other MCP clients.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

來源:README.md,提交 3770aa6

工具

2

get

Show documentation for a Rust item by path.

輸入參數path必填

版本歷史

1
  1. v2026.7.21最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分