Narsil

Developer toolsSecurity

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

Your AI app calls the Narsil MCP server, which does the developer tools and security work and sends the result back to the chat.

About Narsil

Narsil is a community MCP server from postrv, filed in our directory under developer tools and security. Rust MCP server for comprehensive code intelligence - 90 tools, 32 languages, security scanning, call graphs, and more.

At a glance

Publisher
postrv (community)
Runs
See the README for setup
Written in
Rust
License
Apache-2.0
GitHub stars
190

How to set up Narsil

  1. Follow the install steps in the Narsil README; it is written in Rust, so have that toolchain ready.
  2. Check the Narsil README for keys or settings; the registry lists none that Narsil requires.
  3. Add Narsil to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Narsil tools to confirm the connection.
  5. Run one read-only task with Narsil first, and keep your app asking before each tool call until the results look right.

Narsil compared with similar servers

  • Agent Lsp by blackwell-systems has fewer GitHub stars than Narsil (189 against 190); both are community servers, and both run locally.
  • Dynatrace by Dynatrace has fewer GitHub stars than Narsil (190 against 190); Dynatrace is official while Narsil is a community server, and both run locally.
  • Xclaude Plugin by conorluddy has fewer GitHub stars than Narsil (189 against 190); both are community servers, and both run locally.

Before you connect Narsil

  • Give Narsil its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Narsil tool call until you trust what it does with them.
  • Treat text that Narsil fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Narsil on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Narsil

How marketing and sales teams put Narsil to work, by company size. Pick the size closest to yours and start Narsil on one use case.

Small business

  • A small business with a developer can use Narsil to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Narsil to explain and fix a marketing site issue without context switching between tools.
  • A small business can use Narsil to check its domains, logins and site for common gaps before they cost a customer's trust.
  • Narsil runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Narsil to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Narsil to keep scripts and automations documented and versioned as they change.
  • Marketing ops can use Narsil to review what each connected app can access and remove keys nobody uses.
  • Start Narsil on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Narsil with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Narsil so web and marketing engineering share one reviewed way of working with AI.
  • Enterprises can run Narsil in the security team's tooling, so marketing's agents and apps are reviewed like any other system.
  • Narsil is a community server, so have security review the code and pin a version before Narsil touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Narsil README

From postrv/narsil-mcp on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

narsil-mcp

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.

Why narsil-mcp?

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

Key Features

  • Code Intelligence - Symbol extraction, semantic search, call graph analysis
  • Neural Semantic Search - Find similar code using embeddings (Voyage AI, OpenAI)
  • Security Analysis - Taint analysis, vulnerability scanning, OWASP/CWE coverage
  • Supply Chain Security - SBOM generation, dependency auditing, license compliance
  • Advanced Analysis - Control flow graphs, data flow analysis, dead code detection
Why Choose narsil-mcp?
  • Written in Rust - Blazingly fast, memory-safe, single binary (~30MB)
  • Tree-sitter powered - Accurate, incremental parsing for 32 languages
  • Zero config - Point at repos and go
  • MCP compliant - Works with Claude, Cursor, VS Code Copilot, Zed, and any MCP client
  • Privacy-first - Fully local, no data leaves your machine
  • Parallel indexing - Uses all cores via Rayon
  • Smart excerpts - Expands to complete syntactic scopes
  • Security-first - Built-in vulnerability detection and taint analysis
  • Neural embeddings - Optional semantic search with Voyage AI or OpenAI
  • WASM support - Run in browser with WebAssembly build
  • Real-time streaming - Results as indexing progresses for large repos

Supported Languages

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

Installation

Via Package Managers (Recommended)

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

Rust/Cargo (all platforms):

cargo install narsil-mcp

Node.js/npm (all platforms):

npm install -g narsil-mcp
# or
yarn global add narsil-mcp
# or
pnpm add -g narsil-mcp

Nix:

# 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-mcp
One-Click Install Script

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.ps1 | iex

Windows (Git Bash / MSYS2):

curl -fsSL https://raw.githubusercontent.com/postrv/narsil-mcp/main/install.sh | bash

Note 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.

From Source

Prerequisites:

  • Current stable Rust (this release was verified with Rust 1.98 and 1.99)
  • On Windows: Visual Studio Build Tools with "Desktop development with C++"
# Clone and build
git clone git@github.com: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.exe
Feature Builds

narsil-mcp supports different feature sets for different use cases:

# Default build - native MCP server (~30MB)
cargo build --release

# With RDF knowledge graph and CCG tools (~35MB) - SPARQL queries, Code Context Graph
cargo build --release --features graph

# With neural vector search (~32MB) - adds TF-IDF similarity
cargo build --release --features neural

# With ONNX model support (~50MB) - adds local neural embeddings
cargo build --release --features neural-onnx

# With embedded visualization frontend (~31MB)
cargo build --release --features frontend

# Full-featured build with graph + frontend (~40MB)
cargo build --release --features graph,frontend

# Experimental browser/WASM source build (not release-qualified)
cargo build --release --target wasm32-unknown-unknown --no-default-features --features wasm
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 Experimental browser source build (no file system, git) Not release-qualified

Important: The --graph CLI flag requires the binary to be built with --features graph. If you pass --graph to 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.

Usage

Basic Usage

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 --reindex

Windows (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
Full Feature Set
narsil-mcp \
  --repos ~/projects/my-app \
  --git \           # Enable git blame, history, contributors
  --call-graph \    # Enable function call analysis
  --persist \       # Save index to disk for fast startup
  --watch \         # Auto-reindex on file changes
  --lsp \           # Enable LSP for hover, go-to-definition
  --streaming \     # Stream large result sets
  --remote \        # Enable GitHub remote repo support
  --neural \        # Enable neural semantic embeddings
  --neural-backend api \  # Backend: "api" (Voyage/OpenAI) or "onnx"
  --neural-model voyage-code-2 \  # Model to use
  --neural-dimension 3072 \  # Override embedding dimensions (auto-detected per model)
  --graph           # Enable SPARQL/RDF knowledge graph and CCG tools (requires --features graph build)

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 graph

If you pass --graph to 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 --neural

The wizard will:

  • Detect your editor (Claude Desktop, Claude Code, Zed, VS Code, JetBrains)
  • Prompt for your API provider (Voyage AI, OpenAI, or custom)
  • Validate your API key
  • Automatically add it to your editor's MCP config

Alternatively, you can manually set one of these environment variables:

  • EMBEDDING_API_KEY - Generic API key for any provider
  • VOYAGE_API_KEY - Voyage AI specific API key
  • OPENAI_API_KEY - OpenAI specific API key
  • EMBEDDING_SERVER_ENDPOINT - Custom embedding API endpoint URL (optional, allows using self-hosted models)
Configuration

v1.1.0+ introduces optional configuration for fine-grained control over tools and performance. All existing usage continues to work - configuration is completely optional!

Quick Start
# 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 minimal
Automatic Editor Detection

narsil-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:

  • Minimal preset: 61% fewer tokens vs Full
  • Balanced preset: 25% fewer tokens vs Full
Presets

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-focused
Configuration Files

User 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 tools

Project config (.narsil.yaml in repo root):

version: "1.0"
preset: "security-focused"  # Override user preset

tools:
  categories:
    Security:
      enabled: true
    SupplyChain:
      enabled: true

Named 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: balanced
narsil-mcp --profile platform
narsil-mcp config profiles

Priority: CLI flags > Environment vars > Project config > User config > Defaults

Environment Variables
# 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
CLI Commands
# 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 named repository profiles
narsil-mcp config profiles

Learn More:

Visualization Frontend

Explore call graphs, imports, symbol references, and control flow interactively in your browser.

# Build with embedded frontend
cargo build --release --features frontend

# Run with HTTP server
narsil-mcp --repos ~/project --http --call-graph
# Open http://localhost:3000

Five graph views:

View Description
Call Graph Function call relationships with depth control and direction filtering
Import Graph File-level import dependencies across the codebase
Symbol Graph All references to a symbol, with file clustering
Hybrid Combined call + import graph with split budget
Control Flow Real CFG with basic blocks, branches, and loop back-edges

Features:

  • Interactive Cytoscape.js graphs with drag, zoom, and double-click drill-down
  • Complexity metrics overlay with color coding (green/yellow/orange/red)
  • Security vulnerability overlay highlighting taint sources and sinks
  • Six layout algorithms (dagre, force-directed, breadthfirst, concentric, circle, grid)
  • File tree sidebar with syntax-highlighted code viewer
  • URL-driven state (shareable links, browser back/forward)
  • Dark mode support
  • Node detail panel with code excerpts and navigation to source

Full documentation: See docs/frontend.md for setup, API endpoints, and development mode.

Neural Semantic Search

Find similar code using neural embeddings - even when variable names and structure differ.

# Quick setup with wizard
narsil-mcp config init --neural

# Or manually with Voyage AI
export VOYAGE_API_KEY="your-key"
narsil-mcp --repos ~/project --neural --neural-model voyage-code-2

Supports Voyage AI, OpenAI, custom endpoints, and local ONNX models.

Full documentation: See docs/neural-search.md for setup, backends, and use cases.

Type Inference

Built-in type inference for Python, JavaScript, and TypeScript - no mypy or tsc required.

Tool Description
infer_types Get inferred types for all variables in a function
check_type_errors Find potential type mismatches
get_typed_taint_flow Enhanced security analysis with type info
def process(data):
    result = data.split(",")  # result: list[str]
    count = len(result)       # count: int
    return count * 2          # returns: int
Forgemax Integration (Experimental)

For large-scale agentic workflows, narsil-mcp can be used through Forgemax, a Code Mode MCP gateway that collapses all 90 tools into just 2 (search + execute), reducing tool schema overhead from ~12,000 tokens to ~1,000.

# Install Forgemax
cargo install forgemax

# Run narsil-mcp through Forgemax (uses forge.toml in repo root)
forgemax

The included forge.toml configures narsil-mcp with sensible defaults:

[servers.narsil]
command = "narsil-mcp"
args = ["--repos", ".", "--git", "--call-graph", "--persist", "--watch"]
transport = "stdio"

[sandbox]
timeout_secs = 10
max_heap_mb = 64
max_concurrent = 8

The LLM writes JavaScript that calls through typed proxy objects inside a sandboxed V8 isolate, credentials, file paths, and internal state never leave the host. This approach is particularly useful when working with multiple MCP servers simultaneously, as it keeps the total tool context small and predictable.

MCP Configuration

Add narsil-mcp to your AI assistant by creating a configuration file. Here are the recommended setups:

Claude Code (.mcp.json in project root - Recommended):

Create .mcp.json in your project directory for per-project configuration:

{
  "mcpServers": {
    "narsil-mcp": {
      "command": "narsil-mcp",
      "args": ["--repos", ".", "--git", "--call-graph"]
    }
  }
}

Then start Claude Code in your project:

cd /path/to/project
claude

Using . for --repos automatically indexes the current directory. Claude now has access to 90 code intelligence tools.

Tip: Add --persist --index-path .claude/cache for faster startup on subsequent runs.

For global configuration, edit ~/.claude/settings.json instead. See Claude Code Integration for advanced setups.

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "narsil-mcp": {
      "command": "narsil-mcp",
      "args": ["--repos", ".", "--git", "--call-graph"]
    }
  }
}

VS Code + GitHub Copilot (.vscode/mcp.json):

{
  "servers": {
    "narsil-mcp": {
      "command": "narsil-mcp",
      "args": ["--repos", ".", "--git", "--call-graph"]
    }
  }
}

Note for Copilot Enterprise: MCP support requires VS Code 1.102+ and must be enabled by your organization administrator.

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "narsil-mcp": {
      "command": "narsil-mcp",
      "args": ["--repos", "/path/to/your/projects", "--git"]
    }
  }
}

Zed (settings.json → Context Servers):

{
  "context_servers": {
    "narsil-mcp": {
      "command": "narsil-mcp",
      "args": ["--repos", ".", "--git"]
    }
  }
}

Note for Zed: narsil-mcp starts immediately and indexes in the background, preventing initialization timeouts.

Claude Code Plugin

For Claude Code users, we provide a plugin with slash commands and a skill for effective tool usage.

Install via Marketplace (Recommended):

# Add the narsil-mcp marketplace
/plugin marketplace add postrv/narsil-mcp

# Install the plugin
/plugin install narsil@narsil-mcp

Or install directly from GitHub:

/plugin install github:postrv/narsil-mcp/narsil-plugin

What's included:

Component Description
/narsil:security-scan Run comprehensive security audits
/narsil:explore Explore unfamiliar codebases
/narsil:analyze-function Deep dive on specific functions
/narsil:find-feature Find where features are implemented
/narsil:supply-chain Analyze supply chain security
Skill Guides Claude on using 90 tools effectively
MCP Config Auto-starts narsil-mcp with sensible defaults

See narsil-plugin/README.md for full documentation.

Ralph Automation Integration

Ralph is a Claude Code automation suite for autonomous code development. When narsil-mcp is available, Ralph gains enhanced code intelligence capabilities:

Feature Without narsil-mcp With narsil-mcp
Security scanning Basic (clippy) OWASP/CWE vulnerability detection
Code understanding File-based Call graphs, symbol references
Architecture analysis Manual CCG L0/L1/L2 automatic layers
Dependency analysis cargo tree Import graphs, circular detection

Setup:

# Install narsil-mcp (Ralph auto-detects it)
cargo install narsil-mcp

# Ralph's quality gates use these tools:
narsil-mcp scan_security --repo <name>
narsil-mcp check_type_errors --repo <name> --path src
narsil-mcp find_injection_vulnerabilities --repo <name>

Ralph gracefully degrades when narsil-mcp is unavailable - all core automation features work without it.

Documentation: See Ralph README for full integration details.

Playbooks & Tutorials

See docs/playbooks for practical usage guides:

Guide Description
Getting Started Quick setup and first tool calls
Understand a Codebase Explore unfamiliar projects
Fix a Bug Debug with call graphs and taint analysis
Security Audit Find vulnerabilities with OWASP/CWE scanning
Code Review Review changes effectively

Each playbook shows the exact tool chains Claude uses to answer your questions.

WebAssembly (Browser) Usage

The repository contains experimental WebAssembly source and a local build script. @narsil-mcp/wasm is not published on npm and is not a distribution channel for the 1.7.1 CLI release. The WASM build and examples are not covered by its release qualification. See docs/wasm.md for the experimental source workflow.

Available Tools (93)

Repository & File Management
Tool Description
list_repos List all indexed repositories with metadata
get_project_structure Get directory tree with file icons and sizes
get_file Get file contents with optional line range
get_excerpt Extract code around specific lines with context
reindex Trigger re-indexing of repositories
discover_repos Auto-discover repositories in a directory
validate_repo Check if path is a valid repository
get_index_status Show index stats and enabled features
Symbol Search & Navigation
Tool Description
find_symbols Find structs, classes, functions by type/pattern
get_symbol_definition Get symbol source with surrounding context
find_references Find all references to a symbol
get_dependencies Analyze imports and dependents
workspace_symbol_search Fuzzy search symbols across workspace
find_symbol_usages Cross-file symbol usage with imports
get_export_map Get exported symbols from a file/module
Code Search
Tool Description
search_code Keyword search with relevance ranking
semantic_search BM25-ranked semantic search
hybrid_search Combined BM25 + TF-IDF with rank fusion
search_chunks Search over AST-aware code chunks
find_similar_code Find code similar to a snippet (TF-IDF)
find_similar_to_symbol Find code similar to a symbol
AST-Aware Chunking
Tool Description
get_chunks Get AST-aware chunks for a file
get_chunk_stats Statistics about code chunks
get_embedding_stats Embedding index statistics
Neural Semantic Search (requires --neural)
Tool Description
neural_search Semantic search using neural embeddings (finds similar code even with different names)
find_semantic_clones Find Type-3/4 semantic clones of a function
get_neural_stats Neural embedding index statistics
Call Graph Analysis (requires --call-graph)
Tool Description
get_call_graph Get call graph for repository/function
get_callers Find functions that call a function
get_callees Find functions called by a function
find_call_path Find path between two functions
get_complexity Get cyclomatic/cognitive complexity
get_function_hotspots Find highly connected functions
Control Flow Analysis
Tool Description
get_control_flow Get CFG showing basic blocks and branches
find_dead_code Find unreachable code blocks
Data Flow Analysis
Tool Description
get_data_flow Variable definitions and uses
get_reaching_definitions Which assignments reach each point
find_uninitialized Variables used before initialization
find_dead_stores Assignments that are never read
Type Inference (Python/JavaScript/TypeScript)
Tool Description
infer_types Infer types for variables in a function without external type checkers
check_type_errors Find potential type errors without running mypy/tsc
get_typed_taint_flow Enhanced taint analysis combining data flow with type inference
Import/Dependency Graph
Tool Description
get_import_graph Build and analyze import graph
find_circular_imports Detect circular dependencies
get_incremental_status Merkle tree and change statistics
Security Analysis - Taint Tracking
Tool Description
find_injection_vulnerabilities Find SQL injection, XSS, command injection, path traversal
trace_taint Trace tainted data flow from a source
get_taint_sources List taint sources (user input, files, network)
get_security_summary Comprehensive security risk assessment
Security Analysis - Rules Engine
Tool Description
scan_security Scan with security rules (OWASP, CWE, crypto, secrets)
check_owasp_top10 Scan for OWASP Top 10 2021 vulnerabilities
check_cwe_top25 Scan for CWE Top 25 weaknesses
explain_vulnerability Get detailed vulnerability explanation
suggest_fix Get remediation suggestions for findings
Supply Chain Security
Tool Description
generate_sbom Generate SBOM (CycloneDX/SPDX/JSON)
check_dependencies Check for known vulnerabilities (OSV database)
check_licenses Analyze licenses for compliance issues
find_upgrade_path Find safe upgrade paths for vulnerable deps
Git Integration (requires --git)
Tool Description
get_blame Git blame for file
get_file_history Commit history for file
get_recent_changes Recent commits in repository
get_hotspots Files with high churn and complexity
get_contributors Repository/file contributors
get_commit_diff Diff for specific commit
get_symbol_history Commits that changed a symbol
get_branch_info Current branch and status
get_modified_files Working tree changes
LSP Integration (requires --lsp)
Tool Description
get_hover_info Type info and documentation
get_type_info Precise type information
go_to_definition Find definition location
Remote Repository Support (requires --remote)
Tool Description
add_remote_repo Clone and index GitHub repository
list_remote_files List files via GitHub API
get_remote_file Fetch file via GitHub API
Metrics
Tool Description
get_metrics Performance stats and timing
SPARQL / Knowledge Graph (requires --graph)
Tool Description
sparql_query Execute SPARQL query against RDF knowledge graph
list_sparql_templates List available SPARQL query templates
run_sparql_template Execute predefined SPARQL template with parameters

Read the rest of the Narsil README on GitHub

Questions about Narsil

What is the Narsil MCP server?

Rust MCP server for comprehensive code intelligence - 90 tools, 32 languages, security scanning, call graphs, and more. Narsil is maintained by postrv on GitHub at postrv/narsil-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Narsil MCP server?

Narsil doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (postrv/narsil-mcp). Like most servers, Narsil ends with a command or URL you paste into your AI app's MCP config.

Does Narsil need an API key?

The registry lists no required keys for Narsil. Check the Narsil README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Narsil an official MCP server?

No. Narsil is a community server maintained by postrv. Community servers can be excellent; read the code and the open issues before you give Narsil access to company data.

What license is Narsil under?

Narsil is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Narsil; the service it connects to has its own terms.