MCP Channel
The MCP (Model Context Protocol) channel exposes ModelReins as an MCP server. This lets you dispatch jobs, check status, and recruit workers directly from Claude Code, VS Code, or any MCP-compatible tool — without leaving your editor.
What it does
Section titled “What it does”The MCP channel provides 4 tools to any connected MCP client:
| Tool | Description |
|---|---|
complete | Send a prompt to ModelReins and get a completion back synchronously. |
dispatch | Queue a job for async processing. Returns a job ID immediately. |
status | Check the status of a dispatched job or get an overview of all workers. |
recruit | Register the current machine as a new worker in the mesh. |
Install for CLI (Claude Code, etc.)
Section titled “Install for CLI (Claude Code, etc.)”Add the ModelReins MCP server to your .mcp.json file:
{ "mcpServers": { "modelreins": { "command": "npx", "args": ["-y", "@mediagato/modelreins-mcp"], "env": { "MODELREINS_API_URL": "http://localhost:7420", "MODELREINS_API_KEY": "your-api-key" } } }}Place this file in your project root or home directory (~/.mcp.json for global access).
Restart your CLI tool. The 4 ModelReins tools should now appear in your tool list.
Install for VS Code
Section titled “Install for VS Code”Open VS Code settings (Ctrl+Shift+P → “Preferences: Open User Settings (JSON)”) and add:
{ "mcp": { "servers": { "modelreins": { "command": "npx", "args": ["-y", "@mediagato/modelreins-mcp"], "env": { "MODELREINS_API_URL": "http://localhost:7420", "MODELREINS_API_KEY": "your-api-key" } } } }}Reload the window. The ModelReins tools are now available in VS Code’s Copilot chat and any MCP-aware extension.
Using the tools
Section titled “Using the tools”complete — synchronous completion
Section titled “complete — synchronous completion”Ask ModelReins to process a prompt and wait for the result. The job is routed to the best available worker.
// In an MCP client contextconst result = await mcp.callTool("modelreins", "complete", { prompt: "Summarize the key changes in this diff", input: diffText, provider: "claude", // optional — uses default if omitted model: "haiku" // optional});
console.log(result.content);From Claude Code, just ask naturally:
“Use ModelReins to summarize this file with the Ollama provider”
Claude Code calls the complete tool automatically.
dispatch — async job queue
Section titled “dispatch — async job queue”Queue a job and get back a job ID. The job runs in the background on any available worker.
const { jobId } = await mcp.callTool("modelreins", "dispatch", { prompt: "Run a full code review on this repository", input: repoSummary, priority: "low", provider: "ollama"});
console.log(`Queued as ${jobId}`);status — check progress
Section titled “status — check progress”Poll a specific job or get an overview of the worker mesh.
// Check a specific jobconst job = await mcp.callTool("modelreins", "status", { jobId: "job_abc123"});console.log(job.state); // "pending" | "running" | "completed" | "failed"
// Overview of all workersconst overview = await mcp.callTool("modelreins", "status", {});console.log(overview.workers); // [{ name, provider, status, jobsCompleted }]console.log(overview.queueDepth); // 3recruit — add a worker
Section titled “recruit — add a worker”Register the current machine as a worker from within your editor session.
const worker = await mcp.callTool("modelreins", "recruit", { name: "my-laptop", provider: "ollama", model: "llama3.2"});
console.log(`Worker ${worker.id} registered`);Environment variables
Section titled “Environment variables”| Variable | Default | Description |
|---|---|---|
MODELREINS_API_URL | http://localhost:7420 | URL of the ModelReins coordinator |
MODELREINS_API_KEY | — | API key for authentication |
MODELREINS_MCP_TIMEOUT | 30000 | Timeout in ms for synchronous completions |
- Use
completefor quick, interactive work. Usedispatchfor anything that might take more than a few seconds. - The
recruittool is useful for onboarding new machines without SSH access — just open an MCP client on the target machine and recruit it. - All 4 tools respect your routing rules. A
completecall with no provider specified will use whatever routing strategy is configured.