Token导航 LogoToken导航TokenDH.com
Typescript Definition Finder MCP logo
开发工具stdio官方级别未说明来源级核验

Typescript Definition Finder MCP

MCP Server

@smithery/cli

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.

工具数

1

提示词数

0

GitHub Stars

2

资源数

0
TypeScript开发代码导航JavaScriptClaudeClaudeCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

runninghare

提供方

runninghare

最后核验

2026/5/18 02:17

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install @runninghare/typescript-definition-finder-mcp --client claude

详细介绍

](https://mseep.ai/app/runninghare-typescript-definition-finder-mcp)

TypeScript定义查找器MCP服务器

](https://smithery.ai/server/@runninghare/typescript-definition-finder-mcp)

一个模型上下文协议(MCP)服务器,帮助AI代码编辑器在代码库中找到TypeScript符号定义。当您需要在TypeScript项目中定位导入的符号、类、接口或函数的原始定义时,此工具特别有用。

特性

  • 查找TypeScript符号的原始定义
  • 使用从外部包导入的符号
  • 返回定义位置和代码段
  • 支持stdio接口,可与AI代码编辑器无缝集成

先决条件

  • TypeScript项目 typescript 已安装依赖项
  • Node.js用于运行服务器

安装与使用

这是一个模型上下文协议(MCP)stdio服务器,需要访问本地文件系统才能找到TypeScript定义。

通过Smithery安装

通过以下方式自动安装克劳德桌面的TypeScript定义查找器MCP 史密瑟里:

npx -y @smithery/cli install @runninghare/typescript-definition-finder-mcp --client claude

运行MCP服务器

要使用MCP服务器,请执行以下操作:

  1. 确保你的项目安装了TypeScript作为依赖项
  2. 在项目目录中运行以下命令:
npx -y ts-def-mcp@latest

您可以将此命令与支持MCP的各种AI代码编辑器集成:

  • 克劳德桌面
  • 光标
  • 帆板运动
  • Roo Cline编辑
重要提示:由于本地文件系统访问要求,Docker+WebSocket解决方案将无法工作。请忽略上的安装指南https://smithery.ai/server/@runinghare/typescript定义查找器mcp。

工具说明

服务器提供 find_typescript_definition 具有以下功能的工具:

  • 工具名称: find_typescript_definition
  • 触发命令: /ts-def (如果你想强制AI编辑器找到引用的符号定义,在“光标”中很有用)
  • 目的:在代码库中查找TypeScript符号的原始定义

输入参数

该工具需要三个参数:

  1. file_path (字符串):

- 当前TypeScript文件的绝对路径 - 例子: /path/to/your/project/src/index.ts

  1. symbol (字符串):

- 您要查找的TypeScript符号(变量、类名、接口、类型等)的定义 - 必须存在于line_content中 - 例子: StdioServerTransport, MyClass, interface1

  1. line_content (字符串):

- 包含要查找的符号定义的整行 - 用于定位文件中的行号和符号的确切位置 - 必须包含与指定完全一致的符号

例子

  1. 查找导入的符号定义

鉴于此进口声明:

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

找到以下定义 StdioServerTransport,您将使用:

{
  "file_path": "~/my-mcp-project/src/index.ts",
  "symbol": "StdioServerTransport",
  "line_content": "import { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";"
}
  1. 查找本地符号定义

对于本地类用法:

class MyService {
  private transport: StdioServerTransport;
}

找到以下定义 StdioServerTransport,使用:

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

响应格式

该工具返回一个JSON响应,其中包含:

  • 找到定义的文件路径
  • 定义的行号
  • 定义的实际代码片段

游标调用示例

MCP输入:

{
  "file_path": "/Users/rossz/workspace/ai-tools/mcp/ts-def-mcp/src/index.ts",
  "symbol": "SSEServerTransport",
  "line_content": "import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';"
}

MCP输出:

[
  {
    "file": "/Users/rossz/workspace/ai-tools/mcp/ts-def-mcp/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.d.ts",
    "type": "Definition",
    "location": "Line 9, Column 22",
    "codeSnippet": "   8    */\n   9 > export declare class SSEServerTransport implements Transport {\n  10 +     private _endpoint;\n  11 +     private res;\n  12 +     private _sseResponse?;\n  13 +     private _sessionId;\n  14 +     onclose?: () => void;\n  15 +     onerror?: (error: Error) => void;\n  16 +     onmessage?: (message: JSONRPCMessage) => void;\n  17 +     /**\n  18 +      * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.\n  19 +      */\n  20 +     constructor(_endpoint: string, res: ServerResponse);\n  21 +     /**\n  22 +      * Handles the initial SSE connection request.\n  23 +      *\n  24 +      * This should be called when a GET request is made to establish the SSE stream.\n  25 +      */\n  26 +     start(): Promise;\n  27 +     /**\n  28 +      * Handles incoming POST messages.\n  29 +      *\n  30 +      * This should be called when a POST request is made to send a message to the server.\n  31 +      */\n  32 +     handlePostMessage(req: IncomingMessage, res: ServerResponse, parsedBody?: unknown): Promise;\n  33 +     /**\n  34 +      * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST.\n  35 +      */\n  36 +     handleMessage(message: unknown): Promise;\n  37 +     close(): Promise;\n  38 +     send(message: JSONRPCMessage): Promise;\n  39 +     /**\n  40 +      * Returns the session ID for this transport.\n  41 +      *\n  42 +      * This can be used to route incoming POST requests.\n  43 +      */\n  44 +     get sessionId(): string;\n  45   }\n"
  }
]

发展

此项目是使用创建的 bun init 在bun v1.2.2中。 包子 是一个快速的一体化JavaScript运行时。

以开发模式运行

对于开发,您可以直接使用Bun运行服务器:

bun run src/index.ts

许可证

\[在此处添加您的许可证信息\]

贡献

\[在此处添加贡献指南\]

目录标签

目录标签

TypeScript开发代码导航JavaScriptClaudedeveloper-tools本地部署AI代码编辑器符号定义查找MCP服务器

支持客户端

ClaudeCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP