此项目提供了一个模型上下文协议(MCP)服务器,允许通过 label-studio-sdk 与 Label Studio 实例进行交互。它支持通过自然语言或结构化调用从 MCP 客户端对标注项目、任务和预测进行程序化管理。使用此 MCP 服务器,您可以执行如下请求:

label-studio-sdk 进行通信。MCP 服务器需要 您的 Label Studio 实例的 URL 和 API 密钥。如果通过 MCP 客户端配置文件启动服务器,可以在服务器定义中直接指定环境变量。这通常适用于客户端管理的服务器。
在您的 claude_desktop_config.json 文件或 Cursor MCP 设置中添加以下 JSON 条目:
{
"mcpServers": {
"label-studio": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/HumanSignal/label-studio-mcp-server",
"mcp-label-studio"
],
"env": {
"LABEL_STUDIO_API_KEY": "your_actual_api_key_here", // <-- 您的 API 密钥
"LABEL_STUDIO_URL": "http://localhost:8080"
}
}
}
}
MCP 服务器提供了以下工具:
get_label_studio_projects_tool():列出可用项目(ID、标题、任务数量)。get_label_studio_project_details_tool(project_id: int):检索特定项目的详细信息。get_label_studio_project_config_tool(project_id: int):获取项目的 XML 标注配置。create_label_studio_project_tool(title: str, label_config: str, ...):创建一个新的项目,包括标题、XML 配置和可选设置。返回项目详情,包括 URL。update_label_studio_project_config_tool(project_id: int, new_label_config: str):更新现有项目的 XML 标注配置。list_label_studio_project_tasks_tool(project_id: int):列出项目中的任务 ID(最多 100 个)。get_label_studio_task_data_tool(project_id: int, task_id: int):检索特定任务的数据负载。get_label_studio_task_annotations_tool(project_id: int, task_id: int):获取特定任务的现有注释。import_label_studio_project_tasks_tool(project_id: int, tasks_file_path: str):从 JSON 文件(包含任务对象列表)导入任务到项目中。返回导入摘要和项目 URL。create_label_studio_prediction_tool(task_id: int, result: List[Dict[str, Any]], ...):为特定任务创建预测。需要预测结果作为符合 Label Studio 格式的字典列表。可选参数 model_version 和 score。create_label_studio_project_tool 创建新项目。tasks.json)。import_label_studio_project_tasks_tool 导入任务,提供步骤 1 中的项目 ID 和 tasks.json 的路径。list_label_studio_project_tasks_tool 列出任务 ID。get_label_studio_task_data_tool 获取特定任务的数据。create_label_studio_prediction_tool 添加预测。如有问题或需要支持,请通过 GitHub Issues 联系我们。