MCP server for ML training script initialization with file locking
Project description
ML Training Init MCP Server
A Model Context Protocol (MCP) server that implements a sequential thinking pattern for ML training script generation with managed file constraints.
Key Feature: Managed File System (1 Training + 2 Configs)
IMPORTANT: This server enforces a managed file constraint system:
- 1 Training Script: The main ML training file that will be executed
- Up to 2 Config Files: Optional configuration files (YAML, JSON, .env, etc.)
- ALL operations work only with these managed files
- Prevents agents from creating unnecessary files when stuck
- Clearly identifies ML training workflows with [ML TRAINING WORKFLOW] tags
Installation
pip install -r requirements.txt
Running the Server
python -m src.server
Usage with Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"ml-training-init": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/ml-training-init-mcp"
}
}
}
Available Tools
1. initialize_training_file
- Creates the main training script file
- Takes: file_name, content, reference
- Returns: file_path, file_type, managed_files status
- AI agents use this for ML training workflows
2. create_config_file
- Creates configuration files (max 2 allowed)
- Supports: YAML, JSON, TOML, .env, .ini, etc.
- Takes: file_name, content, config_type
- Returns: file_path, file_type, managed_files status
3. get_managed_files
- Lists all managed files (training + configs)
- Shows file paths and names
- Returns: training file info, config files list
4. get_file_content
- Get content of a specific managed file
- Takes: file_name
- Returns: file_path, content, file_type
5. get_current_file
- Quick access to training file content
- Returns: file_path, content
6. monitor_and_fix
- Fix errors in any managed file
- Takes: error_trace, file_name (optional)
- Auto-parses common Python/ML errors
Testing
Run the test example:
python test_example.py
This will show you how to interact with the MCP server through Claude.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ml_training_init_mcp-0.2.1.tar.gz.
File metadata
- Download URL: ml_training_init_mcp-0.2.1.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20d64cd90467b17f9c4f18cc4f97d316d1545217dbe349f749ae9f4a5c271710
|
|
| MD5 |
0b1eec0799dfeff3e6d78c5884185368
|
|
| BLAKE2b-256 |
9b9174f26e063c15d1d4593e02a3e03e2b7cdada61a9961a36840ed844f11b8e
|
File details
Details for the file ml_training_init_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: ml_training_init_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41d37033bd18c227fb76415918360027e6e63be92a48cd4064433fb11f920c88
|
|
| MD5 |
9f4c5e4e5d808c7621e25d67fb37e64c
|
|
| BLAKE2b-256 |
372e01ce2089c539ac6af3bdeded37c939b45ba7e45fa539602d0aeb331410e4
|