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.2.tar.gz (18.0 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.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_training_init_mcp-0.2.2.tar.gz
  • Upload date:
  • Size: 18.0 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.2.tar.gz
Algorithm Hash digest
SHA256 fcc31ae8f584089c71b1e48b907d7b2580c1e8e09676661ca34323b362e5c211
MD5 998edaba11f36ee3422f609955fe730c
BLAKE2b-256 291e99e8fd75047c0c1fcb51d6e71c0e5f5235e9d2fff115f829752bf7430d1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ml_training_init_mcp-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9eede76ac5506ff7f246f50667360b2bdf48b265f7844f547952934e7174a12
MD5 8a6fb5720067dd4e42a73c88ca09c25f
BLAKE2b-256 9fbabf173a2e7ea113afadc5fcd70a10acc59ec0f6e912b1c200731d66601cda

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