WHAT IT CONNECTS
ReyNeill Kontxt 为 AI Agent 提供什么
- Connects to a user-specified local code repository.
- Provides the (`get_codebase_context`) tool for AI clients (like Cursor, Claude Desktop).
- Uses Gemini 2.0 Flash's 1M input window internally to analyze the codebase and generate context based on the user's client querry.
- Flash itself can use internal tools (`list_repository_structure`, `read_files`, `grep_codebase`) to understand the code.
- Supports both SSE (recommended) and stdio transport protocols.
- Supports user-attached files/docs/context from client's queries for more targeted analysis.
- Tracks token usage and provides detailed analysis of API consumption.
- User-configurable token limit for context generation (options: 500k, 800k, or 1M tokens; default: 800k).
- **Clone/Download:** Get the server code.
- **Create Environment:**
- **Install Dependencies:**
- **Install `tree`:** Ensure the `tree` command is available on your system.
- macOS: `brew install tree`
- Debian/Ubuntu: `sudo apt update && sudo apt install tree`
- Windows: Requires installing a port or using WSL.
- **Configure API Key:**
- Copy `.env.example` to `.env`.
- Edit `.env` and add your Google Gemini API Key:
- Alternatively, you can provide the key via the `--gemini-api-key` command-line argument.
- Start the server independently
- Connect from multiple clients
- Keep it running while restarting clients
- `--repo-path PATH`: **Required**. Absolute path to the local code repository to analyze.
- `--gemini-api-key KEY`: Google Gemini API Key (overrides `.env` if provided).
- `--token-threshold NUM`: Target maximum token count for the context. Allowed values are:
- 500000
- 800000 (default)
- 1000000
- `--gemini-model NAME`: Specific Gemini model to use (default: 'gemini-2.0-flash').
- `--transport {stdio,sse}`: Transport protocol to use (default: sse).
- `--host HOST`: Host address for the SSE server (default: 127.0.0.1).
- `--port PORT`: Port for the SSE server (default: 8080).
- "What's this codebase about"
- "How does the authentication system work?"
- "Explain the data flow in the application"
- "Explain how this file works: @kontxt_server.py"
- "Find all files that interact with @user_model.py"
- "Compare the implementation of @file1.js and @file2.js"
- Repository structure listing
- File reading
- Grep searches
- Attached files from user queries
- Generated responses
SECURITY
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。