Token导航 LogoToken导航TokenDH.com
Code Assistant CLI logo
开发工具stdio官方级别未说明来源级核验

Code Assistant CLI

MCP Server

一个通过MCP协议连接Code RAG系统的TypeScript CLI工具,提供智能代码探索和辅助功能。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
代码搜索TypeScriptClaude开发工具ClaudeWindsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jcalmeida

提供方

jcalmeida

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m src.mcp_server

详细介绍

代码助手CLI

🚀 一个TypeScript CLI工具,通过MCP(模型上下文协议)连接到代码RAG系统,以提供智能代码探索和帮助。

✨ 特性

  • 🔍 语义代码搜索:使用自然语言查询查找相关代码
  • 💬 交互式聊天:在人工智能的帮助下询问有关代码库的问题
  • 📊 存储库统计信息:查看索引统计信息和存储库信息
  • 🔄 库管理:触发摄取和更新
  • 🎨 美丽的输出:格式化、彩色终端输出
  • MCP协议:直接连接到Code RAG服务器,实现低延迟

🛠 安装

# Install dependencies
npm install

# Build the project
npm run build

# Test the CLI
node dist/index.js --help

🚀 快速开始

先决条件:确保您的Code RAG MCP服务器正在运行:

cd ../windsurf-project
python -m src.mcp_server

然后使用CLI:

🔍 搜索代码

# Basic search
node dist/index.js search "authentication middleware"

# Search with filters
node dist/index.js search "database connection" --repos backend-service --languages python

# Limit results
node dist/index.js search "error handling" --top-k 3

💬 与AI聊天

# Single question
node dist/index.js chat "How does user authentication work?"

# Interactive chat mode
node dist/index.js chat --interactive

# Chat with specific context
node dist/index.js chat "Explain the API structure" --context 10

📊 存储库统计信息

# View stats
node dist/index.js stats

🔄 库管理

# Ingest specific repository
node dist/index.js ingest my-backend-repo

# Force full re-indexing
node dist/index.js ingest my-backend-repo --force

配置

创建一个 .env 文件(复制自 .env.example):

# Path to the Code RAG MCP server
MCP_SERVER_PATH=../windsurf-project

# Default model for chat
DEFAULT_MODEL=claude-sonnet-4-5

# Default number of search results
DEFAULT_TOP_K=5

# Default context chunks for chat
DEFAULT_MAX_CONTEXT=5

命令

search

使用语义相似性搜索代码。

选项:

  • -r, --repos -按存储库名称筛选
  • -l, --languages -按编程语言筛选
  • -k, --top-k -要返回的结果数(默认值:5)
  • `-s, --server-path

` -MCP服务器的路径(默认:../wundsurf项目)

chat [message]

与AI讨论你的代码库。

选项:

  • -r, --repos -按存储库名称筛选
  • -l, --languages -按编程语言筛选
  • -c, --context -最大上下文块数(默认值:5)
  • -m, --model -要使用的模型(默认:claude-sonnet-4-5)
  • -i, --interactive -启动交互式聊天模式
  • `-s, --server-path

` -MCP服务器的路径

stats

显示存储库统计信息。

选项:

  • `-s, --server-path

` -MCP服务器的路径

ingest [repo-name]

触发存储库摄取。

选项:

  • -f, --force -强制完全重新索引
  • `-s, --server-path

` -MCP服务器的路径

例子

搜索示例

# Find authentication code
code-assistant search "user login authentication"

# Find database queries in specific repo
code-assistant search "SELECT FROM users" --repos user-service

# Find Python error handling
code-assistant search "try catch exception" --languages python

聊天示例

# Ask about architecture
code-assistant chat "What is the overall architecture of this project?"

# Get help with debugging
code-assistant chat "How do I debug authentication issues?"

# Interactive exploration
code-assistant chat -i

发展

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

# Watch mode
npm run watch

建筑

┌─────────────────┐    MCP     ┌─────────────────┐
│  CLI Assistant  │ ◄─────────► │  Code RAG       │
│  (TypeScript)   │  Protocol  │  MCP Server     │
└─────────────────┘            └─────────────────┘
         │                              │
         ▼                              ▼
┌─────────────────┐            ┌─────────────────┐
│  Commands       │            │  Vector Store   │
│  • search       │            │  • ChromaDB     │
│  • chat         │            │  • Embeddings   │
│  • stats        │            │  • Code Chunks  │
│  • ingest       │            └─────────────────┘
└─────────────────┘

需求

  • Node.js 18+
  • TypeScript 5+
  • 运行代码RAG MCP服务器
  • 访问代码RAG系统

故障排除

连接问题

# Check if MCP server is running
cd ../windsurf-project
python -m src.mcp_server

# Verify server path
code-assistant stats --server-path /path/to/windsurf-project

构建问题

# Clean and rebuild
rm -rf dist node_modules
npm install
npm run build

许可证

MIT许可证-有关详细信息,请参阅许可证文件。

目录标签

目录标签

代码搜索TypeScriptClaude开发工具本地部署AI聊天代码库管理语义分析

支持客户端

ClaudeWindsurf

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP