Skip to content

MCP Server

Kanoniv ships an MCP (Model Context Protocol) server that gives AI agents persistent identity and memory primitives. Every agent that connects to the same Kanoniv tenant shares the same identity graph, the same memory, and the same coordination layer.

Connect it to Claude Desktop, Cursor, Claude Code, Windsurf, or any MCP-compatible client.

Cloud-only

The MCP server requires a Kanoniv Cloud API key. See Authentication for setup.

Installation

Quickest Setup

bash
npx @kanoniv/mcp init

This interactive command generates the correct config for your MCP client (Claude Desktop, Cursor, Windsurf, or Claude Code) and sets your agent name.

Manual Setup

Claude Desktop (~/.config/Claude/claude_desktop_config.json on Linux, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

json
{
  "mcpServers": {
    "kanoniv": {
      "command": "npx",
      "args": ["-y", "@kanoniv/mcp"],
      "env": {
        "KANONIV_API_KEY": "your-api-key-here",
        "KANONIV_AGENT_NAME": "my-coding-agent"
      }
    }
  }
}

Cursor (.cursor/mcp.json in your project root):

json
{
  "mcpServers": {
    "kanoniv": {
      "command": "npx",
      "args": ["-y", "@kanoniv/mcp"],
      "env": {
        "KANONIV_API_KEY": "your-api-key",
        "KANONIV_AGENT_NAME": "cursor-agent"
      }
    }
  }
}

Claude Code (.mcp.json in your project root):

json
{
  "mcpServers": {
    "kanoniv": {
      "command": "npx",
      "args": ["-y", "@kanoniv/mcp"],
      "env": {
        "KANONIV_API_KEY": "your-api-key",
        "KANONIV_AGENT_NAME": "claude-code-agent"
      }
    }
  }
}

You can get an API key from the Kanoniv dashboard or by running kanoniv login with the CLI.

Verify Connection

After restarting your client, ask:

"Show me the identity graph stats"

The assistant should call stats and return entity counts, merge rates, and graph health.

Configuration

VariableRequiredDefaultDescription
KANONIV_API_KEYYes-API key for authentication. Also accepts PRISM_API_KEY.
KANONIV_API_URLNohttps://api.kanoniv.comAPI base URL. Also accepts PRISM_API_URL.
KANONIV_AGENT_NAMENomcp_agentAgent name for attribution in memory, tasks, and registry.
KANONIV_MCP_TOOLSNoagentTool profile name or comma-separated category list
KANONIV_MCP_MODENohybridOperating mode: hybrid or legacy (only used with KANONIV_MCP_TOOLS=all)
RUST_LOGNoinfoLog level filter

CLI Commands

The MCP package includes four CLI commands for cross-agent coordination:

CommandDescription
npx @kanoniv/mcp initInteractive setup for MCP clients
npx @kanoniv/mcp syncPush local knowledge (CLAUDE.md, memory) to cloud
npx @kanoniv/mcp pullDownload cloud knowledge to local files
npx @kanoniv/mcp logUnified activity stream (events + memory + tasks)

See Sync & Pull for full documentation.

Agent Identity

Every agent has a name, set via KANONIV_AGENT_NAME. This name is:

  • Sent as X-Agent-Name HTTP header on every request
  • Used as author field in memory entries and intents
  • Used for agent registry auto-registration
  • Used for cross-agent task assignment
bash
KANONIV_AGENT_NAME=sdr-agent npx @kanoniv/mcp

See Agent Registry for details.

Default Profile: Agent (24 Tools)

The default profile (KANONIV_MCP_TOOLS=agent) exposes 24 flat tools organized in 6 groups, optimized for AI agent workflows:

Identity (6 tools)

ToolDescription
resolveIngest + match + link a record in one call
resolve_bulkBatch lookup up to 1000 records
resolve_with_memoryResolve and return all memory for the entity
searchFind entities by name, email, phone, or any field
get_entityGet canonical record with all linked source records
explainFull audit: merge chain, lifecycle events, match scoring

Mutation (4 tools)

ToolDescription
mergeMerge two entities (deterministic lock ordering)
splitEject source records into new standalone entities
mutateJSON merge patch on canonical fields (optimistic locking)
simulateDry-run any mutation without committing

Memory (6 tools)

ToolDescription
memorizeStore a decision, investigation, pattern, or knowledge entry
recallGet all memory linked to an entity
search_memoryFull-text search across all memory
declare_intentTell other agents what you're about to do (auto-expires)
query_expertiseFind agents with experience in a domain
sync_knowledgeBulk-import project docs so all agents can access them

Tasks (3 tools)

ToolDescription
create_taskAssign work to another agent
list_tasksSee open tasks (filter by assignee)
update_taskMark task open/in_progress/done

Registry (3 tools)

ToolDescription
register_agentRegister or update the current agent
list_agentsList all agents with live status
rename_agentChange agent name (409 on conflict)

Observation (2 tools)

ToolDescription
statsDashboard: total entities, records, merge rate, pending reviews
list_eventsWatch identity state transitions

Full Mode (All Categories)

Set KANONIV_MCP_TOOLS=all for access to all 13 category action tools (101 actions) plus 70 MCP resources. This is the power-user mode for building identity pipelines, managing CRM dedup, and running graph analytics.

Profiles

ProfileCategoriesUse Case
agent24 flat tools (default)AI agent workflows
allAll 13 category tools + resourcesFull access
architectspecs, sources, ingest, rules, detectBuilding identity pipelines
operatorjobs, agentsRunning and monitoring
forensicentities, matching, graph, memory, analyze_entitiesInvestigation and analysis
prismcrm, graph, memory, analyze_entitiesCRM deduplication workflows
setupspecs, sources, ingest, jobs, detectInitial onboarding

Custom profile with comma-separated categories:

bash
KANONIV_MCP_TOOLS=manage_specs,manage_jobs npx @kanoniv/mcp

Category Tools Reference

Each tool accepts an action parameter that selects the operation, plus action-specific parameters.

manage_specs

Create and validate identity specs.

ActionParametersDescription
createyaml (string, required), compile (bool, default: false)Create a new spec version. Set compile: true to persist.

Example - Push a spec from Claude Desktop:

"Create a new identity spec that matches customers by email and phone, and persist it"

The assistant calls:

json
{
  "action": "create",
  "yaml": "api_version: kanoniv/v1\nentity:\n  name: customer\nsources:\n  - name: crm\n    id_field: id\nblocking:\n  - email\nmatching:\n  - fields: [email]\n    comparator: exact\n    weight: 1.0\n  - fields: [phone]\n    comparator: exact\n    weight: 0.9\n",
  "compile": true
}

manage_sources

Create, update, delete, or sync data sources.

ActionParametersDescription
createname (string), config (object)Register a new data source
updatesource_id (string), config (object)Update source configuration
deletesource_id (string)Remove a data source
syncsource_id (string)Trigger source sync
statssource_id (string)Record counts, field coverage, and data quality metrics for a source
qualitysource_id (string)Data quality report with score, grade, and issues
entitiessource_id (string), limit (int, default 20)List entities resolved from a specific source

Example - Register and sync a CRM source:

"Create a source called 'salesforce' and sync it"

json
// Step 1: Create
{ "action": "create", "name": "salesforce", "config": {} }

// Step 2: Sync
{ "action": "sync", "source_id": "salesforce" }

manage_ingest

Ingest records and manage column mappings.

ActionParametersDescription
batchsource (string), records (array, max 1000)Ingest records. Each record: { "external_id": "...", "data": {...} }
create_mappingsource_id (string), mapping (object)Create column-to-field mapping

Example - Ingest a batch of customer records:

"Ingest these three customers into the CRM source"

json
{
  "action": "batch",
  "source": "crm",
  "records": [
    { "external_id": "C001", "data": { "email": "[email protected]", "name": "Alice Smith" } },
    { "external_id": "C002", "data": { "email": "[email protected]", "name": "Bob Jones" } },
    { "external_id": "C003", "data": { "email": "[email protected]", "name": "Alice Smith" } }
  ]
}

manage_jobs

Run, cancel, dry-run, or simulate reconciliation jobs.

ActionParametersDescription
runspec_version (int, optional)Start a reconciliation job
canceljob_id (string)Cancel an in-progress job
dry_runspec_version (int, optional)Run without persisting results
simulatespec_version (int, optional), overrides (object)Simulate with parameter overrides

Example - Test a lower match threshold before committing:

"Simulate reconciliation with a 0.8 match threshold instead of 0.9"

json
{
  "action": "simulate",
  "overrides": { "match_threshold": 0.8 }
}

manage_entities

Lock, revert, resolve, compare, or bulk-lookup entities.

ActionParametersDescription
lockentity_id (string)Lock an entity to prevent changes
revertentity_id (string), event_id (string)Revert to a previous state
resolve_realtimesource_name (string), external_id (string), data (object)Ingest + match + link in one call
resolve_bulklookups (array, max 1000)Bulk resolve: [{ "source": "...", "external_id": "..." }]
bulk_linkedentity_ids (array, max 100), reveal_pii (bool)Get linked records for multiple entities
attrsentity_id (string), reveal_pii (bool)Get canonical attributes (gold record) for an entity
candidatesentity_id (string), limit (int, default 20)List merge candidates for an entity
diffentity_id_a (string), entity_id_b (string), reveal_pii (bool)Compare two entities side by side

Example - Resolve a new record in real-time:

"Resolve this new customer: John Doe, [email protected], from the CRM source with ID C-999"

json
{
  "action": "resolve_realtime",
  "source_name": "crm",
  "external_id": "C-999",
  "data": { "email": "[email protected]", "first_name": "John", "last_name": "Doe" }
}

Example - Bulk lookup which entities three records belong to:

json
{
  "action": "resolve_bulk",
  "lookups": [
    { "source": "crm", "external_id": "C001" },
    { "source": "billing", "external_id": "B-100" },
    { "source": "support", "external_id": "T-555" }
  ]
}

manage_matching

Resolve review pairs, manage feedback labels, overrides, and match analysis.

ActionParametersDescription
quick_resolveentity_id_a, entity_id_b, resolve_action ("merge" or "split")Merge or split two entities
batch_resolvedecisions (array, max 100)Resolve multiple pairs at once (much faster than repeated quick_resolve)
create_feedbackrecord_id_a, record_id_b, label ("match" or "no_match")Create active learning label
delete_feedbackfeedback_id (string)Delete a feedback label
create_overrideentity_id_a, entity_id_b (optional), override_type ("merge"/"split"/"lock"), reasonCreate manual override
delete_overrideoverride_id (string)Delete an override
candidatesentity_id (string), limit (int, default 20)List match candidates for an entity
clusterentity_id (string)Show the match cluster an entity belongs to
testrecord_a (string), record_b (string)Dry-run match test between two records (format: source:external_id). Scores without persisting.

Example - Merge two entities and lock the result:

"Merge entity A and entity B, then lock the result so agents don't split it"

json
// Step 1: Merge
{
  "action": "quick_resolve",
  "entity_id_a": "550e8400-...",
  "entity_id_b": "6ba7b810-...",
  "resolve_action": "merge"
}

// Step 2: Lock
// (uses manage_entities)
{ "action": "lock", "entity_id": "550e8400-..." }

Example - Label a pair for active learning:

json
{
  "action": "create_feedback",
  "record_id_a": "C001",
  "record_id_b": "C003",
  "label": "match"
}

manage_rules

Create matching rule versions.

ActionParametersDescription
createname (string), config (object)Create a new matching rule

manage_crm

CRM operations for Prism deduplication.

ActionParametersDescription
trigger_sync-Trigger Salesforce sync
mergepair_id (string)Merge a duplicate pair
dismisspair_id (string)Dismiss a duplicate pair
splitmerge_id (string)Undo a previous merge
autotune-Run CRM autotune
update_settingssettings (object)Update CRM settings

Example - Full CRM dedup workflow via natural language:

"Sync my CRM, run autotune, then show me the duplicates"

The assistant calls trigger_sync, waits, calls autotune, then reads kanoniv://crm/duplicates.

manage_graph

Data export, graph analytics, and observability.

ActionParametersDescription
refresh-Refresh graph analytics
orphanslimit (int, default 50), entity_type (string, optional)List entities with no connections to other entities
conflictslimit (int, default 50)List incoherent clusters that may need review
density-Graph connectivity metrics (edge density, avg degree, clustering coefficient)
export_graphentity_type (string, optional)Export the full identity graph (nodes + edges)
export_matcheslimit (int, default 1000), entity_type (string, optional)Export match audit records

manage_memory

Create and manage reasoning entries (audit trail for LLM decisions).

ActionParametersDescription
createentry_type ("decision"/"investigation"/"pattern"), slug, title, content, metadata, linked_entities, linked_sources, authorCreate a memory entry
updateid, title, content, metadata, status ("active"/"superseded"/"resolved"/"archived")Update an entry
appendid, note (string)Append a timestamped note
archiveidArchive an entry
link_entitiesid, entity_ids (array)Link entities to an entry

Example - Document a merge investigation:

json
{
  "action": "create",
  "entry_type": "investigation",
  "slug": "acme-merge-review-2026-02",
  "title": "Acme Corp duplicate cluster review",
  "content": "Reviewed 3 entities flagged as potential duplicates. Entity A and B share email domain and phone prefix. Entity C is a different subsidiary - should remain separate.",
  "linked_entities": ["550e8400-...", "6ba7b810-...", "7c9e6679-..."],
  "author": "analyst"
}

manage_detect

Profile ingested data and bootstrap identity plans.

ActionParametersDescription
profilesample_size (int, optional), entity_type (string, optional)Profile data to detect identity signals and entity types
bootstrapentity_type (string, optional), version (string, optional)Bootstrap an identity plan from detected signals

Example - Profile data and bootstrap a person identity plan:

"Profile my data for person signals and create an identity plan"

json
{ "action": "bootstrap", "entity_type": "person" }

manage_agents

Configure and control autonomous agents.

ActionParametersDescription
list_configs-List all agent configurations
get_configagent_type (string)Get config for a specific agent
update_configagent_type, enabled (bool), settings (object)Update agent configuration
delete_configagent_type (string)Delete agent configuration
list_runsagent_type (optional)List execution history
get_runrun_id (string)Get run details
rollback_runrun_id (string)Rollback a completed run
list_pending-List actions awaiting approval
approve_actionaction_id (string)Approve a pending action
reject_actionaction_id (string)Reject a pending action

Example - Enable auto-merge with approval required:

"Enable auto-merge at 0.95 confidence but require my approval before executing"

json
{
  "action": "update_config",
  "agent_type": "auto_merge",
  "enabled": true,
  "settings": {
    "min_confidence": 0.95,
    "max_actions_per_run": 50,
    "require_approval": true
  }
}

manage_rows

Inspect and resolve individual source records (rows). Rows are the raw data fed into the pipeline before clustering into entities.

ActionParametersDescription
showsource (string), external_id (string)Show a record by source name and external ID
resolvesource (string), external_id (string), data (object)Ingest + match + link a record in one call (real-time resolve)
lookupsource (string), external_id (string)Find what entity a source record belongs to
membershipssource (string, optional), entity_id (string, optional), limit (int, default 50)List source-to-entity memberships
tracesource (string), external_id (string)Show match audit trail for a record (what it matched with, scores, decisions)

Example - Trace how a record was matched:

"Show me the match audit trail for record C-001 from the CRM source"

json
{ "action": "trace", "source": "crm", "external_id": "C-001" }

manage_system

System administration and maintenance operations.

ActionParametersDescription
reindextarget (string, optional - e.g. "entities", "search", "graph")Rebuild search indexes and reverse lookups
recomputetarget (string, optional - e.g. "entities", "search", "graph")Recalculate canonical records and graph metrics

Example - Rebuild search indexes:

"Reindex the search indexes"

json
{ "action": "reindex", "target": "search" }

analyze_entities

Analyze entity data - find shared attributes, filter by field values, and get field statistics.

ActionParametersDescription
group_byfield (string), min_count (int, default 2), limit (int, default 50)Group entities by a field (e.g. company, email domain) and show counts
filterfield (string), value (string), match_type ("exact"/"contains"/"starts_with"/"missing", default "contains"), limit (int, default 50), offset (int, default 0)Filter entities by field value
field_statsfield (string, optional), top_n (int, default 10)Get field statistics - completeness, cardinality, top values

All actions support optional reveal_pii (bool), identity_version (string), and entity_type (string) parameters.

Example - Find all entities at the same company:

"Which entities share the same company?"

json
{ "action": "group_by", "field": "company", "min_count": 2, "limit": 20 }

Resources Reference

Resources provide read-only access to your identity graph. Use resources/list to discover available resources, or resources/read with a URI to fetch data.

Static Resources

Dashboard

URIDescription
kanoniv://statsPlatform-wide statistics

Core Data

URIDescription
kanoniv://specsAll identity spec versions
kanoniv://sourcesAll configured data sources
kanoniv://rulesActive matching rules
kanoniv://jobsRecent reconciliation jobs (limit 20)
kanoniv://eventsEntity lifecycle events (limit 50)
kanoniv://mergesMerge history with confidence scores (limit 50)
kanoniv://membershipsSource-to-entity mappings (limit 50)

Active Learning & Overrides

URIDescription
kanoniv://feedbackMatch/no_match labels (limit 50)
kanoniv://overridesManual merge/split/lock overrides (limit 50)

Review & Audit

URIDescription
kanoniv://pending-reviewsEntity pairs needing human review (limit 20)
kanoniv://auditSystem audit trail (limit 50)

Export

URIDescription
kanoniv://export/entitiesIncremental entity export (limit 100)
kanoniv://export/membershipsIncremental membership export (limit 100)

CRM

URIDescription
kanoniv://crm/dashboardPrism CRM dashboard
kanoniv://crm/connectionSalesforce connection status
kanoniv://crm/autotune/statusCRM autotune job status
kanoniv://crm/duplicatesDetected duplicate pairs (limit 50)
kanoniv://crm/sync/jobsCRM sync job history (limit 20)
kanoniv://crm/merge/historyCRM merge history (limit 50)

Memory

URIDescription
kanoniv://memory/decisionsActive decision entries (limit 50)
kanoniv://memory/investigationsActive investigation entries (limit 50)
kanoniv://memory/patternsActive pattern entries (limit 50)
kanoniv://memory/recentMost recent entries (limit 20)

Agents

URIDescription
kanoniv://agents/configsAgent configurations
kanoniv://agents/runsRecent agent runs (limit 20)
kanoniv://agents/actions/pendingPending approval actions

Graph Intelligence

URIDescription
kanoniv://graph/statsGraph overview (nodes, edges, components, density)
kanoniv://graph/influence/topTop influencers by PageRank (limit 20)
kanoniv://graph/clustersConnected components analysis
kanoniv://graph/risk/highHigh-risk entities (limit 20)
kanoniv://graph/signals/bridgesBridge entities connecting clusters (limit 20)
kanoniv://graph/recommendations/merge-reviewCross-cluster merge candidates (limit 20)

Resource Templates

Templates accept parameters in the URI. Replace {param} with actual values.

Specs

URI TemplateDescription
kanoniv://specs/{version}Full spec with YAML and execution plan
kanoniv://specs/{version}/summarySpec structure overview
kanoniv://specs/{version}/sensitivityFellegi-Sunter sensitivity analysis

Sources

URI TemplateDescription
kanoniv://sources/{id}Source configuration and ingestion history
kanoniv://sources/{id}/previewSample data and schema
kanoniv://sources/{id}/mappingColumn-to-field mapping

Jobs

URI TemplateDescription
kanoniv://jobs/{id}Job status and progress
kanoniv://jobs/{id}/summaryResult summary (entities, merges, per-source)
kanoniv://jobs/{id}/telemetryPer-rule telemetry (hit count, acceptance rate)
kanoniv://jobs/{id}/diffDiff between two runs
kanoniv://jobs/{id}/healthData quality warnings
kanoniv://jobs/{id}/stabilityCluster stability metrics

Entities

URI TemplateDescription
kanoniv://entities/search/{query}Text search (PII masked)
kanoniv://entities/{id}Golden record with survivorship fields
kanoniv://entities/{id}/linkedEntity with all merged source records
kanoniv://entities/{id}/historyChange audit trail
kanoniv://entities/{id}/auditComplete audit trail with actors

Resolve

URI TemplateDescription
kanoniv://resolve/{source}/{external_id}Lookup by source and external ID

Match Analysis

URI TemplateDescription
kanoniv://match/explain/{entity_a}/{entity_b}Field-by-field scoring breakdown

CRM

URI TemplateDescription
kanoniv://crm/duplicates/{pair_id}Side-by-side field comparison
kanoniv://crm/contacts/search/{query}Search contacts by name/email/phone
kanoniv://crm/graph/{entity_id}1-hop ego graph with relationships
kanoniv://crm/paths/{from}/{to}Strongest connection path (max 3 hops)

Graph Intelligence

URI TemplateDescription
kanoniv://graph/influence/{entity_id}PageRank, betweenness, degree, 2-hop reach
kanoniv://graph/clusters/{entity_id}Entity's connected component
kanoniv://graph/risk/{entity_id}Churn, contagion, merge risk scores
kanoniv://graph/signals/{entity_id}All signal metrics
kanoniv://graph/recommendations/intros/{entity_id}Jaccard-based intro suggestions
kanoniv://graph/recommendations/outreach/{entity_id}Best outreach paths

Memory

URI TemplateDescription
kanoniv://memory/{id}Full memory entry with linked entities
kanoniv://memory/by-entity/{entity_id}All entries linked to an entity
kanoniv://memory/search/{query}Search entries by title and content

Agents

URI TemplateDescription
kanoniv://agents/runs/{run_id}Agent run details
kanoniv://agents/configs/{agent_type}Agent configuration

Rules

URI TemplateDescription
kanoniv://rules/{name}/historyVersion history with config changes

Simulations

URI TemplateDescription
kanoniv://simulations/{id}Simulation results with statistics

Examples

Conversation: Onboard a New Dataset

A natural conversation with Claude Desktop using the MCP server:

You: I have a new CSV of support tickets. Help me add it as a source and reconcile.

Claude: I'll set that up. First, let me create the source. (calls manage_sources -> create with name "support")

Done. Now upload your CSV through the dashboard or use kanoniv source upload tickets.csv from the CLI. Once the data is in, I'll run reconciliation.

You: OK, data is uploaded. Run a dry run first.

Claude: (calls manage_jobs -> dry_run)

Dry run complete. 4,200 records processed, 1,850 entities created (56% merge rate). 12 pairs flagged for review. Want me to run the full reconciliation?

You: Yes, go ahead.

Claude: (calls manage_jobs -> run)

Job queued (ID: a1b2c3d4-...). I'll check back on it. (reads kanoniv://jobs/a1b2c3d4-...)

Completed in 8 seconds. 1,850 canonical entities, 56.2% merge rate.

Conversation: Investigate a Merge

You: Why were entities 550e8400 and 6ba7b810 merged?

Claude: (reads kanoniv://match/explain/550e8400-.../6ba7b810-...)

These two entities were merged with a composite score of 0.94:

  • Email: exact match ([email protected]) - score 1.0, weight 1.0
  • Phone: exact match (+1-555-0123) - score 1.0, weight 0.9
  • Name: Jaro-Winkler similarity 0.87 ("Alice Smith" vs "A. Smith") - score 0.87, weight 0.8

The combined Fellegi-Sunter score of 0.94 exceeded the merge threshold of 0.9.

Conversation: Set Up Agents

You: Set up auto-merge and quality monitoring for production. Be conservative.

Claude: I'll configure both agents with conservative settings: (calls manage_agents -> update_config for auto_merge)(calls manage_agents -> update_config for quality_monitor)

Done. Here's what I set up:

  • auto_merge: enabled, min_confidence 0.98, max 20 merges per run, approval required
  • quality_monitor: enabled, runs hourly, alerts on >5% merge rate drop or >3% conflict rate rise

All auto-merge actions will land in your approval queue. Review them at any time by asking me "show pending agent actions."

Troubleshooting

"No API key" error on startup

Set KANONIV_API_KEY in the env block of your MCP client config. The server exits if no key is found.

Tools not appearing

Check that KANONIV_MCP_MODE is set to hybrid (default) and your MCP client supports the tools/list method. Try KANONIV_MCP_MODE=legacy if your client does not support resources.

"API error (401): Unauthorized"

Your API key is invalid or expired. Generate a new key from the dashboard.

"API error (403): Forbidden"

Your API key lacks permissions for the requested operation. Some actions (entity lock, revert, PII reveal) require admin role.

Resources return empty data

Resources respect tenant isolation. Ensure your API key is scoped to the correct tenant and that data has been ingested.

Profile restricts needed tools

Switch to KANONIV_MCP_TOOLS=all or add the specific category to your custom profile list.

The identity and delegation layer for AI agents.