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.
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.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceBuilds 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.2917MIT
- AlicenseNot gradedqualityAmaintenanceA 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.18MIT
- AlicenseAqualityAmaintenanceIndexes 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