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。
Metadata
Release files for ai-code-recorder-client 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ai_code_recorder_client-1.0.3.tar.gz | 10.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ai_code_recorder_client-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / ai_code_recorder_client-1.0.3.tar.gz
| Download URL | ai_code_recorder_client-1.0.3.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bce5f64dd26c518e445d863ed5c3f181877a84c14efccdd0499ae993d8f5016
|
|
BLAKE2b-256 checksum How to use checksums |
f6475ea2d03dabfab2365031c8eec75c692f3f3d30a53bc8fc2044d990761095
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Release files / ai_code_recorder_client-1.0.3-py3-none-any.whl
| Download URL | ai_code_recorder_client-1.0.3-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
613a82223832d0593110721a7922ad6fe44394bb973ecea9d1262a1ed5aa05eb
|
|
BLAKE2b-256 checksum How to use checksums |
01ced1d828fd1b3b3ce60410a6a8cabc08a978e0d6b573a8f684c2b12843b521
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for ai-code-recorder-client 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.