Kortex代码助理
用于Kotlin多平台(KMP)和Compose多平台(CMP)编码助手的代码助手MCP服务器。
概述
Kortex是一个MCP(模型上下文协议)服务器,为AI编码助手提供高级功能,用于处理Kotlin多平台和Compose多平台项目。它将基于LSP的符号代码分析与项目感知导航、跨平台理解和智能代码编辑相结合。
项目状态
总体状况:完成93/134项任务(69%)
已完成的功能
- ✅ LSP符号导航 (用户故事1)
- ✅ 跨平台理解 (用户故事2)
- ✅ 项目入职培训 (用户故事3)
- ✅ 编辑模式 (用户故事7)
- ✅ 存储器系统 (用户故事4)
- ✅ 交互式用户激励 (用户故事5)
- ✅ 计划模式 (用户故事6)
即将推出的功能
- 🚧 CMP UI模式识别 (用户故事8)
- 🚧 波兰语和横切 (第11阶段)
MVP状态
- MVP完成:100%(4个P1故事中的4个已经完成)
主要特点
- 基于LSP的符号导航:在所有KMP源代码集(commonMain、androidMain、iosMain等)中搜索、导航和分析代码符号
- 跨平台理解:在Kotlin、Swift和Objective-C代码之间导航,具有完全的互操作意识
- 项目入职培训:自动检测和配置具有依赖关系和源集的KMP/CMP项目
- 符号代码编辑:通过LSP使用符号级操作进行精确的代码修改
- 存储器系统:存储和检索特定于项目的知识、模式和偏好
- 计划模式:使用SpecKit集成创建和完善规范
- 用户激励:交互式提问,以解决需求中的歧义(需要客户启发支持\*)
- CMP模式识别:了解撰写多平台特定模式(可组合、导航、状态管理)
*\*用户启发需要MCP客户端支持启发功能。如果客户端不支持启发式,这些工具将返回一条有用的消息,而不是失败。*
文档
设置
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows
# Install dependencies
uv pip install -e ".[dev]"用法
作为MCP服务器运行
python -m kortex_mcp.serverClaude桌面中的配置
添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"kortex": {
"command": "python",
"args": ["-m", "kortex_mcp.server"],
"cwd": "/path/to/kortex"
}
}
}发展
运行测试
# Run all tests
pytest
# Run with coverage
pytest --cov=src/kortex_mcp --cov-report=html
# Run specific test file
pytest tests/test_server.py类型检查
mypy src/kortex_mcp代码检查
ruff check src/ tests/
ruff format src/ tests/建筑
src/kortex_mcp/
├── server.py # FastMCP server initialization
├── tools/ # MCP tool implementations
├── lsp/ # LSP client and language server managers
├── analyzers/ # Code analysis (KMP, CMP patterns)
├── models/ # Data models and types
├── storage/ # Persistence layer (memory, project config)
└── utils/ # Utilities (logging, file operations, async helpers)需求
- Python 3.10+
- Kotlin语言服务器(适用于Kotlin LSP)
- SourceKit LSP(适用于Swift LSP,可选)
- cland(对于Objective-C LSP,可选)
许可证
麻省理工学院
