Label Studio MCP Server is a Model Context Protocol (MCP) server designed to interact with Label Studio instances through the label-studio-sdk. It allows MCP clients to programmatically manage annotation projects, tasks, and predictions via natural language or structured calls.
Purpose
The server is used to automate data annotation workflows in Label Studio. Users can send requests through an MCP client, for example:
- "Create a project in Label Studio containing this data..."
- "How many tasks in my RAG review project have been annotated?"
- "Add predictions to my tasks."
- "Update my annotation template to include a comment box."
Main Capabilities
- Project Management: Create, update, list, and view detailed information and configuration for Label Studio projects.
- Task Management: Import tasks from files, list tasks in a project, and retrieve task data and annotations.
- Prediction Integration: Add model predictions for specific tasks.
- SDK Integration: Use the official label-studio-sdk for communication.
Usage
Prerequisites
- A running Label Studio instance: You need a Label Studio instance that is accessible from the location where the MCP server runs.
- API key: Obtain the API key from the user account settings in Label Studio.
Configuration
The MCP server requires the URL and API key of the Label Studio instance. If the server is started through an MCP client configuration file, environment variables can be specified directly in the server definition. This is usually the preferred way for clients to manage servers. Add the following JSON entry to the claude_desktop_config.json file or Cursor MCP settings: (A configuration example should be included here, but the original material does not provide the specific JSON content, so it is not provided for now.)
Available Tools
The MCP server exposes the following tools:
Project Management
get_label_studio_projects_tool(): List available projects (ID, title, number of tasks).get_label_studio_project_details_tool(project_id: int): Get detailed information about a specific project.get_label_studio_project_config_tool(project_id: int): Get the project's XML annotation configuration.create_label_studio_project_tool(title: str, label_config: str, ...): Create a new project, including title, XML configuration, and optional settings. Return project details, including the URL.update_label_studio_project_config_tool(project_id: int, new_label_config: str): Update the XML annotation configuration of an existing project.
Task Management
list_label_studio_project_tasks_tool(project_id: int): List task IDs in a project (up to 100).get_label_studio_task_data_tool(project_id: int, task_id: int): Get the data payload of a specific task.get_label_studio_task_annotations_tool(project_id: int, task_id: int): Get existing annotations for a specific task.import_label_studio_project_tasks_tool(project_id: int, tasks_file_path: str): Import tasks into a project from a JSON file (containing a list of task objects). Return an import summary and the project URL.create_label_studio_prediction_tool(task_id: int, result: List[Dict[str, Any]], ...): Create a prediction for a specific task. Requires the prediction results as a list of dictionaries conforming to the Label Studio format. Optional parameters: model_version and score.
Example Use Cases
- Use
create_label_studio_project_toolto create a new project. - Prepare a JSON file containing task data (tasks.json).
- Use
import_label_studio_project_tasks_toolto import tasks, providing the project ID from step 1 and the path to tasks.json. - Use
list_label_studio_project_tasks_toolto list task IDs. - Use
get_label_studio_task_data_toolto get the data for a specific task. - Generate the prediction result structure (a list of dictionaries).
- Use
create_label_studio_prediction_toolAdd predictions.
Applicable scenarios
Suitable for teams or individuals who need to automate the management of Label Studio annotation projects, especially in data annotation workflows where they want to batch process projects, tasks, and predictions through natural language or programmatic methods.
Limitations
- Requires a running Label Studio instance and a valid API key.
- The task list returns at most 100 task IDs.
- Prediction results must comply with Label Studio's format requirements.
- Specific configuration examples and more details are not provided for now.
If you have questions or need support, please contact us through GitHub Issues.