这是一个为LLM(大型语言模型)工作流设计的辅助工具集。它包含多个本地工具,这些工具被封装成符合Model Context Protocol (MCP) 标准的服务器,供支持MCP协议的LLM客户端(如仓库中包含的代理Agent)调用。

主要功能点

该工具集通过MCP服务器提供以下能力的工具:

  • macOS系统工具: 提供与macOS操作系统交互的能力,例如读取剪贴板内容。
  • Git工具: 提供与本地Git仓库交互的能力,例如获取代码差异、检查改动大小、读取提交规范、查找仓库根目录等。
  • Markdown工具: 提供处理Markdown文件的能力,例如根据标题层级拆分Markdown内容到多个文件。

安装步骤

  1. 确保你已经安装了 'uv' 或 'pip'。建议使用 'uv' 以获得更好的性能。

  2. 克隆或下载此仓库。

  3. 导航到仓库目录。

  4. 使用 'uv' 或 'pip' 构建并安装项目包。

    uv build --all

    然后根据你的环境选择安装方式:

    • 直接安装本地构建的包:
      uv pip install <local path>/llm-and-me/dist/llm_and_me_tools-*.whl
      uv pip install <local path>/llm-and-me/dist/llm_and_me_agents-*.whl
      uv pip install <local path>/llm-and-me/dist/llm_and_me-*.whl
    • (可选,如果需要使用外部的Git MCP服务器)安装依赖:
      uv pip install mcp-server-git
    • 确保你安装了 'fastmcp' 库,它是构建MCP服务器的基础:
      uv pip install fastmcp

服务器配置

该仓库提供了多个独立的MCP服务器实现。LLM客户端(例如仓库中的llm-and-me代理)需要知道如何启动并连接到这些服务器。典型的MCP客户端需要以下格式的配置信息来启动和管理MCP服务器进程:

  • Markdown MCP服务器配置示例:

    {
      "name": "Markdown Service",
      "command": "uv",
      "args": ["run", "markdown-mcp-server"],
      "description": "Provides tools for manipulating Markdown files. Splits based on the auto-detected highest header level."
    }
    • 'name': 服务器的友好名称,用于客户端识别。
    • 'command': 启动服务器进程的命令。在这里是 'uv' 命令。
    • 'args': 传递给命令的参数列表。'run' 用于运行模块,'markdown-mcp-server' 指定要运行的服务器模块。
    • 'description': 服务器功能的简要描述。
  • macOS System MCP服务器配置示例:

    {
      "name": "macOS System Tools",
      "command": "uv",
      "args": ["run", "macos-mcp-server"],
      "description": "Provides tools for interacting with the macOS system."
    }
  • Git Tools MCP服务器配置示例:

    {
      "name": "Git Tools",
      "command": "uv",
      "args": ["run", "git-tools-mcp-server"],
      "description": "Provides tools for interacting with Git repositories."
    }

你的MCP客户端需要将这些配置作为启动参数或配置文件的一部分,以便在需要时自动启动并连接到这些本地MCP服务。

基本使用方法

这个仓库的主要用户界面是其包含的LLM代理(agent),它是一个MCP客户端,会自动连接并利用这些MCP服务器提供的功能。安装完成后,你通常会运行代理来与MCP服务器进行交互(通过代理作为中介)。

uv run llm-and-me --vi # 示例:运行llm-and-me代理,启用vi模式

运行此命令会启动代理,代理会根据其内部配置(如上面“服务器配置”所示)自动启动并连接到所需的本地MCP服务器。然后你可以在代理的命令行界面中与LLM交互,LLM可以调用这些工具来完成任务。

信息

分类

开发者工具