Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ cargo install rust-docs-mcp
- Rust nightly toolchain (for Rustdoc JSON generation)

```bash
rustup toolchain install nightly
rustup toolchain install nightly-2026-05-22
```

Runtime prefers `nightly-2025-06-24` because it matches the rustdoc JSON
schema used by `rustdoc-types`, but it will fall back to `nightly` when that
toolchain produces the same JSON format version. You can override the choice
with:
Runtime prefers `nightly-2026-05-22`, which provides rustc
`1.97.0-nightly (e96c36b6f 2026-05-21)`, so documentation generation can
compile modern crates. The `rustdoc-types` dependency is kept in sync with
that rustdoc JSON format. You can override the choice with:

```bash
export RUST_DOCS_MCP_TOOLCHAIN=nightly
Expand Down
2 changes: 1 addition & 1 deletion rust-docs-mcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ flate2 = "1.0"
futures = "0.3"
git2 = "0.20"
reqwest = { version = "0.12", features = ["json", "stream"] }
rustdoc-types = { version = "0.53.0", features = ["rustc-hash"] }
rustdoc-types = { version = "0.57.3", features = ["rustc-hash"] }
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
5 changes: 2 additions & 3 deletions rust-docs-mcp/src/docs/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ pub fn build_item_info(crate_data: &Crate, id: &Id, item: &Item) -> Option<ItemI
// crate's `paths` map for items (e.g. impl blocks) that don't store one.
let name = if let Some(name) = &item.name {
name.clone()
} else if let Some(path_summary) = crate_data.paths.get(id) {
path_summary.path.last()?.clone()
} else {
return None;
let path_summary = crate_data.paths.get(id)?;
path_summary.path.last()?.clone()
};

Some(ItemInfo {
Expand Down
7 changes: 4 additions & 3 deletions rust-docs-mcp/src/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use std::sync::OnceLock;
use std::time::Duration;
use tokio::process::Command as TokioCommand;

/// Preferred nightly toolchain version known to match `rustdoc-types`.
pub const PREFERRED_TOOLCHAIN: &str = "nightly-2025-06-24";
/// Preferred nightly toolchain. Keep this new enough to compile modern crates
/// and keep `rustdoc-types` in sync with its rustdoc JSON format.
pub const PREFERRED_TOOLCHAIN: &str = "nightly-2026-05-22";

/// Fallback nightly alias to try when the preferred dated toolchain is unavailable.
pub const FALLBACK_TOOLCHAIN: &str = "nightly";
Expand Down Expand Up @@ -156,7 +157,7 @@ fn is_missing_toolchain_error(stderr: &str, toolchain: &str) -> bool {
// Extract toolchain name from rustup's error format: 'toolchain-name'
// Then check it matches our query, allowing for an architecture suffix
// (e.g., "nightly" -> "nightly-aarch64-apple-darwin") but not a date suffix
// (e.g., "nightly" should NOT match "nightly-2025-06-24-aarch64-apple-darwin")
// (e.g., "nightly" should NOT match "nightly-2026-05-22-aarch64-apple-darwin")
stderr.split('\'').nth(1).is_some_and(|name| {
name == toolchain
|| name
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-06-24"
channel = "nightly-2026-05-22"
components = ["rustfmt", "clippy", "rust-src", "rust-docs-json"]