Skip to main content

MCP server that provides different tools for MLE

Project description

MLE kit MCP

PyPI CI License

MCP server providing practical tools for ML engineering workflows, including local/remote bash, a text editor, file search, remote GPU helpers (via vast.ai), and an OpenRouter LLM proxy.

Features

  • bash: Run commands in an isolated Docker container mounted to your WORKSPACE_DIR.
  • text_editor: View and edit files and directories in your workspace with undo support.
  • glob / grep: Fast filename globbing and ripgrep-based content search.
  • remote_bash / remote_text_editor / remote_download: Execute and edit on a remote GPU machine and sync files to/from it.
  • llm_proxy_local / llm_proxy_remote: Launch an OpenAI-compatible proxy backed by OpenRouter locally (in the bash container) or on the remote GPU.

Requirements

  • Python 3.12+
  • Docker daemon available (for bash tool)
  • ripgrep (rg) installed on the host (for grep tool)
  • WORKSPACE_DIR should be set with a path to working directory
  • Optional (for remote GPU tools): a VAST_AI_KEY with billing set up on vast.ai
  • Optional (for LLM proxy tools): an OPENROUTER_API_KEY

Install

Using uv (recommended):

uv sync

Or standard pip install:

python -m venv .venv && . .venv/bin/activate
pip install -e .

Run the MCP server

Set a workspace directory and start the server. The MCP endpoint is served at /mcp.

WORKSPACE_DIR=/absolute/path/to/workdir uv run python -m mle_kit_mcp --port 5057

Defaults:

  • PORT defaults to 5057 if --port is not provided
  • mount_path=/ and streamable_http_path=/mcp

Claude Desktop config

{
  "mcpServers": {
    "mle_kit": {
      "command": "python3",
      "args": [
        "-m",
        "mle_kit_mcp",
        "--transport",
        "stdio"
      ]
    }
  }
}

Tools overview

  • bash(command, cwd=None, timeout=60): Runs inside a python:3.12-slim container with your workspace bind-mounted at /workdir. State persists between calls. Timeouts return a helpful message.
  • text_editor(command, path, ...): Supports view, write, append, insert, str_replace (with optional dry_run), and undo_edit. Only relative paths under the workspace are allowed.
  • glob(pattern, path=None): Returns matching files under the workspace (optionally under path), sorted by modification time.
  • grep(pattern, path=None, glob=None, output_mode=..., ...): ripgrep wrapper. Install rg on the host to enable. Output modes: files_with_matches, content, count.
  • remote_bash(command, timeout=60): Runs commands on a remote vast.ai instance. Manages lifecycle unless you supply an existing instance (see env vars below).
  • remote_download(file_path): Copies a file from the remote (/root/<file_path>) to your workspace.
  • remote_text_editor(...): Same API as text_editor, but syncs the file(s) before and after edits to the remote.
  • llm_proxy_local() / llm_proxy_remote(): Starts a small FastAPI OpenAI-compatible server backed by OpenRouter, returning a JSON string with url and scope.

Configuration (env vars)

All variables can be placed in a local .env file or exported in your shell.

  • WORKSPACE_DIR (required): Absolute path to your workspace directory.
  • PORT (optional): Default server port (defaults to 5057).

Remote GPU (vast.ai):

  • GPU_TYPE (default: RTX_3090)
  • DISK_SPACE (GB, default: 300)
  • EXISTING_INSTANCE_ID (optional): Use an existing vast.ai instance instead of creating a new one.
  • EXISTING_SSH_KEY (optional): Path to an SSH private key to use with the existing instance.
  • VAST_AI_KEY (optional but required to launch new instances)

OpenRouter proxy:

  • OPENROUTER_API_KEY (optional but required for proxy tools)
  • OPENROUTER_BASE_URL (default: https://openrouter.ai/api/v1)

Notes:

  • The remote GPU helper will generate an SSH key at ~/.ssh/id_rsa if one is missing, and attach it to the instance.
  • Creating/destroying instances may incur cost; be mindful of environment defaults.

Development

Run tests:

make test

Lint / type-check / format:

make validate

Docker

You can also build and run via the provided Dockerfile:

docker build -t mle_kit_mcp .
docker run --rm -p 5057:5057 \
  -e PORT=5057 \
  -e WORKSPACE_DIR=/workspace \
  -v "$PWD/workdir:/workspace" \
  mle_kit_mcp

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

mle_kit_mcp-1.2.5.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

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

mle_kit_mcp-1.2.5-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file mle_kit_mcp-1.2.5.tar.gz.

File metadata

  • Download URL: mle_kit_mcp-1.2.5.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for mle_kit_mcp-1.2.5.tar.gz
Algorithm Hash digest
SHA256 748416d6ca3a52c32da07ffef01e88d0b76ccb113d535783a3ac1c35af699321
MD5 edef77075f3ffc8f4b38d8a5bf3c9817
BLAKE2b-256 79e68f071f3d84d2b8d2712e3501c22752aacc417035104c4bbba97daa02b25a

See more details on using hashes here.

File details

Details for the file mle_kit_mcp-1.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mle_kit_mcp-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e96ff32d2795a4554e6a2d6b0a950eeeb17e7d58a2e7fd1f84bf08d7d7291097
MD5 fb7c1d3bc41a77bd3424f2cfd3fe07f6
BLAKE2b-256 ba2eb6e6aae98ed79bcfac4aec19165f04531940bcad130ea23c5c3d0d36ea75

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