kin
OfficialKin is a graph-native code repository MCP server: explore code structure, source, history and provenance, and make guardrailed atomic edits.
Search declarations by name, kind or language (
semantic_search), by exact literal (lexical_lookup), or by describing behavior (semantic_locate).Explore relationships: callers/importers/references (
find_references), dependencies and dependents (graph_neighborhood), ordered call chains (trace_data_flow), and routes between two entities (trace_path).Judge risk before a change with
impact_analysisover entity IDs or changes, and check authorship/approval history withkin_provenance_query.Read exact source by entity ID (
get_entity_source) or a bundled context pack of bodies, signatures and routes around entities or a question (get_context_pack).Inspect graph and embedding counts and settled-reading state (
kin_graph_status).Turn a folder into a Kin repository (
kin_init).Apply atomic entity patches, updates, creates, removes and import edits in one call (
kin_mutate).Do multi-step writes through transactions (begin, stage, commit, abort) that publish atomically or discard.
Manage agent write sessions with declared capabilities (read, write, branch, commit, execute) via start, heartbeat and end.
Run the project's toolchain (build/test/run) with
kin_session_exec, passing argv without a shell, with timeouts and output caps.
Allows importing existing Git repositories and exporting Kin repositories to Git, providing Git interoperability and version control history.
Kin is a graph-native code repository for AI agents and the people who build with them. It stores source, recorded code relationships, and versioned history as repository state. The graph is the repository model, not a search index maintained beside another repository.
Functions, types, and the relationships between them are data you commit, branch, and merge. Exact source is preserved byte for byte, and filesystem projections let supported tools keep working with ordinary files.
Public beta. Try Kin on a real project you know well. Expect rough edges.
Quickstart · Documentation · Browser demo
A star helps other people find Kin, and Discussions is where to bring a question about it.
See what connects
Before changing a shared function, what else should you inspect? Kin lets you look up its recorded callers and explore related code. The CLI and MCP server query the same graph, so you and your agent can work from the same record.
Recorded on a prepared ripgrep graph at e89fff89ac9af12e8d4ce9d5fd07beb408ca730f. Raw run artifacts are not public. This illustrates a workflow, not a performance benchmark.
Related MCP server: GraphHub
Use it from Claude Code, Codex or Cursor
For Claude Code:
/plugin marketplace add kinlab-ai/kin
/plugin install kin@kinFor Codex, add the marketplace and install the plugin, or let kin setup --intent agent write the MCP server into ~/.codex/config.toml for you.
For Cursor, add the MCP server by hand; see plugins/kin-cursor for the exact snippet.
After installing, run kin init . in a fresh clone of a project you know well; the kin-setup skill walks you through the rest.
Kin is not published on crates.io. The kin crate there is an unrelated project.
Quickstart
Start in a fresh, full clone of a project you know well. kin init reads your Git history without changing it or your tracked files. It keeps its store outside your checkout, in ~/.kin/stores, and writes nothing into the repository; kin store path prints where a checkout's store is. By default it admits the checked-out commit first, so questions answer as soon as that tree is read, and then imports every commit your branches and tags reach in the background, at low priority; kin init --history full imports the whole history up front, and --history none never imports it. Importing history takes time, memory and disk that grow with history rather than with the size of the checkout. Before it starts, kin init checks memory and free disk and stops with the numbers when it can already tell the machine is short. A shallow clone admits only its checked-out commit, and submodules and Git LFS are not supported, and Git hooks, a sparse checkout or an unfinished merge or rebase also stop the import. kin init names the fix for each, and a fresh clone avoids most of them.
1. Install
On macOS, Linux and WSL2, one command installs Kin and connects the AI coding tools it finds. It needs Node.js 20 or newer:
npx -y @kinlab/kin setupOn a machine without Node, run the installer instead. get.kinlab.ai and get.kinlab.dev
serve the same script:
curl -fsSL https://get.kinlab.dev/install | shEither way, reload your shell as a separate command, because the install puts kin in
~/.kin/bin and adds that directory to your shell profile for new sessions:
exec "$SHELL" -lOn native Windows x64, install from PowerShell with irm https://get.kinlab.dev/install.ps1 | iex.
It installs the kin CLI and does not connect AI coding tools, because WSL2 remains the
recommended path on Windows. The Windows entry under Beta limits
says what works there. No native Windows ARM64 build is published. On an ARM64 machine, run
that line from x64 PowerShell to install the x86_64 build under emulation, or use WSL2.
The installer adds kin to your user PATH, so open a new PowerShell window in place of
exec "$SHELL" -l before the next step.
For other installers or troubleshooting, see the full quickstart.
2. Initialize the repository
At the new prompt, clone a repository with Kin:
kin clone https://github.com/pallets/itsdangerousOr initialize one you already have, replacing the path below:
cd /path/to/your/repository &&
kin init . &&
kin overview &&
kin statusBoth end with the next command to run, a kin refs question about a function in that
repository. They also connect Codex CLI and Grok CLI to it when you allowed that in setup,
because those clients keep one entry that names a repository.
Windows PowerShell 5.1 has no &&, so on native Windows run the same commands one at a
time and stop if one fails:
cd C:\path\to\your\repository
kin init .
kin overview
kin statuskin overview shows the entities Kin imported. kin status shows what was admitted and the working tree's state against it. kin graph status reports the daemon's live query graph and coverage. Uncommitted and untracked changes are not part of the imported Git history; kin init reports what it left out.
3. Ask a question you can check
Look for something you already know is in the code:
kin locate "<something you already know is in this repository>"Replace ExactEntityName below with a symbol from the result:
kin refs ExactEntityName
kin trace ExactEntityName
kin impact ExactEntityNamerefs returns recorded references, trace brings in nearby context, and impact explores potential effects through the graph. Check the results against the source.
4. Your AI coding tools and semantic search
kin setup already asked before connecting the AI coding tools it found, and connected them
if you said yes. There is no separate linking step. After you install another tool, run
kin setup again, and kin setup status shows what is connected. On Windows, connect AI
tools inside WSL2.
kin runtime status --json checks the shared CLI and daemon installation, including
their exact source identity. Normal commands refuse mismatched pairs; development
builds use isolated state. See runtime installation.
Graph and lexical retrieval work without a model. Embeddings and reranking are optional,
and their model providers default to none. Standard CLI and daemon builds include external
HTTP model support. Built-in models require a build with optional local inference enabled.
To build an embedding index using an OpenAI-compatible endpoint you operate:
KIN_MODEL_EMBEDDINGS_PROVIDER=external \
KIN_MODEL_EMBEDDINGS_BASE_URL=http://localhost:1234/v1 \
KIN_MODEL_EMBEDDINGS_MODEL=your-served-embedding-model kin embedModel endpoints receive the selected entity text needed for their stage. Model settings describe providers, model identities, and credential environment variable names.
Kin supports Claude Code, Codex, Cursor, Gemini, and other MCP clients. Use kin setup --intent editor for VS Code. Kin also includes kin agent run for local or hosted OpenAI-compatible model endpoints.
Client configuration · MCP tools · Built-in agent
Local imports, storage, and graph queries run on your machine. Installing Kin needs network access; the default graph retrieval path needs no model download. When an embedding provider is selected, queries report its vector coverage and any gaps.
Review a change
After running kin init on the Git branch you want to review, compare explicit commit SHAs against main:
kin review shadow "$(git rev-parse main)..$(git rev-parse HEAD)"The report returns PASS, NEEDS ATTENTION, or WOULD BLOCK, with graph-derived impact and supporting evidence. It is advisory: it does not block a merge or change graph state. Authorship is declared, not independently verified.
Use Kin with or without Git
Kin has its own commits, branches, merges, diffs, and history, including in repositories with no Git underneath. Existing Git repositories can be imported, and supported workflows can export a new Git repository.
Native version-control walkthrough · Git interoperability and export limits
Beta limits
Coverage is incomplete. Supported languages are parsed into entities and relationships; other files remain available as content and history. An empty result does not prove there are no callers or dependencies. Keep using your compiler, tests, and review. See language support.
Compatibility varies. Release archives do not include the deprecated kin-vfs filesystem projection, so there is no transparent projection to rely on. Check platform notes for what each platform supports.
Back up Kin-only state. Commits, branches, reviews and specs you record with Kin live in the repository's Kin store, not in Git. Deleting the store and re-importing from Git does not recover them, so run kin backup create first. kin store prune deletes stores only when you pass --yes, for the same reason. Read the import, recovery, and upgrade notes.
Windows. Native Windows x86_64 support is early. Repository admission works: kin init imports a Git repository and publishes graph authority, and graph, lexical, and daemon-backed queries answer natively. The end-to-end install proof also runs agent setup on native Windows and gets graph-backed answers from the installed MCP server. Transparent filesystem projection is not shipped on Windows, and review workflows are not yet tested there, so WSL2 remains the recommended path for the full Kin experience.
Why I built Kin
I kept watching coding agents piece together parts of a codebase we'd already worked through. Then I'd do a version of that work myself to review their changes. I started wondering why more of that structural understanding wasn't part of the repository itself.
That's what I'm building with Kin.
Troy
Learn more and contribute
CLI reference · Architecture and detailed limits · Contributing · Issues · Security
Kin and its local stack, including kin-db, are Apache-2.0. KinLab is the separate proprietary hosted product. Public repository onboarding is still in development.
Available Tools
22 toolsfind_referencesBRead-onlyIdempotent
Callers, importers and references of one entity. Chains? trace_data_flow.
Inputs: query, entity_id, max_chars, answer_only, +1 more.
get_context_packCRead-onlyIdempotent
Bodies, signatures and routes around entities or a question, in one bundle.
Inputs: depth, entities, question, entity_id, +4 more.
get_entity_sourceCRead-onlyIdempotent
One entity's exact source, by id.
Inputs: entity_id (required).
graph_neighborhoodBRead-onlyIdempotent
What one entity depends on and what depends on it. Paths: trace_data_flow.
Inputs: entity_id (required), depth, limit, direction, +1 more.
impact_analysisCRead-onlyIdempotent
Every entity a change could affect, from entity_ids or change_ids.
Inputs: base, head, files, max_chars, +2 more.
kin_graph_statusCRead-onlyIdempotent
Graph and embedding counts. last_settled_selected_graph marks a last settled reading.
Inputs: no named parameters.
kin_initAIdempotent
Set a folder up as a Kin repository when it is not one.
Inputs: path.
kin_mutateBDestructive
Commit targeted entity changes atomically, in one call.
Inputs: operations (required), summary.
kin_provenance_queryBRead-onlyIdempotent
Who changed an entity, when, and whether it was approved.
Inputs: entity_id (required), limit.
kin_session_endBIdempotent
Session plumbing for writes. Close an open session.
Inputs: session_id (required).
kin_session_execBDestructive
Build, test or run this project with its toolchain. Session needs can_execute.
Inputs: argv (required), session_id (required), env, summary, +2 more.
kin_session_heartbeatB
Session plumbing for writes. Keep a session alive.
Inputs: session_id (required).
kin_session_startB
Session plumbing for writes. Open one; get a session_id.
Inputs: cwd (required), vendor (required), client_name (required), pid, +3 more.
kin_transaction_abortADestructiveIdempotent
Transaction plumbing for writes. Discard what is staged and close it.
Inputs: transaction_id (required), session_id.
kin_transaction_beginA
Transaction plumbing for writes. Open one; get a transaction_id.
Inputs: scope (required), session_id (required).
kin_transaction_commitBDestructiveIdempotent
Transaction plumbing for writes. Publish everything staged, atomically.
Inputs: transaction_id (required), message, operations, session_id.
kin_transaction_stageC
Transaction plumbing for writes. Stage an update, create, delete or rename.
Inputs: operations (required), transaction_id (required), session_id.
lexical_lookupBRead-onlyIdempotent
Exact literals, punctuation included, in stored graph fields. Lexical evidence only.
Inputs: kind, limit, cursor, literal, +1 more.
semantic_locateARead-onlyIdempotent
Find code by describing what it does. Know the exact name? semantic_search.
Inputs: limit, query, cursor, max_chars, +2 more.
semantic_searchCRead-onlyIdempotent
Declarations by name, kind or language. By meaning? semantic_locate.
Inputs: query (required), kind, limit, language, +1 more.
trace_data_flowARead-onlyIdempotent
The ordered call chain out from one entity. Two endpoints? trace_path.
Inputs: focal (required), depth, target, compact, +5 more.
trace_pathARead-onlyIdempotent
How one entity reaches another, as hops. One endpoint? trace_data_flow.
Inputs: to (required), from (required), limit, to_file, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Tools cover distinct retrieval modes (lexical, semantic by name vs. meaning, trace flow vs. path, references vs. neighborhood) and descriptions explicitly cross-reference to guide selection. Some overlap remains among graph query tools and between kin_mutate and transaction staging, but boundaries are mostly clear.
All names are snake_case, but prefixes and patterns are mixed: kin_* appears on session/transaction/init/mutate/status/provenance tools, while query tools use bare verb_noun or noun_noun forms. The set is readable but not fully consistent.
22 tools is borderline heavy for a code-graph server. The scope spans read queries, write/session/transaction plumbing, provenance, init, and execution, so most tools earn their place, but the count is on the high side.
The surface covers graph querying, entity mutation with transaction support, sessions, provenance, initialization, execution, and direct source retrieval. Minor gaps like bulk entity listing or file-level operations exist, but core lifecycle appears complete.
Maintenance
Related MCP Connectors
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Persistent knowledge graph for AI-augmented teams. Store decisions, findings, and standing rules across agent sessions with semantic search and typed connections. Includes cross-session memory, audit trail, workspace isolation, and secret detection. Built for teams running agents that need to remember. Free until launch with team tier as default, anon trial available.
Related MCP Servers
- AlicenseAqualityBmaintenanceKnot is a semantic and structural codebase indexer designed for AI coding agents and developers navigating large projects. It combines vector search and graph traversal to find code by meaning, analyze impact via reverse dependencies, and explore file architectures.711MIT
- AlicenseNot gradedqualityDmaintenanceTransforms codebases into a knowledge graph for AI agents, enabling semantic search, impact analysis, and persistent session memory with up to 94% token savings.15ISC
- AlicenseBqualityDmaintenanceTransforms codebases into structural knowledge graphs for AI agents and developers, providing precise architectural awareness and dependency mapping.1530MIT
- AlicenseNot gradedqualityBmaintenanceProvides a dependency graph of any local repository with tools for change impact, transitive dependents, health audits, and more, enabling AI coding agents to see structure and refactor safely.4MIT