Cortex
Allows monitoring and tuning PyTorch neural network training loops, providing tools to observe metrics, detect anomalies, and adjust hyperparameters with guardrails.
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., "@CortexDiagnose the current training run for anomalies"
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.
Cortex
MCP server that lets AI agents monitor and tune neural network training in real time.
Instead of staring at loss curves and manually adjusting hyperparameters, connect an AI agent to your training loop. It watches metrics, detects anomalies, and makes guarded interventions — with safety rails to prevent it from doing more harm than good.
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌───────────────┐
│ Training Loop │────▶│ Telemetry │◀────│ AI Agent │
│ │ │ (tracker.log) │ │ (via MCP) │
│ PyTorch / MLX │◀────│ │────▶│ │
│ JAX / any │ │ ┌────────────┐ │ │ diagnose() │
│ │ │ │ Detectors │ │ │ adjust_param()│
│ tracker.poll() │ │ │ Guardrails │ │ │ rollback() │
│ get_override() │ │ │ Log │ │ │ save/restore │
└─────────────────┘ └──────────────────┘ └───────────────┘Three layers:
Telemetry — metrics, config, checkpoints, history
Detectors — rule-based anomaly detection producing typed findings (entropy collapse, loss divergence, gradient spikes, eval plateau, loss imbalance)
Guardrails — safety constraints on interventions (max % change, cooldowns, rate limits, checkpoint-before-action requirement, full intervention log)
Related MCP server: M3Mgine
Quick Start
In your training code
from cortex import tracker
tracker.config(total_steps=100000, lr=3e-4, batch_size=64)
@tracker.on_checkpoint
def save(tag):
torch.save(model.state_dict(), f"checkpoints/{tag}.pt")
@tracker.on_rollback
def rollback(tag):
model.load_state_dict(torch.load(f"checkpoints/{tag}.pt"))
return True
for step in range(100000):
loss = train_step()
tracker.log(step=step, loss=loss, entropy=ent, grad_norm=gnorm)
# Process agent commands (checkpoint, rollback, pause/resume)
tracker.poll()
# Pick up live param adjustments
new_lr = tracker.get_override("lr")
if new_lr is not None:
optimizer.lr = new_lrConnect an agent
{
"mcpServers": {
"cortex": {
"command": "cortex"
}
}
}MCP Tools
Observe
Tool | Description |
| Step, progress %, ETA, steps/sec, phase |
| Latest values of all tracked metrics |
| Time series for trend analysis |
| Hyperparameter configuration |
| All metric names being tracked |
Detect
Tool | Description |
| Run all anomaly detectors, get structured findings with severity and recommendations |
Intervene
Tool | Description |
| Change a hyperparameter (guarded: max % change, cooldown, requires checkpoint) |
| Save model state for later rollback |
| Restore model to a checkpoint |
| Pause the loop to analyze and decide |
| Continue after pause |
Review
Tool | Description |
| Full history of every change with before/after metrics |
| Rate limits, cooldowns, intervention count |
Detectors
Built-in anomaly detectors that produce structured findings:
Detector | What it catches |
| Policy committing too early (entropy dropping fast while not improving) |
| NaN/inf loss, or loss increasing rapidly |
| Value loss drowning out policy loss signal |
| Gradient norm spikes that precede divergence |
| Eval score stopped improving |
| Loss stopped decreasing |
Each finding includes severity, explanation, the specific metric values, and a recommended action.
Guardrails
Every intervention is validated before execution:
Max % change: Can't change a param by more than 50% at once (configurable)
Cooldown: 30s minimum between adjustments to the same param
Rate limit: Max 20 interventions per hour
Checkpoint required: Must save a checkpoint before making any adjustment
Full logging: Every intervention recorded with before/after metrics and reason
Install
pip install cortex-mcpOr from source:
pip install -e .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/Larkooo/cortex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server