ts-code-awareness
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., "@ts-code-awarenessWhat actually runs when POST /users is hit?"
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.
ts-code-awareness
A static-analysis knowledge base for TypeScript / NestJS codebases, served to AI agents (like Claude Code) over MCP — so they can understand code without hallucinating and without spending many tokens.
It reads the source under a project root (it never boots the target app's runtime), builds a queryable map, and exposes framework-aware tools an LSP can't give you: DI graphs, route tables, the Nest guard/pipe/interceptor pipeline, the Prisma schema, and the entity↔code bridge — plus structural discovery, semantic search, and optional read-only live-data tools.
Why
TypeScript already ships a type checker and a language server, so "types,
go-to-def, find-references" are table stakes. The differentiation here is the
framework-aware, pre-digested views no LSP gives you, returned as compact,
chainable projections instead of raw source. An agent asks "what actually runs
when POST /users is hit, and where does it touch the DB?" and gets an answer
built from the route pipeline, the call graph, and the ORM access map — not a
pile of files to re-read.
Every answer is honest about its own completeness: reverse queries carry a
coverage envelope, call edges are tagged exact | contract | unresolved, and DB
access is tagged typed | heuristic. The engine never claims certainty it can't
prove.
Related MCP server: arcscope
What it does
Structural map — symbols, signatures, decorators, and a resolved edge graph (imports, calls, extends/implements/overrides, references, instantiations) across a whole pnpm/npm/yarn + nx/turbo monorepo, with cross-package resolution and a two-tier build (cheap skeleton for everything, full call graph on demand).
NestJS adapter — the route table, DI/provider graph, module graph, and
nest_pipeline_for(the effective guard → interceptor → pipe → filter chain for a handler, composed across all five registration levels in execution order). GraphQL resolvers and microservice/queue handlers when those packages are used.Prisma adapter —
schema.prisma→ models / relations / enums, the model↔code access bridge ("where isUserwritten, with which fields"), and static migration/drift reports. The generated client is never read.Semantic search — NL discovery (
search,search_similar) over a local, on-machine embedding index. Nothing leaves the machine.Live data (optional, opt-in) — read-only
data_*tools against a configured DB connection, behind a SELECT-only guard that provably never mutates.
The full tool catalog is in docs/tools.md (~35 tools across
five categories; framework/DB/live tools light up only on detection).
Architecture
A single shared, multi-tenant HTTP daemon — started by a Claude Code
SessionStart hook — holds warm maps under an LRU and routes each session to its
project by an X-Project-Root header. A per-session stdio MCP shim forwards
tool calls to it. The daemon walks the program once with ts-morph; adapters
(Nest, Prisma) read that one parsed program and contribute namespaced fragments,
so nothing framework-specific runs unless its framework is detected.
Claude Code session
│ spawns (stdio, cwd = project)
▼
mcp-server ── HTTP /rpc, header X-Project-Root: <cwd> ──► daemon (shared, long-lived)
(per-session shim) │ ts-morph walk → SQLite map
▼
core + nest/prisma adapters → toolsLayout
packages/
core/ ts-morph walk → base map + tiers + fingerprint/incremental,
adapter registry, semantic index; SQLite store (node:sqlite)
adapter-nest/ routes, DI/module graph, guard/pipe/interceptor/filter pipeline,
GraphQL + messaging
adapter-prisma/ schema → models/relations, model↔code access bridge, migrations
live-data/ optional read-only DB tools behind a SELECT-only guard
daemon/ shared multi-tenant HTTP daemon + LRU + X-Project-Root routing
mcp-server/ stdio MCP shim (per session; forwards to the daemon)
plugin/ Claude Code SessionStart hook + MCP wiring
fixtures/ golden nx/pnpm monorepo (Nest + Prisma) test bed
docs/tools.md the MCP tool referenceUse it with Claude Code
The engine is wired as a Claude Code plugin via plugin/ — see
plugin/README.md. In short: a SessionStart hook starts
the shared daemon, .mcp.json registers the stdio shim as the ts-code-awareness
MCP server, and Claude Code asks you to approve it on first use. Opening this repo
in Claude Code (and approving ts-code-awareness) gives you the tools over this
repo's own TypeScript.
Develop
pnpm install
# typecheck the whole workspace
pnpm typecheck
# the test suites (run against the golden fixture)
pnpm test:tiers # structural map + incremental build
pnpm test:nest # routes / DI / pipeline
pnpm test:prisma # schema + model↔code bridge
pnpm test:semantic # semantic search
pnpm test:live # live-data guard + drivers (spins up throwaway DBs)
# run the daemon, then curl it
pnpm --filter @codehead-pl/tsca-daemon start
curl -s localhost:47600/health
# drive the MCP shim the way Claude Code does
pnpm exec tsx packages/mcp-server/test/client.ts "$PWD/fixtures/nest-monorepo"
# compile to dist/
pnpm buildRequirements: Node ≥ 22.5 (uses built-in node:sqlite — no native modules).
Dev runs TypeScript directly via tsx; pnpm build compiles with tsup.
Roadmap
Where it's headed — more framework and database adapters, cross-cutting bridges,
and a community adapter SDK — is in ROADMAP.md.
License
MIT © Michał Tomczuk
This server cannot be deployed
Maintenance
Related MCP Connectors
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceBuilds rich code graphs from TypeScript/NestJS codebases using AST analysis and Neo4j, enabling semantic search, natural language querying, and intelligent graph traversal to provide deep contextual understanding of code relationships and dependencies.85 npm17MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that gives AI coding agents symbol definitions, dependency graphs, and a live architecture vocabulary for TypeScript/JavaScript repos, with no network or embeddings.16 npmMIT
- AlicenseAqualityBmaintenanceIndexes any TypeScript / React / Next.js repo into a queryable code graph and exposes 13 MCP tools — who-renders, who-calls, find-references, blast-radius, find-cycles, dead-code orphans, and local semantic search — so agents query structure instead of reading whole files. Built on ts-morph, so edges are resolved, not grepped.142MIT
- AlicenseNot gradedqualityAmaintenanceSemantic code intelligence MCP server for TypeScript/JavaScript codebases, enabling AI agents to retrieve specific symbols, types, and relationships without reading entire files.20MIT