AI代码记录器 MCP 客户端 - 通过 MCP 协议记录 AI 生成的代码片段
Project description
AI代码记录器客户端
AI代码记录器的 MCP 客户端,运行在本地,通过 MCP 协议与 Cursor 集成,获取 Git 信息并将 AI 生成的代码片段上报到远程服务器。
当前版本: v1.0.2
PyPI: ai-code-recorder-client
架构: 客户端本地运行 + 远程API服务器
一. 介绍与特性
- 自动收集 Git 仓库信息(仓库地址、分支、提交等)
- 记录 AI 生成的代码片段及上下文信息到远程服务器
- 与 Cursor 通过 MCP 协议无缝集成
- 提供基础工具:获取仓库信息、记录代码、生成 AGENTS 指南
二. 环境要求
- Python 版本:3.8 ~ 3.12
- 操作系统:Windows / macOS / Linux(推荐 macOS 或 Linux)
- Cursor 已安装并支持 MCP 配置
三. 安装
从 PyPI 安装(推荐):
pip install ai-code-recorder-client
从源码安装(开发用):
# 克隆仓库并进入客户端目录
git clone https://github.com/ai-code-team/ai-code-recorder.git
cd ai-code-recorder/client
# 安装开发版本
pip install -e .
四. 在 Cursor 中配置 MCP
编辑 ~/.cursor/mcp.json(无则创建):
{
"mcpServers": {
"ai-code-recorder": {
"command": "uvx",
"args": ["ai-code-recorder-client"]
}
}
}
说明:
- 可执行入口为
ai-code-recorder-client(pyproject.toml的project.scripts中定义) - 该客户端以 stdio 模式运行,无需额外端口配置
五. 可用工具说明
create_agents_guide
- 功能:在项目根目录创建或更新
AGENTS.md,给智能体提供使用规范 - 参数:
project_root(可选)。不指定则使用当前工作目录
get_repository_info
- 功能:获取本地 Git 仓库与用户信息
- 参数:
project_root(必填):客户端项目的根目录绝对路径file_path(可选):文件的相对或绝对路径
- 返回:JSON 字符串,包含
repository_info与user_info
record_code_snippet
- 功能:记录 AI 生成的代码片段到远端
- 核心参数:
filename、language、source、code(建议提供完整信息) - 可选参数:
file_path、project_context、repository_url、git_branch、commit_hash、meta - 说明:工具会自动从本地获取Git信息并上报到远程API服务器进行存储分析
六. 开发与发布
本地开发:
git clone https://github.com/ai-code-team/ai-code-recorder.git
cd ai-code-recorder/client
pip install -e .
发布到 PyPI:
- 安装发布工具
pip install build twine
- 配置 PyPI API Token(示例)
export PYPI_API_TOKEN="pypi-your-token-here"
- 一键发布(在
client/目录执行)
./release.sh
发布脚本将执行:清理、构建、检查、安装测试与发布等步骤。
七. 许可证
MIT License,详见仓库内 client/LICENSE。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_code_recorder_client-1.0.3.tar.gz.
File metadata
- Download URL: ai_code_recorder_client-1.0.3.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bce5f64dd26c518e445d863ed5c3f181877a84c14efccdd0499ae993d8f5016
|
|
| MD5 |
1f264d841f01a14cecc92c05b2217b1a
|
|
| BLAKE2b-256 |
f6475ea2d03dabfab2365031c8eec75c692f3f3d30a53bc8fc2044d990761095
|
File details
Details for the file ai_code_recorder_client-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ai_code_recorder_client-1.0.3-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613a82223832d0593110721a7922ad6fe44394bb973ecea9d1262a1ed5aa05eb
|
|
| MD5 |
2d3ddc6729dcf92e98ff932241a54bf9
|
|
| BLAKE2b-256 |
01ced1d828fd1b3b3ce60410a6a8cabc08a978e0d6b573a8f684c2b12843b521
|