Skip to content

Copilot / MCP Integration

The Model Context Protocol (MCP) lets AI agents like GitHub Copilot call external tools. IntentWeave exposes its index queries as MCP tools, so Copilot can search your code index, find connections, and check drift — all from chat.

Terminal window
iw mcp --session my-project -v

Add to .vscode/mcp.json:

{
"servers": {
"intentweave-kg": {
"command": "npx",
"args": ["@intentweave/cli", "mcp", "--session", "my-project", "-v"]
}
}
}

VS Code Copilot will auto-discover the server and make the tools available in chat.

These tools work with the local SQLite index — no Neo4j or LLM needed.

ToolPurposeKey Parameters
cari_retrieveRanked file retrieval by topic or symbolquery, scope?, limit?
cari_connectionsCross-layer connections + gap detectionentity, include?, limit?
cari_checkCI drift detection for changed fileschanged, severity?
cari_clonesExact code clone detection(none)
cari_structural_clonesType 2 clone detection(none)
cari_circular_importsImport cycle detection(none)
cari_unused_exportsUnused exported symbolslimit?
cari_hotspot_priorityHigh-churn low-doc file rankinglimit?
cari_todosTODO/FIXME/HACK/XXX inventorykind?, limit?
cari_module_coverageDocumentation coverage per directory(none)
cari_orphaned_sectionsDoc sections with ungrounded mentions(none)
cari_doc_completenessPer-doc completeness scoring(none)
cari_cross_group_driftCross-group entity coverage conflicts(none)
cari_mentions_ofEntity → doc mentionsentityId, minConfidence?, limit?
cari_annotations_forFile → all annotationsfilePath, minConfidence?, limit?
cari_test_coverageTest→source mapping + gapslimit?
cari_hubsGod-node / hub analysislimit?
cari_communitiesCommunity detection (3 modes)mode?, resolution?, limit?
cari_surprisesSurprising connection rankinglimit?
cari_rationaleWHY/NOTE/IMPORTANT/DESIGN inventorykind?, limit?
cari_terminologyTerminology inconsistency detectionlimit?
cari_dep_depthTransitive import depth analysislimit?
cari_boundary_violationsPackage boundary violation detection(none)
cari_layers_inferAuto-infer architectural layers(none)
cari_layers_checkValidate imports against layer configallowSkipLayer?
cari_layers_nameLLM-generated layer & directory namesprovider, model?, api_key?
cari_focusFocused architecture view around a targettarget, hops?, maxNodes?

All CARI tools are also available as CLI subcommands (e.g., iw index clones). See the CLI Reference for the full command list.

Ask Copilot:

  • “Find files about authentication” → Copilot calls cari_retrieve with query=“authentication”
  • “What’s connected to AuthService?” → Copilot calls cari_connections with entity=“AuthService”
  • “I changed auth.ts — any docs to update?” → Copilot calls cari_check with changed files
  • “Find duplicate code” → Copilot calls cari_clones
  • “Show circular dependencies” → Copilot calls cari_circular_imports
  • “What TODOs exist?” → Copilot calls cari_todos
  • “Which modules lack docs?” → Copilot calls cari_module_coverage
  • “Where is AuthService mentioned?” → Copilot calls cari_mentions_of with entityId
  • “What entities appear in AUTH.md?” → Copilot calls cari_annotations_for with filePath
  • “What are the architectural layers?” → Copilot calls cari_layers_infer
  • “Are there any layer violations?” → Copilot calls cari_layers_check
  • “Name my layers with AI” → Copilot calls cari_layers_name with provider=“openai”
  • “Show communities by git history” → Copilot calls cari_communities with mode=“temporal”
  • “Show me the architecture around auth.ts” → Copilot calls cari_focus with target=“auth.ts”

If you have Neo4j running, additional tools are available:

ToolPurposeKey Parameters
kg_queryNatural language or Cypher queryquestion, cypher?, limit?
kg_contextBuild RAG context from graphtopic?, entity?, hops?
kg_entitiesList/search entitiestype?, search?, limit?
kg_impactSemantic impact analysisfiles, hops?
kg_doc_healthDocumentation freshness (requires Neo4j)files?
kg_schemaGraph schema description(none)
Terminal window
iw mcp [options]
OptionDefaultDescription
-s, --sessionDefault session scope
-v, --verboseoffLog tool invocations