Kimi K2 Code Context MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Kimi K2 Code Context MCP
AI-powered code context management MCP for Claude Desktop. Intelligently manages up to 128K tokens of code context with semantic understanding, dependency tracking, and smart prioritization.
๐ Features
128K Token Context: Maximize Claude's context window with intelligent management
Smart Code Analysis: Automatic dependency tracking and relationship mapping
Context Prioritization: Relevance scoring ensures most important code stays in context
Multi-File Support: Handle entire projects with cross-file understanding
Incremental Updates: Efficient context updates without full regeneration
Language Agnostic: Works with any programming language
Local Processing: Zero API costs, all analysis runs locally
Related MCP server: code-grapher
๐ Key Capabilities
Context Management
Dynamic context window optimization
Automatic dead code elimination
Smart truncation for large files
Context history and versioning
Code Intelligence
Function and class dependency graphs
Import/export relationship tracking
Variable scope analysis
Call hierarchy mapping
Performance
Sub-second context updates
Minimal memory footprint (<100MB)
Lazy loading for large codebases
Efficient caching strategies
๐ฆ Installation
Via NPM (Recommended)
npm install -g kimi-k2-code-context-mcpManual Installation
git clone https://github.com/justmy2satoshis/kimi-k2-code-context-mcp.git
cd kimi-k2-code-context-mcp
npm install๐ง Configuration
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"kimi-k2-code-context": {
"command": "node",
"args": ["C:\\path\\to\\kimi-k2-code-context-mcp\\src\\server.js"],
"env": {
"MAX_CONTEXT_TOKENS": "128000",
"CACHE_DIR": "C:\\Users\\username\\AppData\\Local\\kimi-k2-cache"
}
}
}
}๐ Usage Examples
Load Project Context
const context = await load_project_context({
project_path: "./my-project",
include_patterns: ["*.js", "*.ts"],
exclude_patterns: ["node_modules/**", "*.test.js"]
});Update Context with Changes
const updated = await update_context({
file_path: "src/components/Header.js",
changes: "Added new navigation component"
});Query Context
const relevant = await query_context({
query: "authentication flow",
max_tokens: 50000
});Get Context Statistics
const stats = await get_context_stats();
// Returns:
// {
// total_tokens: 87432,
// files_loaded: 156,
// cache_hits: 89,
// last_update: "2024-01-15T10:30:00Z"
// }๐ก Use Cases
Large Codebase Navigation
Maintain context across hundreds of files
Smart focus on relevant code sections
Automatic dependency inclusion
Code Review & Refactoring
Keep related code in context
Track impact of changes
Maintain architectural overview
Documentation Generation
Full project context for accurate docs
Cross-reference tracking
API surface analysis
Bug Fixing
Automatic inclusion of error paths
Stack trace context loading
Related code identification
๐๏ธ Architecture
kimi-k2-code-context-mcp/
โโโ src/
โ โโโ server.js # Main MCP server
โ โโโ context-manager.js # Context window management
โ โโโ code-analyzer.js # Code parsing and analysis
โ โโโ cache-manager.js # Caching layer
โ โโโ prioritizer.js # Relevance scoring
โโโ examples/ # Usage examples
โโโ tests/ # Test suite
โโโ package.json๐ฐ Cost Comparison
Solution | Monthly Cost | Context Size | Speed |
Kimi K2 MCP | $0 (Local) | 128K tokens | <1s |
GitHub Copilot | $10-20 | Limited | 2-3s |
Tabnine Pro | $12 | Limited | 1-2s |
Codeium Pro | $10 | Limited | 1-2s |
Savings: $10-20/month with superior context management
๐งช Testing
npm testRun comprehensive tests including:
Context window optimization
Code analysis accuracy
Performance benchmarks
Edge case handling
๐ค Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
Areas for Contribution
Language-specific analyzers
Context compression algorithms
Performance optimizations
Additional caching strategies
๐ Performance Metrics
Context Loading: <500ms for 100 files
Update Speed: <100ms incremental updates
Memory Usage: <100MB for large projects
Cache Hit Rate: 85%+ on average
Token Efficiency: 95%+ useful context
๐ Security
No external API calls
Local processing only
No code transmission
Secure cache management
Read-only file access
๐ License
MIT License - see LICENSE file for details
๐ Acknowledgments
Anthropic for the Model Context Protocol
Claude Desktop team for MCP support
Community contributors
๐ง Support
Issues: GitHub Issues
Discussions: GitHub Discussions
๐ฆ Status
โ Production Ready
โ 128K context support
โ Multi-language support
โ Comprehensive testing
โ Claude Desktop compatible
Note: Requires Claude Desktop with MCP support enabled.
Built with โค๏ธ for developers who work with large codebases
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Shared long-term memory & Stop-hook task handoff across Claude Code, Codex, Cursor, and mobile.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides semantic code intelligence to help users search, navigate, and analyze entire codebases using plain English. It enables Claude to perform architectural overviews, bug detection, and refactor suggestions through local semantic search and keyword indexing.MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to intelligently analyze and query codebases using knowledge graphs, supporting natural language code search, relationship discovery, and incremental updates.11-
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code to query a local, import-aware graph of a repository, so questions like who calls a function, what breaks if it changes, and what imports a file are answered in one lookup instead of a search-and-read loop. It also persists durable session notes and offers full-text search over past session transcripts, all through MCP tools.MIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude AI coding assistants to persist and restore context across sessions, save checkpoints, organize information with channels, and search or track changes so long coding workflows can continue without losing decisions and progress.150 npmMIT