Connect ochreml mcp
Connect the zero-dependency OchreML MCP server to Claude Desktop, Cursor, Windsurf, and Antigravity.
ochreml mcp exposes OchreML's classical ML, deep learning (nn.Sequential), AutoML, dataset profiling, and .dit model inspection tools over the Model Context Protocol (MCP) using JSON-RPC 2.0 over stdio (^▽^).
Because ochreml ships with zero external Python dependencies, the server starts directly from Python's standard library and the compiled Rust extension—no Node.js runtime, no fastmcp package, and no background daemon required.
Prerequisites
Install ochreml in your environment, or run it ephemerally with uvx:
# Option 1: Install into your active Python environment
pip install ochreml
# Option 2: Verify ephemeral execution with uvx (no global install needed)
uvx --from ochreml ochreml info --jsonAlways pass --root <dir> (or set OCHREML_MCP_ROOT) so the MCP server can only read datasets and write .dit models inside your chosen workspace directory.
Quick Smoke Test
You can test the server locally from your terminal by piping a JSON-RPC initialize request over stdin:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | ochreml mcp --root ./workspaceYou should see a single compact JSON-RPC response on stdout advertising protocolVersion: "2024-11-05" and serverInfo.name: "ochreml-mcp".
Client Configuration
Pick your MCP host below and replace /path/to/ml-workspace with the directory containing your datasets and .dit model files.
Claude Desktop
Add ochreml to claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Using an installed ochreml binary:
{
"mcpServers": {
"ochreml": {
"command": "ochreml",
"args": ["mcp", "--root", "/path/to/ml-workspace"]
}
}
}Or zero-install via uvx:
{
"mcpServers": {
"ochreml": {
"command": "uvx",
"args": ["--from", "ochreml", "ochreml", "mcp", "--root", "/path/to/ml-workspace"]
}
}
}Restart Claude Desktop after saving the file.
Cursor
Create or edit .cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"ochreml": {
"command": "ochreml",
"args": ["mcp", "--root", "${workspaceFolder}"],
"env": {
"OCHREML_DEBUG": "0"
}
}
}
}If ochreml is installed inside a specific virtual environment, point "command" to /path/to/.venv/bin/ochreml or use uvx:
{
"mcpServers": {
"ochreml": {
"command": "uvx",
"args": ["--from", "ochreml", "ochreml", "mcp", "--root", "${workspaceFolder}"]
}
}
}Windsurf
Edit ~/.codeium/windsurf/mcp_config.json and register the ochreml server:
{
"mcpServers": {
"ochreml": {
"command": "uvx",
"args": ["--from", "ochreml", "ochreml", "mcp", "--root", "/path/to/ml-workspace"]
}
}
}Reload MCP servers in Windsurf from the Cascade MCP panel.
Antigravity
Add ochreml to your Antigravity MCP server configuration (~/.gemini/antigravity/mcp_config.json):
{
"mcpServers": {
"ochreml": {
"command": "ochreml",
"args": ["mcp", "--root", "/path/to/ml-workspace"]
}
}
}You can also launch via python -m ochreml mcp --root /path/to/ml-workspace if your host environment does not put Python script entry points on PATH.
First Agent Workflow
Once connected, try asking your AI assistant:
- "Check my hardware capabilities with
ochreml_device_info." - "Profile
data/housing.csvwith targetpriceusingochreml_dataset_profile." - "Run 3-fold AutoML comparison on
data/housing.csvtargetingpriceand save the best model tomodels/housing_best.dit." - "Verify
models/housing_best.ditand inspect its.ditheader and metadata."
The assistant will invoke ochreml_device_info, ochreml_dataset_profile, ochreml_compare, ochreml_verify_dit, and ochreml_inspect_dit inside your contained root directory (*≧ω≦*).
Next Steps
Security Guardrails
Configure --root / OCHREML_MCP_ROOT containment, .dit validation, and OCHREML_DEBUG=1 diagnostics.
MCP Tools Reference
Schemas, parameters, and JSON examples for all 9 ochreml mcp tools.
Resources & JSON-RPC Protocol
Catalog URIs (ochreml://catalog/estimators, ochreml://catalog/nn) and JSON-RPC 2.0 methods.
Architecture & Latency
How zero-dep stdio JSON-RPC, shared _ops.py, and PEP 562 lazy loading keep roundtrips fast.