Skip to content

cezarbbb/ra-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ra-mcp

rust-analyzer MCP Server - Rust code intelligence for AI assistants.

Why ra-mcp?

Beyond standard LSP features, ra-mcp provides:

Feature Description
Macro Expansion ra_expand_macro to analyze macro output, ra_view_hir for IR inspection
Symbol Index Build persistent index with ra_build_index, fast queries with ra_query_index
Concurrent Access Thread-safe design supports multiple AI agents simultaneously
Extended Analysis ra_runnables, ra_related_tests, ra_ssr structural search-replace
Test Relations ra_related_tests finds tests for any function

Installation

git clone https://github.com/your-org/ra-mcp.git
cd ra-mcp
cargo build --release

Configure in MCP client:

{
  "mcpServers": {
    "ra-mcp": {
      "command": "target/release/ra-mcp",
      "args": ["--workspace", "/path/to/rust/project"]
    }
  }
}

CLI Options

Argument Default
--workspace <PATH> Current directory
--log-level <LEVEL> info
--timeout <MS> 30000

Tools

Navigation

Tool Parameters
ra_hover file_path, line, character
ra_definition file_path, line, character
ra_type_definition file_path, line, character
ra_implementation file_path, line, character
ra_references file_path, line, character, include_declaration?
ra_call_hierarchy file_path, line, character
ra_parent_module file_path, line, character

Intellisense

Tool Parameters
ra_completion file_path, line, character
ra_signature_help file_path, line, character
ra_inlay_hints file_path, start_line, start_character, end_line, end_character

Symbols

Tool Parameters
ra_document_symbols file_path, limit?, kind?
ra_outline file_path
ra_find file_path, query, kind?, limit?
ra_workspace_symbols query, kind?, limit?

Refactoring

Tool Parameters
ra_rename file_path, line, character, new_name
ra_code_actions file_path, start_line, start_character, end_line, end_character

Diagnostics

Tool Parameters
ra_diagnostics file_path
ra_workspace_diagnostics -

rust-analyzer Extensions

Tool Parameters
ra_expand_macro file_path, line, character
ra_runnables file_path, line?, character?
ra_related_tests file_path, line, character
ra_open_docs file_path, line, character
ra_ssr query, parse_only?
ra_syntax_tree file_path
ra_view_hir file_path, line, character
ra_crate_graph full?

Index Management

Tool Parameters
ra_build_index -
ra_query_index query, kind?, limit?
ra_clear_index -

SymbolKind Values

file, module, namespace, package, class, method, property, field, constructor, enum, interface, function, variable, constant, struct, enum_member, trait, type_parameter, operator, event

License

MIT

About

rust-analyzer MCP Server - Rust code intelligence for AI assistants.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages