Skip to main content

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

ml_training_init_mcp-0.2.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_training_init_mcp-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file ml_training_init_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: ml_training_init_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for ml_training_init_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9720ec0bead872a278e6302138869bcc40fcf54e0110db92831a6d96ed8da10c
MD5 59eaedadea171f272d0bf7ee91669c58
BLAKE2b-256 a25c47ab2698ec3e0211e5c73650f9a8830c64f02d7a13df3822ba7be3fb7126

See more details on using hashes here.

File details

Details for the file ml_training_init_mcp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ml_training_init_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05a48a88f190e9f5b1ea1a085943793ba317545f615ffbda6fc9fe4b9bf9de92
MD5 a26ce1d07a3ebf7c353a3ed3b93d9cc9
BLAKE2b-256 6918816fd9f49ce1e4cdb36378850bbc3e9e21525cdbc588985bde41e9805612

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page