Integrations
Locates original definitions of TypeScript symbols in codebases, including imported symbols from external packages, returning both definition locations and code snippets
TypeScript Definition Finder MCP Server
A Model Context Protocol (MCP) server that helps AI code editors find TypeScript symbol definitions in your codebase. This tool is particularly useful when you need to locate the original definition of imported symbols, classes, interfaces, or functions in a TypeScript project.
Features
- Finds original definitions of TypeScript symbols
- Works with imported symbols from external packages
- Returns both the definition location and code snippet
- Supports stdio interface for seamless integration with AI code editors
Prerequisites
- Bun v1.2.2 or later
- Node.js for running the compiled server
Installation
Installing via Smithery
To install TypeScript Definition Finder for Claude Desktop automatically via Smithery:
Manual Installation
- Install dependencies:
- Build the project:
Usage
Start the stdio server:
Tool Description
The server provides a find_typescript_definition
tool with the following capabilities:
- Tool Name:
find_typescript_definition
- Trigger Command:
/ts-def
(Useful inCursor
if you want to force AI editor to find the referenced symbol definition) - Purpose: Locates the original definition of TypeScript symbols in your codebase
Input Parameters
The tool requires three parameters:
file_path
(string):- The absolute path to the current TypeScript file
- Example:
/path/to/your/project/src/index.ts
line_content
(string):- The entire line containing the symbol you want to find the definition of
- Used to locate the correct line in the file
- Must match the line exactly as it appears in the file
column_number
(number):- The 1-based column number where the symbol starts
- Must be the exact column position of the symbol's first character
Examples
- Finding an Imported Symbol Definition
Given this import statement:
To find the definition of StdioServerTransport
, which starts at column 10, you would use:
The output of this tool will be:
- Finding a Local Symbol Definition
For a local class usage:
To find the definition of StdioServerTransport
, which starts at column 20, use:
Response Format
The tool returns a JSON response containing:
- The file path where the definition was found
- The line number of the definition
- The actual code snippet of the definition
Claude Desktop Example
Development
This project was created using bun init
in bun v1.2.2. Bun is a fast all-in-one JavaScript runtime.
Running in Development Mode
For development, you can run the server directly using Bun:
License
[Add your license information here]
Contributing
[Add contribution guidelines here]
This server cannot be installed
A Model Context Protocol server that helps AI code editors locate TypeScript symbol definitions in codebases, particularly useful for finding original definitions of imported symbols and classes.