Marketplace

narsil

Use narsil-mcp code intelligence tools effectively. Use when searching code, finding symbols, analyzing call graphs, scanning for security vulnerabilities, exploring dependencies, or performing static analysis on indexed repositories.

allowed_tools: mcp__narsil-mcp__*

$ インストール

git clone https://github.com/postrv/narsil-mcp /tmp/narsil-mcp && cp -r /tmp/narsil-mcp/narsil-plugin/skills/narsil ~/.claude/skills/narsil-mcp

// tip: Run this command in your terminal to install the skill


name: narsil description: Use narsil-mcp code intelligence tools effectively. Use when searching code, finding symbols, analyzing call graphs, scanning for security vulnerabilities, exploring dependencies, or performing static analysis on indexed repositories. allowed-tools: mcp__narsil-mcp__*

Narsil Code Intelligence

Narsil is an MCP server providing 76 code intelligence tools. This skill helps you use them effectively.

Critical: Parameter Naming

Use short parameter names. These are the most common mistakes:

WrongCorrect
repo_pathrepo
symbol_namesymbol
file_pathpath
function_namefunction

The repo parameter expects the repository name from list_repos, not the full filesystem path.

Getting Started

Always start with:

list_repos  → See indexed repositories
get_index_status  → See which features are enabled

Feature Requirements

Some tools require specific CLI flags when starting narsil-mcp:

FeatureRequired FlagTools
Git integration--gitget_blame, get_file_history, get_recent_changes, get_hotspots, get_contributors, get_commit_diff, get_symbol_history, get_branch_info, get_modified_files
Call graph--call-graphget_call_graph, get_callers, get_callees, find_call_path, get_complexity, get_function_hotspots
LSP--lspEnhanced: get_hover_info, get_type_info, go_to_definition
Neural search--neuralneural_search, get_neural_stats
Remote repos--remoteadd_remote_repo, list_remote_files, get_remote_file

If a tool returns empty results or errors, check get_index_status to verify the feature is enabled.

Tool Selection Guide

Finding Code

TaskBest ToolWhen to Use
Find files by namefind_symbols with file_patternKnow filename pattern
Find function/class definitionsfind_symbolsKnow symbol type
Search by contentsearch_codeKeyword search
BM25-ranked searchsemantic_searchBetter ranking than search_code
Semantic code searchhybrid_searchNatural language queries (combines BM25 + TF-IDF)
Find similar codefind_similar_codeHave a code snippet
Find code like a symbolfind_similar_to_symbolFind patterns similar to existing function
Find code clonesfind_semantic_clonesDetect duplicate/similar code (Type-3/4 clones)
Search AST chunkssearch_chunksWant function/class boundaries
Fuzzy symbol searchworkspace_symbol_searchUnsure of exact name
AI codebase overviewexplain_codebaseQuick understanding of unfamiliar repo
Find feature locationfind_implementationKnow feature name, not code location

Understanding Code

TaskBest Tool
Read a fileget_file
Read specific linesget_excerpt
Get AST chunks for fileget_chunks
Get function sourceget_symbol_definition
Find all referencesfind_references
Find all usages (cross-file)find_symbol_usages
See what exports a module hasget_export_map
Analyze imports/dependenciesget_dependencies
See what calls a functionget_callers
See what a function callsget_callees
Full call graphget_call_graph
Find path between functionsfind_call_path
Function complexityget_complexity
Find high-connection functionsget_function_hotspots
Get type info at positionget_hover_info
Get precise type infoget_type_info
Go to definitiongo_to_definition

Security Analysis

TaskBest Tool
Full security scanscan_security
Security overviewget_security_summary
OWASP Top 10 checkcheck_owasp_top10
CWE Top 25 checkcheck_cwe_top25
Find injection flawsfind_injection_vulnerabilities
Find taint sourcesget_taint_sources
Trace tainted datatrace_taint
Explain a vulnerabilityexplain_vulnerability
Get fix suggestionsuggest_fix
Check dependencies for CVEscheck_dependencies
Find upgrade pathsfind_upgrade_path
License compliancecheck_licenses
Generate SBOMgenerate_sbom

Static Analysis

TaskBest Tool
Control flow graphget_control_flow
Data flow analysisget_data_flow
Reaching definitionsget_reaching_definitions
Find dead codefind_dead_code
Find dead storesfind_dead_stores
Find uninitialized varsfind_uninitialized
Infer types (Python/JS/TS)infer_types
Check type errorscheck_type_errors
Taint flow with typesget_typed_taint_flow
Import dependency graphget_import_graph
Find circular importsfind_circular_imports

Git History (requires --git)

TaskBest Tool
Git blame for fileget_blame
File commit historyget_file_history
Recent repo changesget_recent_changes
High-churn filesget_hotspots
Contributors to file/repoget_contributors
Diff for a commitget_commit_diff
Symbol change historyget_symbol_history
Current branch infoget_branch_info
Uncommitted changesget_modified_files

Utility & Diagnostics

TaskBest Tool
List indexed reposlist_repos
Get project structureget_project_structure
Check enabled featuresget_index_status
Force re-indexreindex
Discover repos in directorydiscover_repos
Validate repo pathvalidate_repo
Incremental index statusget_incremental_status
Performance metricsget_metrics
Embedding statsget_embedding_stats
Chunk statsget_chunk_stats

Common Patterns

Explore a new codebase

1. list_repos → get repo name
2. get_project_structure(repo) → see directory tree
3. find_symbols(repo, symbol_type="function") → see main functions
4. get_import_graph(repo) → understand module structure

Find where something is implemented

1. workspace_symbol_search(query="feature name") → find candidates
2. find_symbol_usages(repo, symbol) → see all usages
3. get_symbol_definition(repo, symbol) → read the code

Security audit

1. scan_security(repo) → get all findings
2. check_owasp_top10(repo) → check critical vulnerabilities
3. check_dependencies(repo) → find vulnerable dependencies
4. find_injection_vulnerabilities(repo) → focus on injection flaws
5. For each finding: suggest_fix(repo, path, line) → get remediation

Understand a function

1. get_symbol_definition(repo, symbol) → read source
2. get_callers(repo, function, transitive=true) → who calls it
3. get_callees(repo, function) → what it calls
4. get_complexity(repo, function) → cyclomatic complexity
5. get_data_flow(repo, path, function) → variable flow

Handling Large Results

For large codebases, use pagination and filtering:

  • max_results parameter limits output size
  • file_pattern filters by glob (e.g., "*.py", "src/**/*.ts")
  • severity_threshold filters security findings (critical, high, medium, low)

Troubleshooting

"No repository found" → Run list_repos and use exact repo name

Empty results from git tools → Check get_index_status shows git enabled

Empty results from call graph → Check get_index_status shows call-graph enabled

Slow searches → Use file_pattern to narrow scope

For detailed workflow examples, see WORKFLOWS.md.