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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ken-you-code

v1.3.0

Published

Connect your codebase to Kimi: Ultra-fast AI code analysis with Kimi-K2 model via MCP

Downloads

57

Readme

Ken-You-Code

Connect your codebase to Kimi - Ultra-fast AI code analysis with Kimi-K2 model via MCP

A specialized Model Context Protocol (MCP) server built by Ken Kai does AI that enables Claude Code to delegate tasks to the powerful Kimi-K2 model via OpenRouter. Get lightning-fast code analysis, debugging, security reviews, and more.

Features

  • 10 Specialized Task Types: debug, analyze, review, optimize, style, document, test, refactor, migrate, design
  • Ultra-Fast Performance: Optimized prompts for 50x speed improvement (1-2 seconds vs 30+ seconds)
  • Kimi-K2 Integration: Leverage the powerful moonshotai/kimi-k2 model via OpenRouter
  • Secure File Operations: Read files with configurable security restrictions (.tsx, .jsx, .py, .js, .ts, etc.)
  • Diff-Based Workflow: Create and apply file changes with approval workflows and automatic backups
  • Type-Safe: Built with TypeScript and Zod validation

Task Types

debug

Find and fix bugs in your code

analyze

Analyze code structure, patterns, and potential issues

review

Review code quality, best practices, and security

optimize

Optimize performance and efficiency

style

Check and improve code style and formatting

document

Generate documentation and comments

test

Create and improve test coverage

refactor

Refactor code for better maintainability

migrate

Migrate code between frameworks or versions

design

Design UI/UX components and layouts

read_file

Read file content securely with path validation and size limits.

Parameters:

  • file_path: Absolute path to the file

create_diff

Generate a diff for proposed file changes without applying them.

Parameters:

  • file_path: Target file path
  • new_content: Proposed file content
  • reason: Explanation for the change

apply_diff

Apply a previously created diff with user approval.

Parameters:

  • operation_id: Diff operation identifier
  • approved: Boolean approval for the change

Quick Start

Prerequisites

  • Claude Code
  • OpenRouter API key

Installation

Add to Claude Code:

claude mcp add ken-you-code -s user -e OPENROUTER_API_KEY=<YOUR-OPENROUTER-API-KEY> -- npx -y ken-you-code

That's it! The MCP will be downloaded and configured automatically.

Environment Variables

| Variable | Required | Default | Description | | -------------------- | -------- | -------------------- | --------------------------------------- | | OPENROUTER_API_KEY | Yes | - | OpenRouter API key | | WORKSPACE_ROOT | No | - | Restrict file access to this directory | | LOG_LEVEL | No | INFO | Logging level | | DEFAULT_MODEL | No | moonshotai/kimi-k2 | Default model for tasks | | MAX_FILE_SIZE_MB | No | 10 | Maximum file size in MB | | ALLOWED_EXTENSIONS | No | .py,.js,.ts,... | Comma-separated allowed file extensions |

Security

File Access Restrictions

  • Path Validation: Only absolute paths within allowed directories
  • Extension Filtering: Configurable allowed file extensions
  • Size Limits: Maximum file size enforcement
  • Forbidden Paths: Automatic blocking of sensitive directories (.env, .git/, node_modules/, etc.)

Approval Workflow

  • All file modifications require explicit user approval
  • Automatic backup creation before applying changes
  • Operation tracking with unique IDs

Development

Scripts

npm run dev        # Development mode with watch
npm run build      # Build TypeScript
npm run test       # Run tests
npm run lint       # Lint code
npm run lint:fix   # Fix linting issues
npm run format     # Format code

Project Structure

src/
├── server.ts              # Main MCP server
├── tools/
│   ├── fileOperations.ts  # Secure file reading
│   ├── specializedTask.ts # OpenRouter integration
│   └── diffManager.ts     # Diff creation and application
├── config/
│   └── index.ts          # Configuration management
└── types/
    └── index.ts          # Type definitions and validation

Usage Examples

Debugging a Performance Issue

// Claude Code can call:
await mcp.call('specialized_task', {
  task_type: 'debug',
  context: 'Performance issue with database queries',
  files: ['/project/src/database.ts', '/project/src/queries.ts'],
});

Code Review

await mcp.call('specialized_task', {
  task_type: 'review',
  context: 'Review this authentication implementation for security',
  files: ['/project/src/auth.ts'],
});

Applying Suggested Changes

// Create diff
const diffResult = await mcp.call('create_diff', {
  file_path: '/project/src/auth.ts',
  new_content: '// Updated code here...',
  reason: 'Fix security vulnerability identified in review',
});

// Apply with approval
await mcp.call('apply_diff', {
  operation_id: diffResult.operation_id,
  approved: true,
});

Model Support

Powered by Kimi-K2 (moonshotai/kimi-k2) via OpenRouter - known for exceptional code analysis, debugging capabilities, and ultra-fast performance.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Ensure linting and build pass
  6. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

  • Check the troubleshooting section
  • Review existing GitHub issues
  • Create a new issue with detailed information