NomikNomik

MCP Tools and Resources

Complete reference for Nomik's 21 MCP tools, 9 resources, and 6 prompts that give AI assistants structured access to your code knowledge graph.

What is MCP?

The Model Context Protocol (MCP) is an open standard by Anthropic that connects AI assistants to external tools and data sources. Nomik implements an MCP server that gives AI assistants direct, structured access to your code knowledge graph.

Instead of the AI reading files and guessing at relationships, it queries the graph to get precise, traversal-based answers.

How It Works

The AI assistant automatically selects the right Nomik tool based on your question. No manual tool selection needed.

MCP Flow Architecture

You ask
"What breaks if I change processPayment?"
AI calls nm_impact → Nomik returns
[
  { "name": "POST /api/checkout",  "type": "Route",    "depth": 1, "file": "src/api/checkout.ts:12" },
  { "name": "handleBatchPayment",  "type": "Function", "depth": 1, "file": "src/services/batch.ts:34" },
  { "name": "retryPayment",        "type": "Function", "depth": 1, "file": "src/services/retry.ts:8" },
  { "name": "POST /api/batch",     "type": "Route",    "depth": 2, "file": "src/api/batch.ts:5" },
  { "name": "monthly_billing",     "type": "CronJob",  "depth": 2, "file": "src/jobs/retry.ts:1" }
]

The AI then uses this precise data to give you an accurate answer — no hallucination, no guessing.

Real Examples

Here are real questions you can ask your AI assistant once Nomik is connected:

Search
"Find all functions related to payment"
 AI calls nm_search(query: "payment")  returns matching functions with file paths
Impact analysis
"What breaks if I rename UserService?"
 AI calls nm_rename(symbol: "UserService")  returns definition, all callers, importers, affected files
Database impact
"Which functions write to the users table?"
 AI calls nm_db_impact(table: "users")  returns all READS_FROM and WRITES_TO with file paths
Health check
"Are there any dead code or god files?"
 AI calls nm_health(includeDeadCode: true, includeGodFiles: true)  returns full health report
Test impact
"Which tests should I re-run after changing processPayment?"
 AI calls nm_test_impact(symbol: "processPayment")  returns affected test files
Architecture
"Show me the execution flow from POST /api/checkout"
 AI calls nm_flows traces route handler services DB external APIs
Cross-service
"What services communicate via message queues?"
 AI calls nm_service_links returns producer/consumer pairs for all queues, events, topics

Setup

nomik setup-cursor        # Cursor AI
nomik setup-windsurf      # Windsurf AI
nomik setup-claude        # Claude Desktop
nomik setup-antigravity   # Antigravity Editor

Each command auto-creates the correct config file with your Neo4j credentials and project ID.

In stdio mode (default), the IDE launches the MCP server on demand. You do not need to run nomik serve.

Manual Configuration

MCP Config
{
  "mcpServers": {
    "nomik": {
      "command": "node",
      "args": ["packages/mcp-server/dist/index.js"],
      "env": {
        "NOMIK_GRAPH_URI": "bolt://localhost:7687",
        "NOMIK_GRAPH_USER": "neo4j",
        "NOMIK_GRAPH_PASS": "nomik_local",
        "NOMIK_PROJECT_ID": "my-project",
        "NOMIK_ROLE": "dev",
        "NOMIK_SAMPLING": "false"
      }
    }
  }
}

Config file locations by editor:

EditorConfig Path
Cursor.cursor/mcp.json (project root)
Windsurf~/.codeium/windsurf/mcp_config.json
Claude Desktop (Windows)%APPDATA%\Claude\claude_desktop_config.json
Claude Desktop (macOS)~/Library/Application Support/Claude/claude_desktop_config.json
AntigravityPlatform-specific mcp_config.json

Tools (21)

All tools accept an optional project parameter that overrides the NOMIK_PROJECT_ID environment variable.

Search and Exploration

ToolDescriptionKey Parameters
nm_searchSearch nodes by name with wildcard supportquery, limit
nm_contextFull context for a file or function — what it contains, calls, is called by, and importsname
nm_explainDeep-dive into a symbol: type, file location, all callers, all callees, edge countssymbol
nm_projectsList all tracked projects with IDs and metadata

Impact Analysis

ToolDescriptionKey Parameters
nm_impactDownstream impact analysis — find everything that breaks if a symbol changessymbolId, depth, minConfidence
nm_traceShortest dependency chain between two symbols (names only)from, to
nm_pathDetailed path between two symbols with node types and relationship types at each stepfrom, to
nm_db_impactDatabase table/column read-write analysis — find all functions that read from or write to a tabletable, column
nm_test_impactFind all test files affected by changing a symbol or filesymbol or files
nm_renameGraph-aware rename impact — shows definition, all callers, importers, and affected filessymbol

Architecture and Quality

ToolDescriptionKey Parameters
nm_healthCodebase health metrics with optional dead code, god files, god objects, and duplicate analysisincludeDeadCode, includeGodFiles, includeDuplicates
nm_communitiesDetect functional clusters — groups of code that frequently call each otherminSize
nm_flowsTrace execution flows from entry points (routes, event listeners, queue consumers) through the call graphmaxDepth, limit
nm_rulesEvaluate 9 configurable architecture rules plus custom Cypher rulesthreshold parameters
nm_guardQuality gate check — returns pass/fail per rule with violationsthreshold parameters
nm_diffArchitecture drift between two git SHAs — new/removed files, functions, and call edgesfromSha, toSha
nm_service_linksCross-service dependencies through message queues, event buses, and API calls

Reporting

ToolDescriptionKey Parameters
nm_changesRecently modified nodes with types and file pathssince, limit
nm_onboardFull codebase briefing — stats, language distribution, DB tables, external APIs, env vars, high-risk functions
nm_wikiStructured documentation data — file index, top functions, health report, cross-service linkssection, limit
nm_auditDependency vulnerability check cross-referenced with the knowledge graph to show blast radius

Resources (9)

Browsable, read-only data endpoints that AI assistants can access directly. All resources are project-scoped via NOMIK_PROJECT_ID.

URIDescription
nomik://statsNode and edge counts by type
nomik://healthDead code, god files, duplicates, edge type distribution
nomik://filesAll tracked files with language, function count, and line count
nomik://communitiesFunctional clusters with cohesion scores
nomik://onboardFull codebase briefing
nomik://schemaAll node labels and relationship types with counts
nomik://projectsAll tracked projects
nomik://infrastructureQueues, metrics, spans, topics, crons, events, APIs, env vars
nomik://guardQuality gate status

Prompts (6)

Pre-built conversation starters that guide AI assistants through common analysis workflows.

PromptDescription
nomik-onboardFull architecture briefing for a new team member
nomik-review-changeImpact analysis before making a refactoring change
nomik-health-checkComprehensive health report with prioritized action items
nomik-explain-moduleDeep-dive into a specific file or module
nomik-migration-planStep-by-step migration plan with risk assessment
nomik-infrastructureAudit all infrastructure: queues, metrics, events, external APIs

Role-Scoped Access

The NOMIK_ROLE environment variable restricts which tools, resources, and prompts the AI assistant can see. This enables least-privilege access depending on the user's role.

RoleUse CaseTools Available
dev (default)Full development accessAll 21 tools, 9 resources, 6 prompts
architectArchitecture reviewrules, communities, flows, diff, onboard, guard
securitySecurity auditingaudit, guard, rules, health
pmProject managementonboard, changes, changelog, health, wiki
.env
NOMIK_ROLE=architect

MCP Sampling

When NOMIK_SAMPLING=true, the MCP server can request the client's LLM to generate completions. This enables the server to enrich raw graph data with AI-generated summaries.

1. Server queries Neo4j → gets 80 affected nodes
2. Server sends sampling/createMessage → "Summarize this impact data"
3. Client LLM generates human-readable summary
4. Server returns enriched response to the user

Three pre-built sampling helpers:

HelperPurpose
sampleImpactSummary()Summarize impact analysis results into actionable insights
sampleHealthSummary()Generate a prioritized health action plan
sampleMigrationPlan()Create a step-by-step migration guide with risk levels

The server falls back gracefully if the client does not support sampling.

Transport Options

TransportUse CaseSetup
stdio (default)Local editors (Cursor, Windsurf, Claude Desktop)Automatic via nomik setup-* commands
SSERemote access, web dashboardsnomik serve on port 3334
Streamable HTTPProduction, multi-client environmentsCustom deployment

For local development, stdio is all you need — the editor launches the MCP server on demand.