tsconfig-inheritance-flattener-mcp

tsconfig-inheritance-flattener-mcp

Resolves TypeScript config inheritance chains to reveal effective compiler options, resolves path aliases to physical files, and validates project references for AI agents.

Category
Visit Server

README

πŸ” tsconfig-inheritance-flattener-mcp

npm CI License: MIT

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 noUncheckedIndexedAccess
  • Gets confused about what @/ resolves to
  • Doesn't know your target is ES2022, not ES5
  • Gives wrong answers about module resolution

The TypeScript compiler API already resolves all of this. This MCP just exposes it.


πŸ› οΈ 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      βœ“ exists

analyze_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/Button resolve to on disk?"

"Are the project references in my root tsconfig valid? Do all referenced packages have composite: true?"

Works great alongside:


πŸ“¦ Links

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured