-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Summary
Add minimal heuristics to prevent spawning LSP servers in projects where they're not applicable. This prevents the MCP server from exposing useless tools.
Context
Related discussion: #34 (comment)
When servers spawn outside their relevant project contexts (e.g., rust-analyzer in a Python project), they create noise and expose tools that can't be used.
Proposed Solution
Implement server-specific heuristics in spawn_batch() to check for project markers before spawning:
fn should_spawn_server(name: &str, config: &ServerConfig) -> bool {
match name {
"rust-analyzer" => Path::new("Cargo.toml").exists(),
"pyright" => Path::new("pyproject.toml").exists() || Path::new("setup.py").exists(),
_ => true // unknown servers get a chance
}
}Implementation Considerations
- Check markers from workspace root
- Graceful fallback for unknown servers (allow them)
- Document which servers have heuristics
- Add tests for heuristic logic
Related Issues
- Fixes Don't require rust-analyzer #32 (graceful degradation)
- Related to Phase 5 of PR Issue #32: Implement graceful LSP server degradation #34
esafak
Metadata
Metadata
Assignees
Labels
No labels