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 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

ml_training_init_mcp-0.1.0.tar.gz (8.2 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.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for ml_training_init_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05e8af70b41e1628ad2d6f92c00bdc06d35e226d9236367b5644e46a04a15b22
MD5 43ec9510f49a9f81ac318b8e5fab48d3
BLAKE2b-256 a18f2ce5de8cd767da8d91310cd1cb6132e8526a8961ab3cb57c1d3613ded7b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ml_training_init_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4e68a2eb42aef425310a616b585829111f881bb92f709925eaff99b4ef27e2b
MD5 e24994d3e9ec0d2c777dba395d32263e
BLAKE2b-256 d7eb091717d002456621a017f7bf191ecca3c1001e7235bf8bbe9b84cfcac705

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