typelatch
Indexes and searches npm package APIs and symbols from installed dependencies, using exact locked versions and registry integrity information.
Provides source and API context search across TypeScript projects, resolving imports, definitions, and types with the workspace compiler, and validating code changes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@typelatchquery zod@3.23.8 how to parse a date"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Typelatch

Search your workspace and its dependencies. Give Codex and Claude Code relevant source and API context, then verify changes with your TypeScript project.
Start with a question, without choosing a package or file first. Typelatch searches local source, internal functions, tests, docs, configuration, and available indexes for exact dependency versions. It returns a focused shortlist with source locations and visible coverage gaps. Use the workspace compiler and explicit assertions to check the changes that follow. Search runs locally through MCP or the terminal. Actual token use and time saved depend on the task and client; we do not claim measured agent savings.
npm package · See the walkthrough · Usage · Recorded evidence
Connect your agent
Requires Node.js 22.12 or newer and npm. The SQLite dependency uses a native binary. A platform without a suitable binary needs a working C++ build toolchain.
npm install --global typelatch@0.2.0
typelatch --helpChoose your client:
Codex
codex mcp add typelatch -- typelatch-mcpClaude Code
claude mcp add --transport stdio --scope user typelatch -- typelatch-mcpStart a new agent session in your TypeScript project, or restart it after upgrading so it discovers workspace_search. Workspace source is indexed on the first search and refreshed from file contents on later searches. To prepare direct dependency indexes, run typelatch sync inside an npm project with a lockfile. Search reports missing indexes and exact preparation commands; it does not download packages automatically. Usage covers workspace setup, configuration files, and running without a global installation.
Related MCP server: Component Library MCP Server
Search the whole workspace
When you do not know which file or package contains the answer, start with workspace_search:
{
"workspaceRoot": "/absolute/path/to/your/repo",
"question": "Where do we validate incoming requests?",
"limit": 8
}It searches source, internal declarations, tests, docs, configuration, and available indexes for exact installed or npm locked dependencies. No package name or TypeScript config is required. Source results include file locations and, for recognized declarations, symbol positions. The local workspace index refreshes from file contents on every search.
typelatch search "Where do we validate incoming requests?" --jsonRead the returned coverage: missing dependency indexes, exclusions, errors, and limits stay visible. Search does not download packages, resolve symbols with the project compiler, or run tests. Workspace search and agent workflow explains preparation and followup inspection.
The agent workflow is search, inspect, resolve, edit, validate. Use library_symbol for an exact dependency hit, workspace_context for compiler resolution in a real file, and workspace_validate for compilation and authorized assertions.
Eight authored repository questions returned the expected source file first in the workspace discovery regression. That is a regression result on known questions, not a measurement of general agent success. Verification details.
Watch the agent workflow
The task: contact imports leave partial data after a duplicate name. Find the implementation and make the whole batch roll back while preserving parameter binding.
The agent walkthrough includes a prompt you can give Codex or Claude Code, an isolated exercise, exact MCP requests, the source edit, and captured assertion output. It starts with workspace_search, without a package or file argument.
Agent action | What the recorded replay establishes |
Search the workspace and inspect the tests | Locate |
Validate before editing | Compilation passes, but the rollback assertion fails. |
Resolve the import and inspect the dependency API | The workspace uses |
Edit with normal file tools | Put all parameterized inserts inside the transaction callback. |
Refresh, resolve and validate again | Discovery sees the edit. Compilation, both unchanged assertions and recorded input stability pass. |
From a source checkout, prepare a broken exercise for your own agent or replay the captured workflow:
npm run showcase:agent:prepare
npm run showcase:agentThe replay executes real MCP calls and a CLI search against an isolated SQLite fixture. Its decision sequence is curated, not a recording of independent agent decisions or a claim about general coding success. Requests and results · Prompt, edit and reproduction.
A batch should succeed together or not at all
The actual question in the recorded run:
How can I import a batch of contacts into SQLite atomically, roll back every new row if a UNIQUE name constraint fails, and safely store a name containing a quote?
The SQLite fixture uses Kysely with better-sqlite3. The first search returned transaction, insertion, and constraint APIs. Jcode narrowed the question to the callback API with this actual MCP request against Typelatch's local SQLite index:
{
"name": "library_search",
"arguments": {
"package": "kysely",
"version": "0.28.8",
"question": "TransactionBuilder execute",
"limit": 5
}
}The results included esm/kysely.TransactionBuilder. The next request inspected that exact symbol:
{
"name": "library_symbol",
"arguments": {
"package": "kysely",
"version": "0.28.8",
"symbol": "esm/kysely.TransactionBuilder"
}
}The returned class begins at dist/esm/kysely.d.ts:623. Its signature includes:
execute<T>(callback: (trx: Transaction<DB>) => Promise<T>): Promise<T>;The implementation lets an insert error escape the callback so the batch rolls back. workspace_context resolved kysely@0.28.8. workspace_validate recorded compilation, assertions, and input stability as pass. Selected fields from its recorded execution result:
{
"command": ["npm", "test"],
"exitCode": 0,
"status": "pass"
}Two passing tests check parameter binding and whole batch rollback. A separate control without the transaction compiled but failed the rollback assertion. That difference is the point: finding an API and compiling its use do not establish database behavior.
These excerpts come from a real stdio MCP recording, captured with the published typelatch@0.1.1 package and an SDK client. The question and implementation were authored by Jcode. This is not a Codex or Claude Code session transcript. Inspect the capture and reproduce it.
Typelatch's own SQLite store has a different job: it holds indexed package APIs. library_search queries that local store. The recording also includes a separate read only audit of brains/kysely/0.28.8/brain.db inside its data directory. That audit is not an MCP tool. There is no MCP tool for arbitrary SQL queries.
For terminal discovery:
typelatch query kysely@0.28.8 "TransactionBuilder execute" --json --limit 5Try the same task in your agent, with an explicit assertion command and a report that keeps retrieval, resolution, compilation, and execution separate.
Seven tools, one local server
Tool | What it does |
| Discover relevant workspace files and exact dependency APIs without choosing a package first |
| Search an installed package index by question and exact version |
| Look up an exact symbol and its relationships |
| Resolve imports, definitions, and types with the workspace compiler |
| Compile the project, then optionally run an explicit assertion command |
| Record an agent reported outcome for a prior query |
| Read local query, latency, context size, and outcome aggregates |
Retrieval is not compilation. Compilation is not execution. Context resolution does neither, and agent feedback stays separate from tool executed evidence. Request examples and evidence states explain what each result establishes.
Keep the evidence close
An index records the package name, exact version, registry integrity, and source locations. Downloads verify registry integrity without running package lifecycle scripts. Once indexed, search works offline. In an npm project, typelatch add kysely uses the locked version when available. typelatch sync indexes direct locked dependencies.
Indexes and query history live in ~/.typelatch. Set TYPELATCH_HOME to choose another directory or TYPELATCH_USAGE=off to disable query and validation recording. The application does not upload query history. Workspace validation loads the trusted project compiler and can run an explicitly supplied command with your permissions. Security and local data.
The recorded development suites exercise retrieval, workspace scenarios, and negative controls. These are authored regression cases, not a measurement of general coding agent success. Inspect the reports and methodology.
npm run benchmark
npm run benchmark:workspace
npm run prove:supportRun those commands from a source checkout. See contributing for source setup and release checks for package verification.
Typelatch currently supports npm packages with TypeScript declarations or usable TypeScript sources, npm lockfiles, and local TypeScript projects. Architecture describes the boundaries. Hosted indexes, other languages, and coordinated changes across repositories are outside this release.
This server cannot be deployed
Maintenance
Related MCP Connectors
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
Serves your design system and coding standards to coding agents, so they stop guessing.
Browser-local and CLI static evidence for deployed AI model artifacts.
Public social-data API and live docs for AI coding agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to understand and work with TypeScript APIs they haven't been trained on by providing structured access to TypeScript type definitions and documentation.11 npm46MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with access to private React component library documentation, props, and code examples through type-safe TypeScript integration.-
- AlicenseBqualityDmaintenanceExposes TypeScript Language Server Protocol functionality to AI agents, enabling them to query types at specific positions, find definitions and references, get diagnostics, run type tests, and type-check inline code just like in an IDE.931 npm3MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to interact with TypeScript projects through compiler-level code intelligence, providing tools for navigation, type information, diagnostics, refactoring, and semantic search.29122 npm3Apache 2.0