tsconfig-inheritance-flattener-mcp
Resolves the full TypeScript config inheritance chain and returns effective compiler options, resolves path aliases, and validates project references.
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., "@tsconfig-inheritance-flattener-mcp What compiler options actually apply to /project/apps/web/tsconfig.json?"
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.
π tsconfig-inheritance-flattener-mcp
Your AI agent reads tsconfig.json. It has no idea what it actually means.
MCP server that resolves the full TypeScript config inheritance chain and returns the effective compiler options that actually apply β including everything inherited from extended base configs, monorepo packages, and node_modules presets.
π€ The problem
Your agent reads tsconfig.json and sees:
{ "extends": "@tsconfig/strictest", "compilerOptions": { "paths": { "@/*": ["./src/*"] } } }It has no idea that @tsconfig/strictest sets strict: true, noUncheckedIndexedAccess: true, exactOptionalPropertyTypes: true. It doesn't know that baseUrl is defined two levels up in your monorepo base config. So it:
Suggests code that would fail
noUncheckedIndexedAccessGets confused about what
@/resolves toDoesn't know your
targetisES2022, notES5Gives wrong answers about module resolution
The TypeScript compiler API already resolves all of this. This MCP just exposes it.
Related MCP server: @aiready/ast-mcp-server
π οΈ Tools
get_effective_compiler_options
Resolves the full extends chain and returns the merged compiler options that actually apply to a given tsconfig.json. Shows the inheritance chain, all merged options (with enums as readable strings, not magic numbers), and include/exclude patterns.
Effective TypeScript Configuration
Config: /project/apps/web/tsconfig.json
Inheritance chain: /project/apps/web/tsconfig.json
β /project/tsconfig.base.json
β node_modules/@tsconfig/strictest/tsconfig.json
Compiler Options (merged):
target: "ES2022"
module: "NodeNext"
moduleResolution: "NodeNext"
strict: true
noUncheckedIndexedAccess: true
exactOptionalPropertyTypes: true
baseUrl: "/project"
paths: { "@/*": ["apps/web/src/*"] }resolve_module_alias
Maps a TypeScript path alias (e.g. @/hooks/useAuth) to its physical file location on disk, using the resolved paths and baseUrl from the tsconfig. Returns all existing candidates with extension probing.
Alias Resolution: @/hooks/useAuth
Config: /project/apps/web/tsconfig.json
Base URL: /project
Resolved physical paths:
/project/apps/web/src/hooks/useAuth.ts β existsanalyze_project_references
Inspects the references array in a root tsconfig.json and validates that each referenced package has composite: true. Catches broken cross-package dependencies in TypeScript monorepos before they cause silent build failures.
Project References Analysis
Config: /project/tsconfig.json
References found: 2
[β] packages/shared β /project/packages/shared/tsconfig.json
[β NOT FOUND] packages/deprecated β /project/packages/deprecated/tsconfig.json
Violations:
β packages/shared is referenced but does not have composite: true
Fix: add "composite": true to packages/shared/tsconfig.jsonπ§ͺ What it looks like in practice
Agent is helping debug a TypeScript error and asks:
"What compiler options are actually active in this project?"
Without this MCP, the agent guesses based on what it sees in tsconfig.json. With it:
get_effective_compiler_options("/project/apps/web/tsconfig.json")
β strict: true, noUncheckedIndexedAccess: true, target: "ES2022", module: "NodeNext"Now the agent knows exactly why arr[0] has type string | undefined and not just string. No more wrong suggestions.
β‘ Setup
{
"mcpServers": {
"tsconfig-flattener": {
"command": "npx",
"args": ["-y", "tsconfig-inheritance-flattener-mcp"]
}
}
}π Usage
"What compiler options actually apply to
/project/apps/web/tsconfig.json? It extends a monorepo base and @tsconfig/strictest."
"Where does
@/components/Buttonresolve to on disk?"
"Are the project references in my root tsconfig valid? Do all referenced packages have composite: true?"
Works great alongside:
ast-impact-mapper-mcp β for codeβtest correlation
release-readiness-triage-mcp β for CI triage
π¦ Links
License
MIT
Available Tools
6 toolsanalyze_project_referencesA
Inspect a tsconfig.json's project references array and validate that each referenced package has composite:true enabled. Detects missing or broken cross-package references in TypeScript monorepos that would cause silent build failures.
Inputs: configPath (required).
detect_config_overlapsA
Find source files compiled by more than one tsconfig simultaneously and surface option conflicts (strict, module, target, etc.) between them. Essential for monorepos where tsconfig.app.json and tsconfig.spec.json share the same src/ tree with incompatible settings.
Inputs: configPaths (required).
explain_emission_structureA
Build a virtual tree of what TypeScript will emit for each source file β compiled JS, declaration (.d.ts), and source map paths β without running the compiler. Useful when an agent needs to predict where output files will land or debug rootDir/outDir misconfigurations.
Inputs: configPath (required).
get_effective_compiler_optionsA
Resolve the full tsconfig.json inheritance chain and return the final merged compiler options that actually apply β including options inherited from extended base configs in node_modules or monorepo packages. Eliminates agent hallucinations about strict mode, moduleResolution, paths, and target.
Inputs: configPath (required), includeRaw.
resolve_module_aliasA
Map a TypeScript path alias (e.g. @/components/Button or @utils/format) to its physical file location on disk, using the paths and baseUrl from the resolved tsconfig. Useful when an agent needs to navigate to the actual file behind an import.
Inputs: alias (required), configPath (required).
simulate_module_resolutionA
Run TypeScript's exact module resolution algorithm for a given import and return the resolved file path plus every candidate path that was tried and rejected. Eliminates guesswork about why an import resolves (or fails to resolve) under Node16/NodeNext/Bundler strategies.
Inputs: configPath (required), moduleName (required), containingFile (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool targets a distinct aspect of TypeScript configuration analysis, from compiler options to module resolution to emission structure. Even the two resolution-related tools are clearly differentiated: one maps path aliases, the other simulates the full resolution algorithm. No ambiguity.
All tool names follow a consistent snake_case verb_noun pattern (get_, resolve_, analyze_, explain_, simulate_, detect_). The verbs are all distinct and clearly describe the action, making the set highly predictable.
With 6 tools, the server is well-scoped for its purposeβcovering the essential operations for tsconfig inheritance and resolution without bloat. Each tool fills a specific need, and the count is appropriate for a utility server of this kind.
The toolset comprehensively covers the main pain points in TypeScript configuration: effective compiler options, alias resolution, project references, emission output, module resolution, and overlapping configs. There are no obvious gaps that would leave an agent stuck.
Maintenance
Related MCP Connectors
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
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.
Research-backed lint + generation for agent context files (CLAUDE.md, AGENTS.md) + prompt enhancer.
Enforces architectural invariants and code quality rules inside your AI agent's edit loop.
Related MCP Servers
- 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.9540 npm3MIT
- AlicenseNot gradedqualityCmaintenanceAST-aware TypeScript/JavaScript codebase exploration for AI agents, providing high-precision symbol resolution, reference finding, and structural analysis via MCP tools.216 npmMIT
- AlicenseAqualityDmaintenanceProvides real-time TypeScript diagnostics with intelligent caching for AI agents, enabling instant queries instead of running tsc repeatedly.932 npm3MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to interact with TypeScript projects through compiler-level code intelligence, providing tools for navigation, type information, diagnostics, refactoring, and semantic search.29333 npm5Apache 2.0