https://github.com/himkt/pathfinder
📚 MCP client for jumping to definitions using LSP server for an arbitrary language
https://github.com/himkt/pathfinder
claude-code lsp mcp
Last synced: 30 days ago
JSON representation
📚 MCP client for jumping to definitions using LSP server for an arbitrary language
- Host: GitHub
- URL: https://github.com/himkt/pathfinder
- Owner: himkt
- License: mit
- Created: 2026-01-10T13:55:47.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-01-11T12:37:39.000Z (about 1 month ago)
- Last Synced: 2026-01-15T07:59:40.617Z (about 1 month ago)
- Topics: claude-code, lsp, mcp
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pathfinder MCP
Bridge MCP clients to LSP servers. Each pathfinder instance handles one LSP server.
## Build
```bash
cargo build --release
```
Binary at `target/release/pathfinder`.
## Usage
```bash
# Single extension
pathfinder -e py -s pyright-langserver -- --stdio
# Multiple extensions
pathfinder -e py -e pyi -s uv run pyright-langserver -- --stdio
# With workspace
pathfinder -e rs -s rust-analyzer -w /path/to/project
```
### Flags
- `-e, --extension ` - File extension (no dots, can repeat)
- `-s, --server ...` - LSP server command
- `-w, --workspace ` - Project directory (default: current dir)
## MCP Configuration
### Single Language
```json
{
"mcpServers": {
"pathfinder-python": {
"command": "/path/to/pathfinder",
"args": ["-e", "py", "-s", "pyright-langserver", "--", "--stdio"]
}
}
}
```
### Multiple Languages
Run separate instances:
```json
{
"mcpServers": {
"pathfinder-rust": {
"command": "/path/to/pathfinder",
"args": ["-e", "rs", "-s", "rust-analyzer"]
},
"pathfinder-ts": {
"command": "/path/to/pathfinder",
"args": ["-e", "ts", "-e", "tsx", "-s", "typescript-language-server", "--", "--stdio"]
}
}
}
```
## Tools
**definition** - Jump to definition via LSP `textDocument/definition`
Input: `{ uri: string, line: number, character: number }`
Returns: `[{ uri, range }]`
Automatically retries 3x with 150ms delay when LSP returns empty (handles indexing delays).
## Troubleshooting
- `LOG_LEVEL=debug` to see LSP traffic
- LSP timeout: 15 seconds
- Check LSP stderr for errors
- Debug logs show retry attempts
## Examples
```bash
# Python with uv
pathfinder -e py -e pyi -s uv run pyright-langserver -- --stdio
# TypeScript
pathfinder -e ts -e tsx -s typescript-language-server -- --stdio
# Rust
pathfinder -e rs -s rust-analyzer
# Go
pathfinder -e go -s gopls
```