The rustytokens stdio MCP smoke test fails after updating to the latest version. The index_create tool runs without error, but search_text immediately after returns an error saying no index was found.
Reproduction
Clone rustytokens
Build: cargo build --release
Run the MCP server with a temporary workspace containing a Python file
Call rustytokens__index_create with the workspace path
Call rustytokens__search_text with the same path - returns error: no index found
Expected behavior
search_text should find results after a successful index_create.
Actual behavior
error: no index found for .. Run `rustytokens index create <path>` first.
Environment
rustytokens: latest from main (post v0.1.0)
Python: 3.13.11
ctags: Universal Ctags
Root cause analysis
The MCP server has two different ways of resolving project paths:
Tool arguments: index_create and index_update accept a path argument from the tool call (Path::new(req_str(args, "path", name)?))
CLI parameter: search_text and other search tools use the project parameter from the CLI's --project argument (&cli.project)
When rustytokens serve is called without --project, it defaults to . (current working directory). If index_create is called with a different path (e.g., /tmp/test_ws), the index is created with a key derived from /tmp/test_ws, but search_text looks for an index with a key derived from ..
The project_db_path function uses xxh3 to generate a key from the canonicalized path:
letkey=project_key(&canon.to_string_lossy());
So /tmp/test_ws and . produce different keys → different database files → "no index found" error.
Proposed fix
Either:
Add an optional path argument to search_text (like codebase_detect) that overrides the CLI project
Have the MCP server remember the last indexed project and use it for subsequent searches
Always pass the path from index_create to subsequent search calls
## Issue
The rustytokens stdio MCP smoke test fails after updating to the latest version. The `index_create` tool runs without error, but `search_text` immediately after returns an error saying no index was found.
## Reproduction
1. Clone rustytokens
2. Build: `cargo build --release`
3. Run the MCP server with a temporary workspace containing a Python file
4. Call `rustytokens__index_create` with the workspace path
5. Call `rustytokens__search_text` with the same path - returns `error: no index found`
## Expected behavior
`search_text` should find results after a successful `index_create`.
## Actual behavior
```
error: no index found for .. Run `rustytokens index create <path>` first.
```
## Environment
- rustytokens: latest from main (post v0.1.0)
- Python: 3.13.11
- ctags: Universal Ctags
## Root cause analysis
The MCP server has two different ways of resolving project paths:
1. **Tool arguments**: `index_create` and `index_update` accept a `path` argument from the tool call (`Path::new(req_str(args, "path", name)?)`)
2. **CLI parameter**: `search_text` and other search tools use the `project` parameter from the CLI's `--project` argument (`&cli.project`)
When `rustytokens serve` is called without `--project`, it defaults to `.` (current working directory). If `index_create` is called with a different path (e.g., `/tmp/test_ws`), the index is created with a key derived from `/tmp/test_ws`, but `search_text` looks for an index with a key derived from `.`.
The `project_db_path` function uses `xxh3` to generate a key from the canonicalized path:
```rust
let key = project_key(&canon.to_string_lossy());
```
So `/tmp/test_ws` and `.` produce different keys → different database files → "no index found" error.
## Proposed fix
Either:
1. Add an optional `path` argument to `search_text` (like `codebase_detect`) that overrides the CLI project
2. Have the MCP server remember the last indexed project and use it for subsequent searches
3. Always pass the `path` from `index_create` to subsequent search calls
## Test code reference
`tests/test_rustytokens_smoke.py::test_rustytokens_stdio_index_and_search`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Issue
The rustytokens stdio MCP smoke test fails after updating to the latest version. The
index_createtool runs without error, butsearch_textimmediately after returns an error saying no index was found.Reproduction
cargo build --releaserustytokens__index_createwith the workspace pathrustytokens__search_textwith the same path - returnserror: no index foundExpected behavior
search_textshould find results after a successfulindex_create.Actual behavior
Environment
Root cause analysis
The MCP server has two different ways of resolving project paths:
index_createandindex_updateaccept apathargument from the tool call (Path::new(req_str(args, "path", name)?))search_textand other search tools use theprojectparameter from the CLI's--projectargument (&cli.project)When
rustytokens serveis called without--project, it defaults to.(current working directory). Ifindex_createis called with a different path (e.g.,/tmp/test_ws), the index is created with a key derived from/tmp/test_ws, butsearch_textlooks for an index with a key derived from..The
project_db_pathfunction usesxxh3to generate a key from the canonicalized path:So
/tmp/test_wsand.produce different keys → different database files → "no index found" error.Proposed fix
Either:
pathargument tosearch_text(likecodebase_detect) that overrides the CLI projectpathfromindex_createto subsequent search callsTest code reference
tests/test_rustytokens_smoke.py::test_rustytokens_stdio_index_and_search