Rust MCP server for comprehensive code intelligence - 90 tools, 32 languages, security scanning, call graphs, and more
Rust MCP server for comprehensive code intelligence - 90 tools, 32 languages, security scanning, call graphs, and more
The blazing-fast, privacy-first MCP server for deep code intelligence A Rust-powered MCP (Model Context Protocol) server providing AI assistants with deep code understanding through 90 specialized tools.
| Feature | narsil-mcp | XRAY | Serena | GitHub MCP |
|---|---|---|---|---|
| Languages | 32 | 4 | 30+ (LSP) | N/A |
| Neural Search | Yes | No | No | No |
| Taint Analysis | Yes | No | No | No |
| SBOM/Licenses | Yes | No | No | Partial |
| Offline/Local | Yes | Yes | Yes | No |
| WASM/Browser | Yes | No | No | No |
| Call Graphs | Yes | Partial | No | No |
| Type Inference | Yes | No | No | No |
| Language | Extensions | Symbols Extracted |
|---|---|---|
| Rust | .rs |
functions, structs, enums, traits, impls, mods |
| Python | .py, .pyi |
functions, classes |
| JavaScript | .js, .jsx, .mjs |
functions, classes, methods, variables |
| TypeScript | .ts, .tsx |
functions, classes, interfaces, types, enums |
| Go | .go |
functions, methods, types |
| C | .c, .h |
functions, structs, enums, typedefs |
| C++ | .cpp, .cc, .hpp |
functions, classes, structs, namespaces |
| Java | .java |
methods, classes, interfaces, enums |
| C# | .cs |
methods, classes, interfaces, structs, enums, delegates, namespaces |
| Bash | .sh, .bash, .zsh |
functions, variables |
| Ruby | .rb, .rake, .gemspec |
methods, classes, modules |
| Kotlin | .kt, .kts |
functions, classes, objects, interfaces |
| PHP | .php, .phtml |
functions, methods, classes, interfaces, traits |
| Swift | .swift |
classes, structs, enums, protocols, functions |
| Verilog/SystemVerilog | .v, .vh, .sv, .svh |
modules, tasks, functions, interfaces, classes |
| Scala | .scala, .sc |
classes, objects, traits, functions, vals |
| Lua | .lua |
functions, methods |
| Haskell | .hs, .lhs |
functions, data types, type classes |
| Elixir | .ex, .exs |
modules, functions |
| Clojure | .clj, .cljs, .cljc, .edn |
lists (basic AST) |
| Dart | .dart |
functions, classes, methods |
| Julia | .jl |
functions, modules, structs |
| R | .R, .r, .Rmd |
functions |
| Perl | .pl, .pm, .t |
functions, packages |
| Zig | .zig |
functions, variables |
| Erlang | .erl, .hrl |
functions, modules, records |
| Elm | .elm |
functions, types |
| Fortran | .f90, .f95, .f03, .f08, .f, .for, .fpp |
programs, subroutines, functions, modules |
| PowerShell | .ps1, .psm1, .psd1 |
functions, classes, enums |
| Nix | .nix |
bindings |
| Groovy | .groovy, .gradle |
methods, classes, interfaces, enums, functions |
macOS / Linux (Homebrew):
brew tap postrv/narsil
brew install narsil-mcpWindows (Scoop):
scoop bucket add narsil https://github.com/postrv/scoop-narsil
scoop install narsil-mcpRust/Cargo (all platforms):
cargo install narsil-mcpNode.js/npm (all platforms):
npm install -g narsil-mcp
# or
yarn global add narsil-mcp
# or
pnpm add -g narsil-mcpNix:
# Run directly without installing
nix run github:postrv/narsil-mcp -- --repos ./my-project
# Install to profile
nix profile install github:postrv/narsil-mcp
# With web visualization frontend
nix profile install github:postrv/narsil-mcp#with-frontend
# Development shell
nix develop github:postrv/narsil-mcpmacOS / Linux:
curl -fsSL https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.ps1 | iexWindows (Git Bash / MSYS2):
curl -fsSL https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.sh | bashNote for Windows users: The PowerShell installer provides better error messages and native Windows integration. It will automatically configure your PATH and check for required build tools if building from source.
Prerequisites:
# Clone and build
git clone [email protected]:postrv/narsil-mcp.git
cd narsil-mcp
cargo build --release
# Binary will be at:
# - macOS/Linux: target/release/narsil-mcp
# - Windows: target/release/narsil-mcp.exenarsil-mcp supports different feature sets for different use cases:
…| Feature | Description | Size |
|---|---|---|
native (default) |
Full MCP server with all tools | ~30MB |
graph |
+ RDF knowledge graph, SPARQL, CCG tools | ~35MB |
frontend |
+ Embedded visualization web UI | ~31MB |
neural |
+ TF-IDF vector search, API embeddings | ~32MB |
neural-onnx |
+ Local ONNX model inference | ~50MB |
wasm |
Browser build (no file system, git) | ~3MB |
Important: The
--graphCLI flag requires the binary to be built with--features graph. If you pass--graphto a binary built without this feature, you'll see a warning and SPARQL/CCG tools won't be available. See Troubleshooting below.
For detailed installation instructions, troubleshooting, and platform-specific guides, see docs/INSTALL.md.
macOS / Linux:
# Index a single repository
narsil-mcp --repos /path/to/your/project
# Index multiple repositories
narsil-mcp --repos ~/projects/project1 --repos ~/projects/project2
# Enable verbose logging
narsil-mcp --repos /path/to/project --verbose
# Force re-index on startup
narsil-mcp --repos /path/to/project --reindexWindows (PowerShell / CMD):
# Index a single repository
narsil-mcp --repos C:\Users\YourName\Projects\my-project
# Index multiple repositories
narsil-mcp --repos C:\Projects\project1 --repos C:\Projects\project2
# Enable verbose logging
narsil-mcp --repos C:\Projects\my-project --verbose
# Force re-index on startup
narsil-mcp --repos C:\Projects\my-project --reindex…Note about
--graph: This flag enables SPARQL queries and Code Context Graph (CCG) tools, but only if the binary was built with--features graph. The default binary does not include this feature. If you need SPARQL/CCG capabilities, build from source with:cargo build --release --features graphIf you pass
--graphto a binary without the feature, you'll see a warning at startup and the server will continue without SPARQL/CCG tools.
Note: Neural embeddings require an API key (or custom endpoint). The easiest way to set this up is with the interactive wizard:
# Run the neural API key setup wizard
narsil-mcp config init --neuralThe wizard will:
Alternatively, you can manually set one of these environment variables:
EMBEDDING_API_KEY - Generic API key for any providerVOYAGE_API_KEY - Voyage AI specific API keyOPENAI_API_KEY - OpenAI specific API keyEMBEDDING_SERVER_ENDPOINT - Custom embedding API endpoint URL (optional, allows using self-hosted models)v1.1.0+ introduces optional configuration for fine-grained control over tools and performance. All existing usage continues to work - configuration is completely optional!
# Generate default config interactively
narsil-mcp config init
# List available tools
narsil-mcp tools list
# Apply a preset via CLI
narsil-mcp --repos ~/project --preset minimalnarsil-mcp detects your editor and applies an optimal preset automatically:
| Editor | Preset | Tools | Context Tokens | Why |
|---|---|---|---|---|
| Zed | Minimal | 26 | ~4,686 | Fast startup, minimal context |
| VS Code | Balanced | 51 | ~8,948 | Good feature balance |
| Claude Desktop | Full | 90 | ~12,001 | Maximum capabilities |
Token Savings:
Choose a preset based on your use case:
# Minimal - Fast, lightweight (Zed, Cursor)
narsil-mcp --repos ~/project --preset minimal
# Balanced - Good defaults (VS Code, IntelliJ)
narsil-mcp --repos ~/project --preset balanced --git --call-graph
# Full - All features (Claude Desktop, comprehensive analysis)
narsil-mcp --repos ~/project --preset full --git --call-graph
# Security-focused - Security and supply chain tools
narsil-mcp --repos ~/project --preset security-focusedUser config (~/.config/narsil-mcp/config.yaml):
version: "1.0"
preset: "balanced"
tools:
# Disable slow tools
overrides:
neural_search:
enabled: false
reason: "Too slow for interactive use"
performance:
max_tool_count: 50 # Limit total toolsProject config (.narsil.yaml in repo root):
version: "1.0"
preset: "security-focused" # Override user preset
tools:
categories:
Security:
enabled: true
SupplyChain:
enabled: trueNamed repository profiles are useful for multi-repo workspaces:
version: "1.0"
profiles:
platform:
repos:
- ~/src/api
- ~/src/web
git: true
call_graph: true
persist: true
preset: balancednarsil-mcp --profile platform
narsil-mcp config profilesPriority: CLI flags > Environment vars > Project config > User config > Defaults
# Select repos/profile
export NARSIL_REPOS=~/src/api,~/src/web
export NARSIL_PROFILE=platform
# Apply preset
export NARSIL_PRESET=minimal
# Enable specific categories
export NARSIL_ENABLED_CATEGORIES=Repository,Symbols,Search
# Disable specific tools
export NARSIL_DISABLED_TOOLS=neural_search,generate_sbom# View effective config
narsil-mcp config show
# Validate config file
narsil-mcp config validate ~/.config/narsil-mcp/config.yaml
# List tools by category
narsil-mcp tools list --category Search
# Search for tools
narsil-mcp tools search "git"
# Export config
narsil-mcp config export > my-config.yaml
# List nNo open issues yet, or sync has not completed.