TypeScript Definition Finder
Locates original definitions of TypeScript symbols in codebases, including imported symbols from external packages, returning both definition locations and code snippets
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., "@TypeScript Definition Finder find the definition of useState in my React component at line 15, column 25"
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.
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
Related MCP server: agent-workspace-mcp
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:
npx -y @smithery/cli install @runninghare/ts-def-mcp --client claudeManual Installation
Install dependencies:
bun installBuild the project:
bun run buildUsage
Start the stdio server:
node dist/run.jsTool Description
The server provides a find_typescript_definition tool with the following capabilities:
Tool Name:
find_typescript_definitionTrigger Command:
/ts-def(Useful inCursorif 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:
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";To find the definition of StdioServerTransport, which starts at column 10, you would use:
{
"file_path": "~/my-mcp-project/src/index.ts",
"line_content": "import { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";",
"column_number": 10
}The output of this tool will be:
[
{
"file": "~/my-mcp-project/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts",
"type": "Definition",
"location": "Line 9, Column 22",
"codeSnippet": " 8 */\n 9 > export declare class StdioServerTransport implements Transport {\n 10 + private _stdin;\n 11 + private _stdout;\n 12 + private _readBuffer;\n 13 + private _started;\n 14 + constructor(_stdin?: Readable, _stdout?: Writable);\n 15 + onclose?: () => void;\n 16 + onerror?: (error: Error) => void;\n 17 + onmessage?: (message: JSONRPCMessage) => void;\n 18 + _ondata: (chunk: Buffer) => void;\n 19 + _onerror: (error: Error) => void;\n 20 + /**\n 21 + * Starts listening for messages on stdin.\n 22 + */\n 23 + start(): Promise<void>;\n 24 + private processReadBuffer;\n 25 + close(): Promise<void>;\n 26 + send(message: JSONRPCMessage): Promise<void>;\n 27 }\n"
}
]Finding a Local Symbol Definition
For a local class usage:
class MyService {
private transport: StdioServerTransport;
}To find the definition of StdioServerTransport, which starts at column 20, use:
{
"file_path": "/path/to/project/src/service.ts",
"line_content": " private transport: StdioServerTransport;",
"column_number": 20
}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:
bun run index.tsLicense
[Add your license information here]
Contributing
[Add contribution guidelines here]
Available Tools
1 toolfind_typescript_definitionB
Use /ts-def to trigger this tool. This tool can find the definition of a TypeScript symbol in your codebase. When you encounter an imported symbol (e.g., 'import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"'), this tool will locate its original definition file and code. Simply provide the current file path, the symbol you want to find (e.g., 'StdioServerTransport'), and the line content containing that symbol.
Inputs: file_path (required), symbol (required), line_content (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct.
The single tool name 'find_typescript_definition' follows a clear verb_noun pattern, and with only one tool, consistency is inherently perfect.
A single tool is too few for a server named 'TypeScript Definition Finder', as it suggests a limited scope that might not cover related operations like searching multiple symbols or handling different import types. Typically, such a domain would benefit from additional tools for broader functionality.
The tool surface is severely incomplete for the domain. While it can find definitions, there are obvious gaps such as listing available symbols, handling bulk searches, or providing context about dependencies, which limits agent effectiveness in TypeScript code exploration.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
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.
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that enhances AI agents by providing deep semantic understanding of codebases, enabling more intelligent interactions through advanced code search and contextual awareness.90MIT- AlicenseAqualityDmaintenanceA TypeScript-aware MCP server that provides coding agents with repository discovery, code intelligence, and web project context for local codebases. It enables deep symbol navigation, diagnostic reporting, and structural analysis of monorepos without requiring full IDE integration.711 npm1MIT
- AlicenseNot gradedqualityBmaintenanceA self-hosted MCP and HTTP server for TypeScript code intelligence, providing AI agents with fast semantic code navigation tools like finding definitions, references, implementations, file outlines, dependency graphs, and search.143 npmAGPL 3.0
- AlicenseNot gradedqualityCmaintenanceA 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.16 npmMIT