home / mcp / typescript definitions mcp server

TypeScript Definitions MCP Server

Supercharge your test mocking with intelligent TypeScript type definitions for Claude Code

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "blakeyoder-typescript-definitions-mcp": {
      "command": "typescript-definitions-mcp",
      "args": []
    }
  }
}

This MCP server gives Claude Code instant access to your TypeScript definitions so your AI-generated mocks, tests, and prompts stay perfectly aligned with your real code. It works across React, Vue, Angular, Node, and more—simply point it at your project and let Claude Code reason with exact type information from your dependencies.

How to use

You connect Claude Code to this MCP server to enable automatic, type-safe mock and test data generation. Start by ensuring the MCP server is running, then tell Claude Code to add it as a local MCP source. Once connected, you can ask for exact interfaces, type structures, and complete mocks that reflect your real code.

Typical usage patterns include requesting the full structure of a type from a specific package, generating complete mocks for complex props, and validating mock data against accurate type definitions. You can also search for interfaces by pattern (for example, props interfaces ending with Props) and inspect exported types from a chosen package.

To finalize the connection, provide Claude Code with the MCP server details using the integration command shown in the installation steps. This enables Claude Code to reach your project’s TypeScript definitions without scanning node_modules manually.

How to install

Prerequisites: you need Node.js and npm installed on your system. You also need Claude Code installed and ready to use with MCPs.

Step 1. Clone the MCP server repository and install dependencies.

git clone https://github.com/blake-yoder/typescript-definitions-mcp.git
cd typescript-definitions-mcp
npm install
npm run build

Step 2. Install the MCP server globally so you can run it from any project.

npm install -g .

Step 3. Add the MCP server to Claude Code so it can start using it in your projects.

claude mcp add typescript-definitions -- typescript-definitions-mcp

Option A. User-wide configuration (works in all projects). Create or edit your MCP servers config for Claude Code.

{
  "typescript-definitions": {
    "command": "typescript-definitions-mcp",
    "args": []
  }
}

Option B. Project-specific configuration. Place this in your TypeScript project root as ".mcp.json".

{
  "mcpServers": {
    "typescript-definitions": {
      "command": "typescript-definitions-mcp",
      "args": []
    }
  }
}

Troubleshooting and notes

If the MCP server isn’t connecting, double-check the JSON syntax in your Claude Code MCP config, ensure the MCP command is in your PATH, and restart Claude Code completely. You can verify the server version to confirm it’s reachable.

If Claude Code can’t locate TypeScript definitions in your project, make sure you’re running Claude Code from your TypeScript project directory, confirm tsconfig.json exists, and ensure your project builds with npx tsc --noEmit.

Available tools

lookup_type

Find specific interfaces, types, or classes in your TypeScript project and dependencies.

find_interfaces

Search for interfaces using patterns (for example, *Props or User*).

get_package_types

Retrieve all exported types from a specific package.

validate_type_usage

Check that your code uses types as intended.

check_type_compatibility

Verify if two types are compatible across your codebase.