Get the FREE Ultimate OpenClaw Setup Guide →

narsil

Rust MCP server for comprehensive code intelligence - 90 tools, 32 languages, security scanning, call graphs, and more

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio postrv-narsil-mcp npx -y narsil-mcp \
  --env NARSIL_MCP_CONFIG="path/to/config.json (optional)" \
  --env NARSIL_MCP_LOG_LEVEL="info (or desired log level)"

How to use

narsil-mcp is a Rust-powered MCP server that provides deep code intelligence through a suite of tools and analyses. It exposes a broad set of capabilities including symbol extraction, semantic code search, call graph construction, taint analysis, vulnerability scanning, SBOM generation, license compliance checks, and data/control flow analysis. It also supports neural embeddings for semantic search via Voyage AI or OpenAI, and can run in a local, privacy-first environment without sending data to external services. To run narsil-mcp via the MCP protocol, you can install and start the binary or use the MCP-compatible npx entry point as described in the installation notes. Once running, clients can query the server to index repositories, search for code patterns, inspect call graphs, and perform security and supply-chain analyses across languages supported by the server.

How to install

Prerequisites:

  • Rust 1.70 or later (for building from source)
  • Optional: Node.js and npm if you plan to use npm install method or npm-based tooling

Installation options:

  1. From Prebuilt Binaries (recommended for quick start)
  • Install narsil-mcp via your preferred package manager per the README (macOS/Linux/Homebrew, Windows with Scoop, Arch with AUR, or npm/pnpm/yarn):

  • Examples:

    • macOS/Linux (Homebrew): brew tap postrv/narsil brew install narsil-mcp
    • Windows (Scoop): scoop bucket add narsil https://github.com/postrv/scoop-narsil scoop install narsil-mcp
    • npm (cross-platform): npm install -g narsil-mcp
  1. From Source (build from GitHub) Prerequisites:
  • Rust 1.70+ (and on Windows, Visual Studio Build Tools for C++)
# Clone and build
git clone git@github.com:postrv/narsil-mcp.git
cd narsil-mcp
cargo build --release

# Run the binary (example path)
./target/release/narsil-mcp
  1. Using npm package (Node.js workflow) If you prefer using the npm package, install it globally and run as per the package documentation:
npm install -g narsil-mcp
narsil-mcp --help

Note: narsil-mcp also supports feature builds (graph, neural, neural-onnx, frontend, wasm) that tailor the binary for specific capabilities. When building from source, you can enable features like this:

cargo build --release --features graph,frontend

To use via npx (as described in the mcp_config example), ensure you have npm installed, then you can run the server with:

npx -y narsil-mcp

Prerequisites for development or advanced usage (optional):

  • Rust nightly not required for the default builds, but ensure your toolchain is up to date.
  • For browser/wasm usage, enable the wasm feature and build accordingly.

If you encounter issues related to graph features not being available, ensure you built the binary with the graph feature enabled and consult the Troubleshooting section in the repository.

Additional notes

Tips and common issues:

  • Privacy-first: narsil-mcp runs locally by default; no data should leave your machine unless you configure remote endpoints.
  • When enabling neural embeddings, you may need API keys for Voyage AI or OpenAI. Set credentials via environment variables or config files as described in the project docs.
  • Feature flags: enabling graph enables RDF knowledge graph, SPARQL queries, and CCG tools; enabling frontend includes an embedded visualization UI. If you pass --graph to a binary built without the feature, you’ll see a warning and tools may be unavailable.
  • For production deployments, consider building with graph and frontend for full functionality, and run under a process manager to ensure reliability.
  • Environment variables to consider: NARSIL_MCP_LOG_LEVEL, NARSIL_MCP_CONFIG for custom config paths, and any API keys required for neural or embedding services.

Related MCP Servers

Sponsor this space

Reach thousands of developers