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

codeast

v1.0.3

Published

MCP server for code analysis - reduces context window usage by returning structured data

Readme

CodeAst

MCP server for static code analysis — Returns structured data instead of raw files to reduce context window usage by 10x.

Built with Rust (analyzer) + TypeScript (MCP wrapper).

Why CodeAst?

When LLMs analyze code, they typically read entire files. CodeAst extracts only what matters:

| Without CodeAst | With CodeAst | |-----------------|--------------| | Read 500 lines to find functions | Get structured list of symbols | | Grep entire codebase for callers | Get precise caller locations | | Manual dependency tracing | Automatic cycle detection |

Installation

macOS / Linux:

claude mcp add codeast npx codeast

Windows:

npm install -g codeast
claude mcp add codeast codeast

The analyzer binary is downloaded automatically on first run.

Tools

| Tool | Description | |------|-------------| | get_symbols | List functions, classes, types in a file | | get_callers | Find all functions that call a function | | get_calls | Get all functions called by a function | | get_imports | Get imports (internal vs external) | | get_imported_by | Find files that import a file | | get_complexity | Get cyclomatic/cognitive complexity metrics | | get_cycles | Detect circular dependencies | | get_duplicates | Find duplicated code blocks | | get_file_info | Quick file overview | | search_files | Search files by glob pattern | | run_tests | Run tests (auto-detects npm/cargo/pytest) | | status | Check if analyzer is running |

Supported Languages

  • JavaScript / TypeScript / JSX / TSX
  • Python
  • Rust
  • Astro

Contributing

This project is open source and welcomes contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.

Getting Started

# Clone the repo
git clone https://github.com/YOUR_USERNAME/codeast.git
cd codeast

# Build the Rust analyzer
cd analyzer && cargo build --release

# Build and run MCP server
cd ../mcp && npm install && npm run build
node dist/mcp/server.js

The MCP auto-detects the local binary in dev mode.

Areas for Contribution

Bugs to Fix

| # | Bug | Impact | |---|-----|--------| | 1 | get_callers doesn't find without module prefix (fn vs module::fn) | Usability | | 2 | JS grammar doesn't detect exports (only TS works) | .js files |

Missing Features

| # | Feature | Description | |---|---------|-------------| | 1 | Function parameters | Extract params (name, type) from functions | | 2 | Return types | Extract return type from functions | | 3 | Class methods | get_symbols doesn't return methods | | 4 | Export default | export default function not detected | | 5 | Re-exports | export { foo } from './bar' not traced | | 6 | Decorators | @Controller, @Injectable (NestJS, Angular) | | 7 | JSDoc/TSDoc | Extract documentation comments | | 8 | Async detection | Mark if a function is async |

MCP Improvements

| # | Tool | Improvement | |---|------|-------------| | 1 | get_callers | Fuzzy match (without module prefix) | | 2 | get_callers | Add recursive: true param for call chain | | 3 | get_symbols | Add methods for classes | | 4 | get_complexity | Add maintainability index | | 5 | search_code | New tool for grep with context | | 6 | get_dependencies | Visualize dependency tree of a file |

Refactoring

| File | Complexity | Action | |------|------------|--------| | symbols.rs | 382 | Split into modules (js.rs, rust.rs, python.rs, astro.rs) | | analyzer.rs | 73 | Extract process_import logic | | handlers.ts | - | Factor out error handling |

New Language Support

Want to add support for a new language? Here's what you need:

  1. Add tree-sitter grammar to analyzer/Cargo.toml
  2. Create extraction functions in analyzer/src/symbols.rs
  3. Add import parsing in analyzer/src/parser.rs
  4. Add tests in analyzer/tests/

Languages we'd love to support:

  • Go
  • Java
  • C/C++
  • Ruby
  • PHP

Project Structure

codeast/
├── analyzer/          # Rust - Core analysis engine
│   ├── src/
│   │   ├── main.rs        # CLI entry point
│   │   ├── analyzer.rs    # Orchestration
│   │   ├── symbols.rs     # AST symbol extraction
│   │   ├── parser.rs      # Import extraction
│   │   ├── complexity.rs  # Metrics calculation
│   │   ├── duplicates.rs  # Duplicate detection
│   │   └── graph.rs       # Dependency graph
│   └── Cargo.toml
│
├── mcp/               # TypeScript - MCP server wrapper
│   ├── src/
│   │   ├── mcp/
│   │   │   ├── server.ts      # MCP entry point
│   │   │   ├── tools.ts       # Tool definitions
│   │   │   └── handlers.ts    # Tool implementations
│   │   └── services/
│   │       ├── analyzer.ts    # Process management
│   │       └── queries.ts     # Query API
│   └── package.json
│
└── docs/              # Landing page

License

MIT


Found a bug? Have an idea? Open an issue or submit a PR!