Conversation
There was a problem hiding this comment.
Pull request overview
Adds automatic workspace root detection for the Rust MCP server by querying the MCP client’s roots/list after initialization, so tool commands can run in the project directory without requiring --workspace.
Changes:
- Introduce
src/workspace.rsto detect a Cargo workspace viaroots/listand apply the detected root to executed commands. - Refactor workspace root storage from
StringtoPathBufand wire detection into server initialization. - Add
percent-encoding(URI decoding) and enable Tokio’stimefeature for detection timeouts.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/workspace.rs |
New workspace auto-detection logic + URI-to-path conversion + unit tests. |
src/rmcp_server.rs |
Triggers workspace detection in on_initialized behind a flag. |
src/main.rs |
Enables detection when --workspace isn’t provided and passes flag to server. |
src/globals.rs |
Stores workspace root as PathBuf and adds try_set_workspace_root. |
src/command.rs |
Applies workspace root from the new workspace module before running commands. |
src/tools/mod.rs |
Stops re-exporting apply_workspace_root (now in workspace). |
src/tools/cargo/doc.rs |
Updates path joining to use PathBuf root directly. |
Cargo.toml |
Adds percent-encoding; enables tokio time feature. |
Cargo.lock |
Records dependency graph changes (includes broad upgrades). |
.vscode/mcp.json |
Adjusts local dev config args (log level). |
.github/copilot-instructions.md |
Updates repo Copilot guidance text. |
.github/agents/rust-docs.agent.md |
Adds a rust-docs agent definition. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solves issue #106 for supported IDEs. It uses roots/list request to find out cwd for current project. The detection runs only once when MCP server is initialized.
the fix works for VS Code, doesn't work for Zed though - zed-industries/zed#53156