Skip to main content

Localization configurable MCP client, interacting through task files

Project description

TaskMcpClient 文件任务型MCP客户端工具

1 设计目的

在各类AI聊天桌面工具(如Claude for DesktopCursorTraeCherryStuio )中,可以方便地配置LLM模型服务和各类MCP服务端,实现LLM+MCP结合的智能体构建与测试。 但测试通过后,就可能需要部署在服务器上,在LLM和MCP服务端配置妥当情况下,让程序自动执行自然语言描述的任务。由程序控制任务指令,并取走任务执行结果。

这里构想这样的任务,请求不会太频繁,大约是分钟级。采用某个目录中的Markdown文件作为输入,采用另外目录作为输出。

这就是“文件任务型MCP客户端工具”,简称“TaskMcpClient”。

另外,TaskMcpClient作为一个通用工具,从当前工作目录读取LLM和MCP配置,不依赖于其它环境和工具。

2 安装指南

在Windows或Linux系统中,执行如下命令

uv tool install TaskMcpClient

即可得到 TaskMcpClient 可执行文件,对应目录分别是

  • 在Windows下,%HOMEPATH%\.local\bin\TaskMcpClient.exe
  • 在Linux下,$HOME/.local/bin/TaskMcpClient

3 配置指南

  1. 创建新的工作目录,假定是<TaskDir>
  2. 在终端窗口进入到 <TaskDir>
  3. 执行 TaskMcpClient 命令,可以看到该程序的运行日志,并默认进入聊天状态。此时由于没有配置LLM,会出现APIConnectionError错误,输入quit退出命令

3.1 配置LLM

编辑 <TaskDir>/.env文件,以Ollama模型为例,配置如下:

OPENAI_BASE_URL=http://127.0.0.1:11434/v1
OPENAI_API_KEY=ollama
OPENAI_MODEL=deepseek-r1

3.2 配置MCP

3.2.1 配置运行MCP服务端的命令路径

编辑 <TaskDir>/mcp.server/cmdPath.env文件,以Window环境为例,配置如下:

uv=C:\Python3.11\Scripts\uv.exe    # uv run 按指定目录下.venv创建临时环境运行
uvx=C:\Python3.11\Scripts\uvx.exe  # uvx 等同于 uv tool run,运行Python包内命令
bun=C:\Users\Administrator\.bun\bin\bun.exe  # js运行时,内置了打包器、转译器、任务运行器和 npm 客户端
bunx=C:\Users\Administrator\.bun\bin\bunx.exe  # bunx 是 bun x 的别名
python=C:\Python3.11\python.exe

3.2.2 配置MCP服务端

采用json格式,一个MCP服务端一个json文件

3.2.2.1 stdio示例

  • weather.stdio.json
{
    "command": "uv",
    "args": [
        "--directory",
        "E:/Full/Path/McpServer/weather",
        "run",
        "weather.py"
    ],
    "env": {}
}

3.2.2.2 sse示例

  • test_xuanyuan.sse.json
{
    "url": "http://127.0.0.1:8000/sse",
    "headers": {}
}

3.2.2.3 websocket

4 运行指南

4.1 交互聊天

直接运行 TaskMcpClient 命令

TaskMcpClient

4.2 任务执行

直接运行 TaskMcpClient 命令

TaskMcpClient task

5 配置任务

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

taskmcpclient-0.1.22.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

taskmcpclient-0.1.22-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file taskmcpclient-0.1.22.tar.gz.

File metadata

  • Download URL: taskmcpclient-0.1.22.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for taskmcpclient-0.1.22.tar.gz
Algorithm Hash digest
SHA256 b08ff8244863547dff018364d6b465b543f40e8f6e4195ede5114a711f1d9f5b
MD5 e7eb0514327076a5c568f68af744d3bd
BLAKE2b-256 f50aa14928aeae1b6a04075c7eeef14628245a1ed119a711c12918505b72af89

See more details on using hashes here.

File details

Details for the file taskmcpclient-0.1.22-py3-none-any.whl.

File metadata

File hashes

Hashes for taskmcpclient-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 bd58c343884df5e436cfe89cc988a69a990d0429dc72a11f0389bd5fb3b5282f
MD5 049d9322b6fdd02a8ac3ea1b5dd62d5e
BLAKE2b-256 27660cae6d3cb8aa80804b29b811e3cd0be40a7e232f7700d0515ab8448d2361

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