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

code-features-mcp

v1.0.1

Published

MCP server that exposes code analysis tools — language detection, line counting, symbol extraction, TODO finder, and complexity estimation

Readme

code-features-mcp

An MCP (Model Context Protocol) server that exposes code analysis tools to AI assistants.

Gives Claude (and any MCP-compatible client) the ability to:

| Tool | What it does | |---|---| | detect_language | Identify the programming language of a snippet | | count_lines | Count total / code / comment / blank lines | | extract_symbols | Pull out functions, classes, interfaces, types | | find_todos | Locate TODO / FIXME / HACK / NOTE / BUG comments | | measure_complexity | Estimate cyclomatic complexity |

Zero dependencies. Works as a library too.


Install

npm install -g code-features-mcp   # global CLI
npm install code-features-mcp      # library

Use as an MCP server

Add to your claude_desktop_config.json (or any MCP client config):

{
  "mcpServers": {
    "code-features": {
      "command": "code-features-mcp"
    }
  }
}

The server communicates over stdio using JSON-RPC 2.0 — the standard MCP transport.


Tools

detect_language

{ "code": "def foo(): pass", "filename": "script.py" }
{ "language": "python", "confidence": 1.0, "method": "extension" }

method is "extension" when a filename is supplied, "heuristic" when detected from content, or "unknown".


count_lines

{ "code": "// comment\nconst x = 1;\n\n", "language": "javascript" }
{ "total": 4, "code": 1, "comment": 1, "blank": 2 }

extract_symbols

{ "code": "function greet(name) {}\nclass Animal {}", "language": "javascript" }
[
  { "name": "greet",  "kind": "function", "line": 1 },
  { "name": "Animal", "kind": "class",    "line": 2 }
]

Supported languages: JavaScript, TypeScript, Python, Go, Rust, Java, Ruby.


find_todos

{ "code": "// TODO: fix this\n// FIXME: broken edge case" }
[
  { "kind": "TODO",  "text": "fix this",          "line": 1 },
  { "kind": "FIXME", "text": "broken edge case",   "line": 2 }
]

Recognised tags: TODO, FIXME, HACK, NOTE, BUG, XXX, OPTIMIZE, REFACTOR.


measure_complexity

{ "code": "if (a && b) { for (let i=0;i<n;i++) { while(true) break; } }" }
{ "complexity": 5, "rating": "low", "decisionPoints": 4 }

Rating scale: low (≤5) → moderate (≤10) → high (≤20) → very high (>20). Formula: complexity = 1 + decision points (if/for/while/case/catch/&&/||/ternary).


Use as a library

import { detectLanguage, countLines, extractSymbols, findTodos, measureComplexity } from 'code-features-mcp';

const { language } = detectLanguage('fn main() {}', 'main.rs');
// 'rust'

const lines = countLines(myCode, 'python');
// { total: 42, code: 30, comment: 8, blank: 4 }

const symbols = extractSymbols(myCode, 'typescript');
// [{ name: 'MyClass', kind: 'class', line: 5 }, ...]

const todos = findTodos(myCode);
// [{ kind: 'TODO', text: 'refactor', line: 12 }]

const { complexity, rating } = measureComplexity(myCode, 'javascript');
// { complexity: 7, rating: 'moderate', decisionPoints: 6 }

CommonJS

const { detectLanguage, countLines } = require('code-features-mcp');

MCP protocol

The server implements JSON-RPC 2.0 over stdio and handles:

| Method | Description | |---|---| | initialize | Handshake, returns server info and capabilities | | tools/list | Returns the list of available tools | | tools/call | Executes a tool with given arguments | | ping | Health check |


License

MIT