Skip to main content
Glama
runninghare

TypeScript Definition Finder

by runninghare

Buscador de definiciones de TypeScript MCP Server

insignia de herrería

Un servidor de Protocolo de Contexto de Modelo (MCP) que ayuda a los editores de código de IA a encontrar definiciones de símbolos de TypeScript en su código base. Esta herramienta es especialmente útil cuando se necesita localizar la definición original de símbolos, clases, interfaces o funciones importadas en un proyecto de TypeScript.

Características

  • Encuentra definiciones originales de símbolos de TypeScript

  • Funciona con símbolos importados de paquetes externos

  • Devuelve tanto la ubicación de la definición como el fragmento de código.

  • Admite la interfaz stdio para una integración perfecta con los editores de código de IA

Related MCP server: agent-workspace-mcp

Prerrequisitos

  • Bun v1.2.2 o posterior

  • Node.js para ejecutar el servidor compilado

Instalación

Instalación mediante herrería

Para instalar TypeScript Definition Finder para Claude Desktop automáticamente a través de Smithery :

npx -y @smithery/cli install @runninghare/ts-def-mcp --client claude

Instalación manual

  1. Instalar dependencias:

bun install
  1. Construir el proyecto:

bun run build

Uso

Inicie el servidor stdio:

node dist/run.js

Descripción de la herramienta

El servidor proporciona una herramienta find_typescript_definition con las siguientes capacidades:

  • Nombre de la herramienta : find_typescript_definition

  • Comando de activación : /ts-def (útil en Cursor si desea forzar al editor de IA a encontrar la definición del símbolo referenciado)

  • Propósito : Localiza la definición original de los símbolos de TypeScript en su base de código

Parámetros de entrada

La herramienta requiere tres parámetros:

  1. file_path (cadena):

    • La ruta absoluta al archivo TypeScript actual

    • Ejemplo: /path/to/your/project/src/index.ts

  2. line_content (cadena):

    • La línea completa que contiene el símbolo cuya definición desea encontrar

    • Se utiliza para localizar la línea correcta en el archivo.

    • Debe coincidir con la línea exactamente como aparece en el archivo

  3. column_number (número):

    • El número de columna basado en 1 donde comienza el símbolo

    • Debe ser la posición exacta de la columna del primer carácter del símbolo

Ejemplos

  1. Encontrar una definición de símbolo importado

Dada esta declaración de importación:

import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

Para encontrar la definición de StdioServerTransport , que comienza en la columna 10, deberá utilizar:

{
  "file_path": "~/my-mcp-project/src/index.ts",
  "line_content": "import { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";",
  "column_number": 10
}

La salida de esta herramienta será:

[
  {
    "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"
  }
]
  1. Encontrar una definición de símbolo local

Para un uso de clase local:

class MyService {
  private transport: StdioServerTransport;
}

Para encontrar la definición de StdioServerTransport , que comienza en la columna 20, utilice:

{
  "file_path": "/path/to/project/src/service.ts",
  "line_content": "  private transport: StdioServerTransport;",
  "column_number": 20
}

Formato de respuesta

La herramienta devuelve una respuesta JSON que contiene:

  • La ruta del archivo donde se encontró la definición

  • El número de línea de la definición

  • El fragmento de código real de la definición

Ejemplo de escritorio de Claude

Desarrollo

Este proyecto se creó con bun init en bun v1.2.2. Bun es un entorno de ejecución de JavaScript rápido y completo.

Ejecutando en modo de desarrollo

Para el desarrollo, puedes ejecutar el servidor directamente usando Bun:

bun run index.ts

Licencia

[Agregue la información de su licencia aquí]

Contribuyendo

[Agregue pautas de contribución aquí]

Available Tools

1 tool
find_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesThe absolute path to the current typescript file (e.g., '/remote/.../src/index.ts')
symbolYesThe TypeScript symbol (variable, class name, interface, type, etc.) you want to find the definition of. This symbol must be present in the line_content.
line_contentYesThe entire line containing the symbol you want to find the definition of. The line content will be used to find both the line number in the file and the exact position of the symbol.

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it explains what the tool does (finds definitions) and provides usage examples, it doesn't disclose important behavioral traits like error conditions, performance characteristics, rate limits, authentication needs, or what happens when symbols aren't found. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the triggering mechanism and core purpose. Each sentence adds value: the first explains triggering, the second states the purpose, the third provides usage context, and the fourth explains parameter usage. There's minimal redundancy, though the final sentence could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there's no output schema and no annotations, the description provides adequate basic information about what the tool does and how to use it. However, for a tool that performs code analysis (potentially complex), it lacks information about return format, error handling, and limitations. The description is complete enough for basic understanding but leaves important contextual gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already fully documents all three parameters. The description adds some context about how parameters relate ('symbol must be present in the line_content') and provides examples, but doesn't add significant semantic meaning beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'find the definition of a TypeScript symbol in your codebase' with specific examples. It uses the verb 'find' and identifies the resource 'TypeScript symbol definition'. However, since there are no sibling tools mentioned, it cannot demonstrate differentiation from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool: 'When you encounter an imported symbol... this tool will locate its original definition file and code.' It gives specific examples and explains the triggering mechanism ('/ts-def'). However, it doesn't explicitly state when NOT to use it or mention any alternatives since no siblings exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool update
    • First observedfind_typescript_definition

TDQS

B3.4/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct.

Naming Consistency5/5

The single tool name 'find_typescript_definition' follows a clear verb_noun pattern, and with only one tool, consistency is inherently perfect.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    A 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.
    91
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A 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.
    7
    15 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A 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.
    344 npm
    AGPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    A 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 npm
    MIT