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 strict file locking constraints.
Key Feature: Single File Lock Constraint
IMPORTANT: This server enforces a strict single-file constraint:
- Once a training file is created, the server locks to ONLY that file
- ALL subsequent operations must work with this single locked file
- No new files can be created after initialization
- This prevents agents from creating unnecessary files when stuck
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 ONE training file and permanently locks to it
- Takes: file_name, use_case, libraries, reference_code
- Returns: file_path, checkpoint_id, locked_file status
2. enhance_code
- Modifies ONLY the locked file
- Cannot create new files
- Takes: enhancement_type, instructions
- Returns: status, checkpoint_id
3. get_current_file
- Returns content of the locked file
- Use this instead of trying to create new files
- Returns: file_path, content, checkpoint_id
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.1.0.tar.gz.
File metadata
- Download URL: ml_training_init_mcp-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05e8af70b41e1628ad2d6f92c00bdc06d35e226d9236367b5644e46a04a15b22
|
|
| MD5 |
43ec9510f49a9f81ac318b8e5fab48d3
|
|
| BLAKE2b-256 |
a18f2ce5de8cd767da8d91310cd1cb6132e8526a8961ab3cb57c1d3613ded7b3
|
File details
Details for the file ml_training_init_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ml_training_init_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
b4e68a2eb42aef425310a616b585829111f881bb92f709925eaff99b4ef27e2b
|
|
| MD5 |
e24994d3e9ec0d2c777dba395d32263e
|
|
| BLAKE2b-256 |
d7eb091717d002456621a017f7bf191ecca3c1001e7235bf8bbe9b84cfcac705
|