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

ts-scan

v0.1.5

Published

CLI/MCP tool providing TypeScript code intelligence via the TypeScript Language Service. Analyze exports, imports, resolve symbols, and check type errors.

Downloads

1,049

Readme

ts-scan

TypeScript code intelligence that makes AI coding agents smarter and more efficient.

ts-scan gives LLM‑powered tools instant access to type errors, imports, exports, and symbol locations so that “dumber” models produce reliable code and “smarter” models use fewer tokens.

Why ts‑scan?

AI coding assistants often struggle with large TypeScript codebases:

  • Less capable (cheap) models generate incorrect imports, miss type errors, or guess symbol locations – leading to broken code.
  • Powerful (expensive) models can reason about the project structure, but reading entire files or search results wastes context‑window tokens.

ts-scan bridges this gap by providing on‑demand, laser‑focused information through a simple CLI or an MCP server. Instead of dumping a whole file, you get exactly what you need: the type errors, the imports with their JSDoc, or the correct import path for a symbol – all without a full project build.

Features

| Feature | Description | |---------|-------------| | ✅ Instant type checking | Get TypeScript diagnostics for a single file using incremental compilation and language service caching. | | 📦 Import introspection | List every imported symbol along with its JSDoc description and function signature. | | 📤 Export documentation | Display JSDoc comments and signatures for all exports of a given file. | | 🔍 Symbol lookup | Find the correct import path for any exported symbol in your project (no more grep guessing). | | 🧠 AI‑friendly output | Structured JSON output or concise human‑readable formats that LLM agents can parse effortlessly. | | 🌐 MCP server mode | Exposes all features as MCP tools (check_type_errors, list_imports, list_exports, resolve_symbol) over stdio or HTTP. |

Installation

Requirements: Node.js 18+ and a TypeScript project with a valid tsconfig.json.

# Install globally
npm install -g ts-scan

# Or use on‑the‑fly with npx
npx ts-scan <command>

Open‑Code Integration

ts-scan is designed to integrate seamlessly with Open‑Code agents. By configuring it as an MCP server, your agents can call its tools directly to get real‑time TypeScript insights without leaving their workflow.

opencode.json configuration example:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "ts-scan": {
      "type": "local",
      "command": ["npx", "ts-scan", "--mcp"],
      "enabled": true
    }
  }
}

Skills

Model are not trained to use this tool, so I created two skills with clear rules and workflows that enforce using ts-scan for any TypeScript code generation or modification. Check out the type-safe-coder and dependency-planner skills for detailed guidelines on how to use ts-scan effectively in your coding agents.

AGENTS.md

I also added a section about ts-scan in AGENTS.md with example prompts and instructions for using the MCP tools. This way, even if an agent doesn't use the skills directly, it can still understand how to leverage ts-scan for better TypeScript code generation.

Manual use (CLI)

# Check for type errors
npx ts-scan --check src/app.ts

# List all imports with their JSDoc & signatures
npx ts-scan --imports src/app.ts

# List all exports with their JSDoc & signatures
npx ts-scan --exports src/utils.ts

# Find the import path for a symbol (local or from node_modules)
npx ts-scan --resolve UserService

# Make the resolved path relative to a specific file
npx ts-scan --resolve UserService --relative-to src/index.ts

MCP Server Mode

ts-scan can run as an MCP server, exposing all commands as tools that AI agents can call directly – no shell commands needed.

Start the server

# Stdio (for Claude Desktop, Cline, etc.)
npx ts-scan --mcp

# HTTP (for browser‑based agents)
npx ts-scan --mcp --port 3000

Available MCP Tools

| Tool Name | Description | Main Parameter | |----------------------|----------------------------------------------|-----------------| | check_type_errors | Show TypeScript errors for a file | file_path | | list_imports | List imported symbols with signatures/JSDoc | file_path | | list_exports | List exported symbols with signatures/JSDoc | file_path | | resolve_symbol | Find the import path for an exported symbol | symbol |

Configuration Example (opencode.json)

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "ts-scan": {
      "type": "local",
      "command": ["npx", "ts-scan", "--mcp"],
      "enabled": true
    }
  }
}

AI‑Friendly Output

All commands return structured JSON (or a compact plain‑text representation) designed for LLM consumption:

  • No noise – Only the requested data, no configuration logs or build artifacts.
  • Token‑efficient – The output is minimal, so expensive models don't burn tokens on irrelevant context.
  • Machine‑parseable – JSON makes it easy for agents to extract exactly the fields they need.

Example output for ts-scan --imports src/app.ts:

[
  {
    "name": "fetchUser",
    "signature": "declare function fetchUser(id: string): Promise<User>",
    "jsDoc": "/** Fetches a user by ID. Returns a promise that resolves to the user object. */",
    "modulePath": "./api/user"
  }
]

License

ISC – see the LICENSE file for details.