π¦
Fcp Rust
MCP server for Rust codebases via rust-analyzer
0 installs
Trust: 34 β Low
Comms
Ask AI about Fcp Rust
Powered by Claude Β· Grounded in docs
I know everything about Fcp Rust. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
fcp-rust
MCP server for Rust codebases via rust-analyzer.
What It Does
fcp-rust lets LLMs navigate, inspect, and refactor Rust code through intent-level commands. Instead of reading raw source files, the LLM sends operations like find Config @kind:struct or rename old_name new_name @file:main.rs and fcp-rust routes them through rust-analyzer's LSP for accurate, project-aware results. Built on the FCP framework.
Written in Rust using rmcp for MCP transport and rust-analyzer as the language intelligence backend.
Quick Example
rust_session('open /path/to/my-project')
rust_query('find Config @kind:struct')
rust_query('refs Config @file:main.rs')
rust_query('diagnose')
rust([
'rename old_handler handle_request @file:routes.rs',
'generate Display @struct:Config',
])
rust_query('map')
Available MCP Tools
| Tool | Purpose |
|---|---|
rust(ops) | Batch mutations β rename, extract, inline, generate, import |
rust_query(q) | Inspect the codebase β find, def, refs, symbols, diagnose, map |
rust_session(action) | Lifecycle β open, status, close |
rust_help() | Full reference card |
enrich(path) | Extract diagnostics and symbols from a single .rs file (no session required) |
Verb Reference β Navigation
| Verb | Syntax |
|---|---|
find | find QUERY [kind:KIND] [@selectors...] |
def | def SYMBOL [@selectors...] |
refs | refs SYMBOL [@selectors...] |
symbols | symbols PATH [kind:KIND] |
impl | impl SYMBOL [@selectors...] |
Verb Reference β Inspection
| Verb | Syntax |
|---|---|
diagnose | diagnose [PATH] [@all] |
inspect | inspect SYMBOL [@selectors...] |
callers | callers SYMBOL [@selectors...] |
callees | callees SYMBOL [@selectors...] |
map | map |
unused | unused [@file:PATH] |
Verb Reference β Mutation
| Verb | Syntax |
|---|---|
rename | rename SYMBOL NEW_NAME [@selectors...] |
extract | extract FUNC_NAME @file:PATH @lines:N-M |
inline | inline SYMBOL [@selectors...] |
generate | generate TRAIT @struct:NAME |
import | import SYMBOL @file:PATH @line:N |
Verb Reference β Session
| Verb | Syntax |
|---|---|
open | open PATH |
status | status |
close | close |
Selectors
@file:PATH Filter by file path substring
@struct:NAME Filter by containing struct
@trait:NAME Filter by containing trait
@kind:KIND Filter by symbol kind (function, struct, enum, etc.)
@module:NAME Filter by module name
@line:N Filter by exact line number
@lines:N-M Line range (for extract)
Installation
Build from source
cargo install --git https://github.com/os-tack/fcp-rust
MCP Client Configuration
{
"mcpServers": {
"fcp-rust": {
"command": "fcp-rust"
}
}
}
Architecture
src/main.rs MCP server β 4 tools, stdio transport
β
src/mcp/ MCP integration
βββ server.rs RustServer (rmcp tool handlers)
βββ params.rs Request/response types
β
src/domain/ Domain layer
βββ verbs.rs Verb registration (query + mutation + session)
βββ model.rs RustModel (workspace state, LSP client, symbol index)
βββ query.rs Query handlers (find, def, refs, diagnose, map, etc.)
βββ mutation.rs Mutation handlers (rename, extract, inline, generate)
βββ format.rs Output formatting
β
src/resolver/ Symbol resolution
βββ selectors.rs @file, @struct, @trait, @kind, @module, @line, @lines
βββ index.rs In-memory SymbolIndex
βββ pipeline.rs Multi-tier resolution (index β LSP β tree-walk)
βββ fuzzy.rs Fuzzy matching
β
src/lsp/ rust-analyzer integration
βββ client.rs JSON-RPC client
βββ transport.rs stdio transport
βββ types.rs LSP type definitions
βββ workspace_edit.rs Apply edits to disk
βββ lifecycle.rs Server lifecycle management
β
src/fcpcore/ FCP framework (Rust port)
βββ tokenizer.rs DSL tokenizer
βββ parsed_op.rs Operation parser
βββ verb_registry.rs Verb spec registry + reference card
βββ event_log.rs Event sourcing (undo/redo)
βββ session.rs Session lifecycle
βββ formatter.rs Response formatter
Development
cargo test # Run all tests
cargo build # Build binary
cargo clippy # Run lints
License
MIT
