Skip to content

[Bug]构造mcp服务器一直报错 #1657

@wanyafei

Description

@wanyafei

发生了什么

配置mcp uv 提示无可用的工具,保存后控制台有报错,请问各位大神有知道的吗
mcp配置信息是:{
"command": "uv",
"args": [
"run",
"/home/work/Mcp_server/mcprun.py"
]
}
控制台报错信息如下:
[21:07:39] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Building astrbot @ file:///AstrBot
[21:07:39] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pip (1.7MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading dashscope (1.2MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading aiohttp (1.5MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pydantic-core (1.9MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading lxml (4.9MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading lark-oapi (6.0MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pillow (4.4MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pycryptodome (2.2MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading cryptography (4.0MiB)
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] × Failed to build astrbot @ file:///AstrBot
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] ├─▶ The build backend returned an error
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] ╰─▶ Call to hatchling.build.build_editable failed (exit status: 1)
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp]
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] [stderr]
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Traceback (most recent call last):
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File "", line 11, in
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/build.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 83, in build_editable
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] return os.path.basename(next(builder.build(directory=wheel_directory,
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] versions=['editable'])))
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 90, in build
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] self.metadata.validate_fields()
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 266, in validate_fields
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] self.core.validate_fields()
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 1366, in validate_fields
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] getattr(self, attribute)
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 531, in readme
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] raise OSError(message)
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] OSError: Readme file does not exist: README.md
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp]
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] hint: This usually indicates a problem with the package or the build
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] environment.

如何复现?

mcp配置后保存看控制台:{
"command": "uv",
"args": [
"run",
"/home/work/Mcp_server/mcprun.py"
]
}

AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

docker 部署的astrbot

操作系统

Linux

报错日志

[21:07:39] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Building astrbot @ file:///AstrBot
[21:07:39] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pip (1.7MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading dashscope (1.2MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading aiohttp (1.5MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pydantic-core (1.9MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading lxml (4.9MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading lark-oapi (6.0MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pillow (4.4MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading pycryptodome (2.2MiB)
[21:07:40] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Downloading cryptography (4.0MiB)
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] × Failed to build astrbot @ file:///AstrBot
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] ├─▶ The build backend returned an error
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] ╰─▶ Call to hatchling.build.build_editable failed (exit status: 1)
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp]
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] [stderr]
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] Traceback (most recent call last):
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File "", line 11, in
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/build.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 83, in build_editable
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] return os.path.basename(next(builder.build(directory=wheel_directory,
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] versions=['editable'])))
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 90, in build
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] self.metadata.validate_fields()
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 266, in validate_fields
[21:07:53] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] self.core.validate_fields()
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 1366, in validate_fields
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] getattr(self, attribute)
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] File
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] "/root/.cache/uv/builds-v0/.tmpWlTB9y/lib/python3.10/site-packages/hatchling/metadata/core.py",
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] line 531, in readme
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] raise OSError(message)
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] OSError: Readme file does not exist: README.md
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp]
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] hint: This usually indicates a problem with the package or the build
[21:07:54] [Core] [ERRO] [utils.log_pipe:31]: [MCPServer-my_mcp] environment.

你愿意提交 PR 吗?

  • 是的,我愿意提交 PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions