Model Context Protocol server that locates original TypeScript symbol definitions, including imported symbols, returning precise file locations and code snippets for seamless AI code editor integration.
Unlock the full potential of TypeScript Definition Finder through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available • No credit card required
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.
To install TypeScript Definition Finder for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @runninghare/ts-def-mcp --client claude
bun install
bun run build
Start the stdio server:
node dist/run.js
The server provides a find_typescript_definition
tool with the following capabilities:
find_typescript_definition
/ts-def
(Useful in Cursor
if you want to force AI editor to find the referenced symbol definition)The tool requires three parameters:
file_path
(string):
/path/to/your/project/src/index.ts
line_content
(string):
column_number
(number):
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 */ 9 > export declare class StdioServerTransport implements Transport { 10 + private _stdin; 11 + private _stdout; 12 + private _readBuffer; 13 + private _started; 14 + constructor(_stdin?: Readable, _stdout?: Writable); 15 + onclose?: () => void; 16 + onerror?: (error: Error) => void; 17 + onmessage?: (message: JSONRPCMessage) => void; 18 + _ondata: (chunk: Buffer) => void; 19 + _onerror: (error: Error) => void; 20 + /** 21 + * Starts listening for messages on stdin. 22 + */ 23 + start(): Promise; 24 + private processReadBuffer; 25 + close(): Promise; 26 + send(message: JSONRPCMessage): Promise; 27 } " } ]
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 }
The tool returns a JSON response containing:
This project was created using bun init
in bun v1.2.2. Bun is a fast all-in-one JavaScript runtime.
For development, you can run the server directly using Bun:
bun run index.ts
[Add your license information here]
[Add contribution guidelines here]
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!