Read the Documentation | PyPI Package
MCP (Model Context Protocol) layer for sktime - Registry-Driven for LLMs
A semantic engine that exposes sktime's native registry and semantics to Large Language Models, enabling them to:
- 🔍 Discover valid estimators
- 🧠 Reason about estimator capabilities
- 🔗 Compose compatible estimators
- ⚡ Execute real sktime workflows on real data
This MCP is not just documentation or static code analysis. It is a semantic engine for programmatic model usage.
-
sktime as Source of Truth - No AST parsing, no repo indexing, no heuristics. All structure comes from
all_estimators, estimator tags, and sktime's API contracts. -
Registry-First - Instead of
File → Class → Infer Relationships, we doRegistry → Semantics → Safe Execution. -
Minimal MCP Surface - Exposes only what an LLM needs: Discovery, Description, Instantiation, Execution, and model persistence.
- Python 3.10+ (3.9 is listed in
pyproject.tomlbut themcppackage requires 3.10+) - pip package manager
It is recommended to use a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateThe recommended way to install is using python3 -m pip:
# Install from source
python3 -m pip install -e .
# With all optional dependencies
python3 -m pip install -e ".[all]"
# Development installation
python3 -m pip install -e ".[dev]"Alternatively, you can use pip:
# Install from source
pip install -e .
# With all optional dependencies
pip install -e ".[all]"
# Development installation
pip install -e ".[dev]"If you are new to sktime‑mcp or to MCP‑based workflows, this section provides a minimal starting point to help you verify that your setup is working correctly.
The Model Context Protocol (MCP) allows Large Language Models (LLMs) to discover, reason about, and execute sktime workflows programmatically. This project exposes sktime’s estimator registry and semantics in a structured way so that LLMs can safely compose and run real time‑series pipelines.
- Python 3.10 or newer
- A working Python virtual environment (recommended)
pipinstalled
After installing the package, you can verify that the MCP server starts correctly by running:
sktime-mcpNote: On Windows, the
sktime-mcpcommand may be installed to a directory not on yourPATH(e.g.,%APPDATA%\Python\Python3xx\Scripts). Either add that directory to yourPATHor usepython -m sktime_mcp.serverinstead.
Note: On some systems (like macOS), pip may not be available in the path. In such cases, use python3 -m pip to ensure the command runs with the intended Python version.
# Start the MCP server
sktime-mcp
# Or run directly
python -m sktime_mcp.serverThe server uses stdio transport by default, compatible with Claude Desktop, Claude Code, and other MCP clients.
Claude Desktop — add to your config file:
| Platform | Config path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
{
"mcpServers": {
"sktime": {
"command": "sktime-mcp"
}
}
}If sktime-mcp is not on your PATH, use the full path to the executable or
use python -m sktime_mcp.server as the command instead.
Discover estimators by task type and capability tags.
Arguments:
task(optional): Task type filter ("forecasting","classification","regression","transformation","clustering")tags(optional): Filter by capability tags (e.g.,{"capability:pred_int": true})limit(optional): Maximum results (default: 50)
Example:
{
"task": "forecasting",
"tags": {
"capability:pred_int": true
},
"limit": 10
}Returns: List of matching estimators with name, task, and summary info.
Search estimators by name or description using text query.
Arguments:
query(required): Search string (case-insensitive)limit(optional): Maximum results (default: 20)
Example:
{
"query": "ARIMA",
"limit": 5
}Returns: List of estimators matching the search query.
Get detailed information about a specific estimator's capabilities.
Arguments:
estimator(required): Name of the estimator (e.g.,"ARIMA","NaiveForecaster")
Example:
{
"estimator": "ARIMA"
}Returns: Full estimator details including tags, hyperparameters, docstring, and module path.
List all queryable capability tags across all estimators.
Arguments: None
Returns: List of all available tags (e.g., ["capability:pred_int", "handles-missing-data", ...])
Create a single estimator instance and return a handle.
Arguments:
estimator(required): Name of the estimator to instantiateparams(optional): Hyperparameters for the estimator
Example:
{
"estimator": "ARIMA",
"params": {
"order": [1, 1, 1],
"suppress_warnings": true
}
}Returns: {"success": true, "handle": "est_abc123", "estimator": "ARIMA", "params": {...}}
Create a complete pipeline from a list of components (transformers → forecaster).
Arguments:
components(required): List of estimator names in pipeline orderparams_list(optional): List of parameter dicts for each component
Example:
{
"components": ["ConditionalDeseasonalizer", "Detrender", "ARIMA"],
"params_list": [{}, {}, {"order": [1, 1, 1]}]
}Returns: {"success": true, "handle": "est_xyz789", "pipeline": "ConditionalDeseasonalizer → Detrender → ARIMA", ...}
Note: This solves the "steps problem" - you don't need to instantiate components separately!
Project documentation lives in docs/ and can be served locally with MkDocs:
pip install -e ".[dev]"
mkdocs serveThe MkDocs config is in mkdocs.yml.
Check if a proposed pipeline composition is valid before instantiation.
Arguments:
components(required): List of estimator names in pipeline order
Example:
{
"components": ["Detrender", "ARIMA"]
}Returns: {"valid": true/false, "errors": [...], "warnings": [...], "suggestions": [...]}
Execute a complete workflow: load dataset, fit estimator, and generate predictions.
Arguments:
estimator_handle(required): Handle frominstantiate_estimatororinstantiate_pipelinedataset(required): Dataset name (e.g.,"airline","sunspots","lynx")horizon(optional): Forecast horizon (default: 12)
Example:
{
"estimator_handle": "est_abc123",
"dataset": "airline",
"horizon": 12
}Returns: {"success": true, "predictions": {1: 450.2, 2: 455.1, ...}, "horizon": 12}
Persist a fitted estimator or pipeline handle to a local filesystem path using sktime.utils.mlflow_sktime.save_model.
Arguments:
estimator_handle(required): Handle frominstantiate_estimatororinstantiate_pipelinepath(required): Local filesystem path where the model should be savedmlflow_params(optional): Extra keyword arguments forwarded tosktime.utils.mlflow_sktime.save_model
Example:
{
"estimator_handle": "est_abc123",
"path": "/absolute/path/to/model_dir",
"mlflow_params": {
"serialization_format": "cloudpickle"
}
}Returns: {"success": true, "saved_path": "/absolute/path/to/model_dir", "message": "Model saved successfully to '/absolute/path/to/model_dir'"}
Note: This tool requires MLflow to be available in the server environment.
List all available data — both system demo datasets and active user-loaded data handles — in a single unified response.
Arguments:
is_demo(optional):truereturns only demo datasets,falsereturns only active data handles, omit to get both
Returns: {"success": true, "system_demos": ["airline", "sunspots", ...], "active_handles": [...], "total": 8}
Load data from various sources (CSV/Parquet files, pandas DataFrames, SQL databases, URLs).
Arguments:
config(required): Data source configuration object. Must include"type"("pandas","sql","file","url").
Example:
{
"config": {
"type": "file",
"path": "/absolute/path/to/data.csv",
"time_column": "date",
"target_column": "value"
}
}Returns: {"success": true, "data_handle": "data_abc123", "metadata": {...}}
Fit an estimator and generate predictions using a custom data handle (instead of a demo dataset).
Arguments:
estimator_handle(required): Handle frominstantiate_estimatordata_handle(required): Handle fromload_data_sourcehorizon(optional): Forecast horizon (default: 12)
Returns: Same format as fit_predict.
Export an estimator or pipeline as executable Python code.
Arguments:
handle(required): Handle ID of the estimator/pipelinevar_name(optional): Variable name in generated code (default:"model")include_fit_example(optional): Include a fit/predict example (default:false)
Returns: {"success": true, "code": "from sktime..."}
Non-blocking version of fit_predict. Returns a job_id immediately; use check_job_status to poll.
Arguments: Same as fit_predict.
Returns: {"success": true, "job_id": "abc-123", "message": "Training job started..."}
Check the status and progress of a background job.
Arguments:
job_id(required): Job ID to check
List all background jobs with optional status filter.
Arguments:
status(optional): Filter by status ("pending","running","completed","failed","cancelled")limit(optional): Maximum results (default: 20)
Automatically format time series data (infer frequency, remove duplicates, fill missing values).
Arguments:
data_handle(required): Handle fromload_data_sourceauto_infer_freq(optional): Infer and set frequency (default:true)fill_missing(optional): Fill missing values (default:true)remove_duplicates(optional): Remove duplicate timestamps (default:true)
User Prompt: "Forecast monthly airline passengers using a probabilistic model."
LLM Steps:
-
Discover Models
list_estimators(task="forecasting", tags={"capability:pred_int": true}) -
Inspect Choice
describe_estimator(estimator="ARIMA") -
Instantiate
instantiate_estimator(estimator="ARIMA", params={"order": [1,1,1]}) → Returns: {"handle": "est_abc123"} -
Execute
fit_predict(estimator_handle="est_abc123", dataset="airline", horizon=12) → Returns: {"predictions": {1: 450.2, 2: 455.1, ...}}
User Prompt: "Forecast with deseasonalization and detrending preprocessing."
LLM Steps:
-
Validate Composition
validate_pipeline(components=["ConditionalDeseasonalizer", "Detrender", "ARIMA"]) → Returns: {"valid": true} -
Instantiate Pipeline (single call!)
instantiate_pipeline( components=["ConditionalDeseasonalizer", "Detrender", "ARIMA"], params_list=[{}, {}, {"order": [1,1,1]}] ) → Returns: {"handle": "est_xyz789", "pipeline": "ConditionalDeseasonalizer → Detrender → ARIMA"} -
Execute
fit_predict(estimator_handle="est_xyz789", dataset="airline", horizon=12) → Returns: {"predictions": {...}}
sktime-mcp/
├── src/sktime_mcp/
│ ├── server.py # MCP server entry point
│ ├── registry/ # Registry interface & tag resolver
│ ├── composition/ # Pipeline composition validator
│ ├── runtime/ # Execution engine, handle & job management
│ ├── data/ # Data adapters (file, pandas, SQL, URL)
│ └── tools/ # MCP tool implementations
├── docs/ # MkDocs documentation source
├── examples/ # Usage examples
└── tests/ # Test suite
pytest tests/Run standardized local checks before raising a PR:
make checkAuto-fix formatting and fixable lint issues:
make format-fixIf make is unavailable (common on Windows), run the equivalent commands:
python -m black --check .
python -m ruff check .
python -m pytest