npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zachsents/ts-mcp

v0.3.2

Published

Give AI agents TypeScript type awareness

Downloads

264

Readme

TS Hover MCP

Give AI agents TypeScript type inference — no editor required.

A standalone MCP server that provides TypeScript type information using tsgo (the native Go-based TypeScript compiler). Works with any MCP client — Cursor, Claude Desktop, VS Code, Windsurf, or any other agent.

No running editor needed. It spawns and manages tsgo LSP instances directly, keeping them warm for fast subsequent queries.

Prerequisites

Install tsgo globally:

npm install -g @typescript/native-preview
# or
bun add -g @typescript/native-preview
# or
pnpm add -g @typescript/native-preview
# or
yarn global add @typescript/native-preview

Install

Cursor

Install MCP Server

Or manually add to .cursor/mcp.json:

{
  "mcpServers": {
    "ts-hover": {
      "command": "npx",
      "args": ["-y", "@zachsents/ts-mcp"]
    }
  }
}

VS Code

Add to your User Settings (JSON):

{
  "mcp": {
    "servers": {
      "ts-hover": {
        "command": "npx",
        "args": ["-y", "@zachsents/ts-mcp"]
      }
    }
  }
}

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "ts-hover": {
      "command": "npx",
      "args": ["-y", "@zachsents/ts-mcp"]
    }
  }
}

Claude Code

claude mcp add-json ts-hover '{"command":"npx","args":["-y","@zachsents/ts-mcp"]}'

Windsurf

Add to your Windsurf MCP config:

{
  "mcpServers": {
    "ts-hover": {
      "command": "npx",
      "args": ["-y", "@zachsents/ts-mcp"]
    }
  }
}

How it works

  1. Agent calls a tool (e.g. hover with a file path and position)
  2. The MCP server finds the nearest tsconfig.json to determine the project root
  3. It spawns (or reuses) a tsgo LSP instance for that project
  4. Returns the type information
  5. The tsgo instance stays warm for 5 minutes, making follow-up queries near-instant

Multiple project roots are handled automatically — each gets its own tsgo instance.

Tools

hover

Get TypeScript type information at a position, plus where it's defined. Returns the same info you'd see hovering in an IDE — resolved types, inferred types, JSDoc — and the definition location.

| Parameter | Type | Description | | ----------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file | | line | number | Line number (0-indexed) | | character | number | Character position (0-indexed) |

diagnostics

Get TypeScript errors and warnings for a file, along with available quick fixes and their exact text edits.

| Parameter | Type | Description | | --------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file |

references

Find all references to a symbol across the project.

| Parameter | Type | Description | | ----------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file | | line | number | Line number (0-indexed) | | character | number | Character position (0-indexed) |

outline

Get a structured outline of all symbols in a file — functions, classes, interfaces, types, variables — with line numbers and nesting.

| Parameter | Type | Description | | --------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file |

rename

Rename a symbol across the project. Applies the edits directly to all affected files.

| Parameter | Type | Description | | ----------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file | | line | number | Line number (0-indexed) | | character | number | Character position (0-indexed) | | newName | string | The new name for the symbol |

inlay_hints

Get inferred type annotations for a line range — variable types, parameter types, return types that TypeScript infers but aren't written in code.

| Parameter | Type | Description | | ----------- | -------- | ------------------------------------ | | file | string | Absolute path to the TypeScript file | | startLine | number | Start line (0-indexed, inclusive) | | endLine | number | End line (0-indexed, exclusive) |

Note: Requires tsgo inlay hint support, which is still in development. The tool will start returning results as tsgo fills in this capability.

Configuration

| Env var | Description | | ----------- | ------------------------------------ | | TSGO_PATH | Override the path to the tsgo binary |

License

MIT — Zach Sents