Sponsored by Deepsite.site

Label Studio MCP Server

Created By
Human Signal8 months ago
The Label Studio MCP enables seamless management and orchestration of data labeling workflows within Label Studio, the leading open-source data annotation platform. With this MCP, users can programmatically create and configure labeling projects, manage tasks at scale, and automate prediction workflows—empowering teams to efficiently curate high-quality training data for machine learning and AI initiatives.
Content

Label Studio MCP Server

Overview

This project provides a Model Context Protocol (MCP) server that allows interaction with a Label Studio instance using the label-studio-sdk. It enables programmatic management of labeling projects, tasks, and predictions via natural language or structured calls from MCP clients. Using this MCP Server, you can make requests like:

  • "Create a project in label studio with this data ..."
  • "How many tasks are labeled in my RAG review project?"
  • "Add predictions for my tasks."
  • "Update my labeling template to include a comment box."
Example usage of Label Studio MCP Server

Features

  • Project Management: Create, update, list, and view details/configurations of Label Studio projects.
  • Task Management: Import tasks from files, list tasks within projects, and retrieve task data/annotations.
  • Prediction Integration: Add model predictions to specific tasks.
  • SDK Integration: Leverages the official label-studio-sdk for communication.

Prerequisites

  1. Running Label Studio Instance: You need a running instance of Label Studio accessible from where this MCP server will run.
  2. API Key: Obtain an API key from your user account settings in Label Studio.
  3. Python Environment: Python 3.x with uv installed for package management is recommended.

Installation

Follow these instructions to install the server.

git clone https://github.com/HumanSignal/label-studio-mcp-server.git 
cd label-studio-mcp-server

# Install dependencies using uv
uv venv
source .venv/bin/activate 
uv sync

Configuration

The MCP server requires the URL and API key for your Label Studio instance. There are two main ways to configure this:

  1. Environment Variables: Set the following environment variables in your terminal session before running the server:

    export LABEL_STUDIO_URL='http://localhost:8080' # Replace with your LS URL
    export LABEL_STUDIO_API_KEY='your_actual_api_key_here'
    
    python label-studio-mcp.py
    

    The Python script reads these using os.getenv().

  2. MCP Client Configuration (e.g., Cursor's mcp.json): If launching the server via an MCP client configuration file, you can specify the environment variables directly within the server definition. This is often preferred for client-managed servers.

    Example mcp.json entry:

    {
      "mcpServers": {
        "label-studio": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/your/label-studio-mcp-server", // <-- Update this path
                "run",
                "label-studio-mcp.py"
            ],
            "env": {
                "LABEL_STUDIO_API_KEY": "your_actual_api_key_here", // <-- Your API key
                "LABEL_STUDIO_URL": "http://localhost:8080"
            }
        }
      }
    }
    

    When configured this way, the env block injects the variables into the server process environment, and the script's os.getenv() calls will pick them up.

Install for Claude Desktop

To install the MCP server for Claude Desktop, you can run the following command from the root of this repository:

mcp install -e . -v LABEL_STUDIO_API_KEY=<your_api_key> -v LABEL_STUDIO_URL=<your_label_studio_url> label-studio-mcp.py

Tools

The MCP server exposes the following tools:

Project Management

  • get_label_studio_projects_tool(): Lists available projects (ID, title, task count).
  • get_label_studio_project_details_tool(project_id: int): Retrieves detailed information for a specific project.
  • get_label_studio_project_config_tool(project_id: int): Fetches the XML labeling configuration for a project.
  • create_label_studio_project_tool(title: str, label_config: str, ...): Creates a new project with a title, XML config, and optional settings. Returns project details including a URL.
  • update_label_studio_project_config_tool(project_id: int, new_label_config: str): Updates the XML labeling configuration for an existing project.

Task Management

  • list_label_studio_project_tasks_tool(project_id: int): Lists task IDs within a project (up to 100).
  • get_label_studio_task_data_tool(project_id: int, task_id: int): Retrieves the data payload for a specific task.
  • get_label_studio_task_annotations_tool(project_id: int, task_id: int): Fetches existing annotations for a specific task.
  • import_label_studio_project_tasks_tool(project_id: int, tasks_file_path: str): Imports tasks from a JSON file (containing a list of task objects) into a project. Returns import summary and project URL.

Predictions

  • create_label_studio_prediction_tool(task_id: int, result: List[Dict[str, Any]], ...): Creates a prediction for a specific task. Requires the prediction result as a list of dictionaries matching the Label Studio format. Optional model_version and score.

Example Use Case

  1. Create a new project using create_label_studio_project_tool.
  2. Prepare a JSON file (tasks.json) with task data.
  3. Import tasks using import_label_studio_project_tasks_tool, providing the project ID from step 1 and the path to tasks.json.
  4. List task IDs using list_label_studio_project_tasks_tool.
  5. Get data for a specific task using get_label_studio_task_data_tool.
  6. Generate a prediction result structure (list of dicts).
  7. Add the prediction using create_label_studio_prediction_tool.

Running the Server

The MCP server can be run directly using Python:

python label-studio-mcp.py [options]

Options:

  • --transport {http|stdio}: Specify the communication transport (default: stdio).
  • --port PORT: Set the port number for the HTTP transport (default: 3000).
  • --host HOST: Set the host address for the HTTP transport (default: 0.0.0.0).

Ensure the required environment variables (LABEL_STUDIO_URL, LABEL_STUDIO_API_KEY) are set before running.

Contact

For questions or support, reach out via GitHub Issues.

Server Config

{
  "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_API_KEY>",
        "LABEL_STUDIO_URL": "<YOUR_LABEL_STUDIO_URL>"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server