MLX MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MLX MCP ServerShow VRAM usage"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MLX MCP Server 🚀
Model Context Protocol server for ML Offload System
Unified interface for LLM inference management via Model Context Protocol (MCP). Control your ML models directly from Claude Desktop, VSCode, Zed Editor, or Amazon Bedrock.
Features
Core Functionality
🧠 Model Registry Access - List, search, and inspect ML models
🎮 Backend Control - Load/unload/switch models across backends (Ollama, llama.cpp, vLLM, TGI)
📊 VRAM Monitoring - Real-time GPU memory status
⚡ Hot-Reload - Switch models without restarting services
🔧 Auto-Discovery - Trigger model scans to update registry
🏥 Health Checks - Monitor ML Offload API status
💰 Token Economy (NEW!)
Smart Caching - Per-tool TTL (5min for models, 10s for VRAM)
Auto-Summarization - Concise responses by default (~80-90% token savings)
Rate Limiting - Prevents API abuse and excessive costs
Cache Statistics - Monitor hit rate and savings
Verbose Mode - Full JSON when needed (
verbose: true)
Cost Savings: ~80% reduction in API costs (Amazon/Anthropic billing)
Related MCP server: Kernel MCP Server
Prerequisites
ML Offload API running on
http://localhost:9000(See/etc/nixos/modules/ml/offloadfor setup)Node.js 18+
node --version # Should be 18.0.0 or higher
Installation
# Clone or navigate to this directory
cd ~/dev/mlx-mcp
# Install dependencies
npm install
# Build TypeScript
npm run buildConfiguration
Environment Variables
# Optional: Change ML Offload API URL (default: http://localhost:9000)
export ML_OFFLOAD_API_URL="http://localhost:9000"Usage
1. Claude Desktop (Recommended)
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"mlx": {
"command": "node",
"args": ["/home/kernelcore/dev/mlx-mcp/dist/index.js"],
"env": {
"ML_OFFLOAD_API_URL": "http://localhost:9000"
}
}
}
}Restart Claude Desktop and you'll see MLX tools available!
2. VSCode / VSCodium (via Continue extension)
Install Continue extension
Add to
.continue/config.json:
{
"experimental": {
"modelContextProtocol": true
},
"mcpServers": {
"mlx": {
"command": "node",
"args": ["/home/kernelcore/dev/mlx-mcp/dist/index.js"]
}
}
}Reload VSCode and access via Continue chat
3. Zed Editor
Add to Zed settings (~/.config/zed/settings.json):
{
"context_servers": {
"mlx-mcp": {
"command": "node",
"args": ["/home/kernelcore/dev/mlx-mcp/dist/index.js"]
}
}
}4. Amazon Bedrock
Use with Bedrock Agent runtime via stdio:
import subprocess
import json
# Start MCP server
process = subprocess.Popen(
["node", "/home/kernelcore/dev/mlx-mcp/dist/index.js"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# Send MCP request
request = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_models",
"arguments": {}
}
}
process.stdin.write((json.dumps(request) + "\n").encode())
process.stdin.flush()
# Read response
response = process.stdout.readline()
print(json.loads(response))Available Tools
📋 Model Management
list_models- List all models in registryFilters:
format,backend,limitExample: "List all GGUF models compatible with llamacpp"
get_model_info- Get detailed model informationArgs:
model_idExample: "Show details for model ID 5"
trigger_model_scan- Scan/var/lib/ml-modelsfor new modelsNo args required
Example: "Scan for new models"
⚙️ Backend Operations
list_backends- Show all available backendsNo args required
Example: "Show available backends"
load_model- Load model on backendArgs:
model_id,backend,priority(optional),gpu_layers(optional)Example: "Load model 3 on llamacpp with 24 GPU layers"
unload_model- Unload model from backendArgs:
backendExample: "Unload model from ollama"
switch_model- Hot-switch model on backendArgs:
backend,model_id,gpu_layers(optional)Example: "Switch llamacpp to model 7"
📊 Monitoring
get_vram_status- Real-time GPU VRAM statusNo args required
Example: "Show VRAM usage"
get_status- Complete system statusShows VRAM, backends, loaded models
Example: "Show system status"
health_check- Check ML Offload API healthNo args required
Example: "Is the ML API healthy?"
Example Prompts (for Claude/AI Assistants)
"List all GGUF models smaller than 5GB"
→ Calls: list_models with format filter
"What's the VRAM usage right now?"
→ Calls: get_vram_status
"Load mistral-7b-q4 on llamacpp with 28 GPU layers"
→ Calls: load_model with specific params
"Show me model 12's details"
→ Calls: get_model_info with model_id=12
"Scan for new models I just added"
→ Calls: trigger_model_scan
"Switch ollama to the new qwen model (ID 18)"
→ Calls: switch_model with backend=ollama, model_id=18Development
# Watch mode (auto-rebuild on changes)
npm run dev
# Build
npm run build
# Run
npm startTroubleshooting
"Connection refused" error
Problem: MCP server can't reach ML Offload API
Solution:
# Check if ML Offload API is running
curl http://localhost:9000/health
# If not, enable it in NixOS config:
# /etc/nixos/hosts/kernelcore/configuration.nix
kernelcore.ml.offload.enable = true;
kernelcore.ml.offload.api.enable = true;
# Rebuild NixOS
sudo nixos-rebuild switchTools not appearing in Claude Desktop
Problem: MCP tools not showing up
Solution:
Check config file path is correct
Verify
dist/index.jsexists (runnpm run build)Restart Claude Desktop completely
Check logs in Console.app (macOS) or journalctl (Linux)
"Permission denied" error
Problem: Can't execute server
Solution:
chmod +x /home/kernelcore/dev/mlx-mcp/dist/index.jsArchitecture
┌─────────────────────────────────────────────────────────────┐
│ AI Assistant (Claude/VSCode/Zed) │
└────────────────────────┬────────────────────────────────────┘
│ MCP Protocol (stdio)
│
┌────────────────────────▼────────────────────────────────────┐
│ MLX MCP Server (TypeScript) │
│ - Tool handlers │
│ - Request/Response formatting │
│ - Error handling │
└────────────────────────┬────────────────────────────────────┘
│ HTTP REST API
│
┌────────────────────────▼────────────────────────────────────┐
│ ML Offload Manager API (Rust + Axum) │
│ - Model Registry (SQLite) │
│ - VRAM Intelligence (nvidia-smi) │
│ - Backend Orchestration │
└────────────────────────┬────────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌────────┐ ┌─────────┐ ┌──────┐
│ Ollama │ │llama.cpp│ │ vLLM │
└────────┘ └─────────┘ └──────┘License
MIT - See LICENSE file
Support
ML Offload Documentation:
/etc/nixos/docs/MCP Protocol Docs: https://modelcontextprotocol.io
Issues: File in this repository
Made with ❤️ by kernelcore
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/marcosfpina/mlx-coda'
If you have feedback or need assistance with the MCP directory API, please join our Discord server