Skip to main content

AI代码记录器 MCP 客户端 - 通过 MCP 协议记录 AI 生成的代码片段

Project description

AI代码记录器客户端

AI代码记录器的 MCP 客户端,运行在本地,通过 MCP 协议与 Cursor 集成,获取 Git 信息并将 AI 生成的代码片段上报到远程服务器。

当前版本: v1.0.2
PyPI: ai-code-recorder-client
架构: 客户端本地运行 + 远程API服务器


目录

  1. 介绍与特性
  2. 环境要求
  3. 安装
  4. 在 Cursor 中配置 MCP
  5. 可用工具说明
  6. 开发与发布
  7. 许可证

1. 介绍与特性

  • 自动收集 Git 仓库信息(仓库地址、分支、提交等)
  • 记录 AI 生成的代码片段及上下文信息到远程服务器
  • 与 Cursor 通过 MCP 协议无缝集成
  • 提供基础工具:获取仓库信息、记录代码、生成 AGENTS 指南

2. 环境要求

  • Python 版本:3.8 ~ 3.12
  • 操作系统:Windows / macOS / Linux(推荐 macOS 或 Linux)
  • Cursor 已安装并支持 MCP 配置

3. 安装

从 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 .

4. 在 Cursor 中配置 MCP

编辑 ~/.cursor/mcp.json(无则创建):

{
  "mcpServers": {
    "ai-code-recorder": {
      "command": "uvx",
      "args": ["ai-code-recorder-client"]
    }
  }
}

说明:

  • 可执行入口为 ai-code-recorder-clientpyproject.tomlproject.scripts 中定义)
  • 该客户端以 stdio 模式运行,无需额外端口配置

5. 可用工具说明

create_agents_guide

  • 功能:在项目根目录创建或更新 AGENTS.md,给智能体提供使用规范
  • 参数:project_root(可选)。不指定则使用当前工作目录

get_repository_info

  • 功能:获取本地 Git 仓库与用户信息
  • 参数:
    • project_root(必填):客户端项目的根目录绝对路径
    • file_path(可选):文件的相对或绝对路径
  • 返回:JSON 字符串,包含 repository_infouser_info

record_code_snippet

  • 功能:记录 AI 生成的代码片段到远端
  • 核心参数:filenamelanguagesourcecode(建议提供完整信息)
  • 可选参数:file_pathproject_contextrepository_urlgit_branchcommit_hashmeta
  • 说明:工具会自动从本地获取Git信息并上报到远程API服务器进行存储分析

6. 开发与发布

本地开发:

git clone https://github.com/ai-code-team/ai-code-recorder.git
cd ai-code-recorder/client
pip install -e .

发布到 PyPI:

  1. 安装发布工具
pip install build twine
  1. 配置 PyPI API Token(示例)
export PYPI_API_TOKEN="pypi-your-token-here"
  1. 一键发布(在 client/ 目录执行)
./release.sh

发布脚本将执行:清理、构建、检查、安装测试与发布等步骤。

7. 许可证

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

ai_code_recorder_client-1.0.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_code_recorder_client-1.0.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file ai_code_recorder_client-1.0.2.tar.gz.

File metadata

  • Download URL: ai_code_recorder_client-1.0.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ai_code_recorder_client-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6aac8d32dea81392abd3adc9783241a23a2a6fcad41cb5caadcad867a79c72be
MD5 e5bee74af5ed96457ff037ccc0aa7596
BLAKE2b-256 b56f72c9d49aeddb829c3f8a231fd58ac314fc741a1a496f641df35b2e08d39d

See more details on using hashes here.

File details

Details for the file ai_code_recorder_client-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_code_recorder_client-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3ca5c5cf11b4aaabd2af903979c9d45d967ddd09f120e425c644a32a569b130
MD5 2176e44f56a13a856c32d9bca515b407
BLAKE2b-256 46f4eba46ebdbd65cebbfb3da1cdbec88eb1ebe1ca08c464c836047f6841b03b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page