Skip to content

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.

The MCP channel provides 4 tools to any connected MCP client:

ToolDescription
completeSend a prompt to ModelReins and get a completion back synchronously.
dispatchQueue a job for async processing. Returns a job ID immediately.
statusCheck the status of a dispatched job or get an overview of all workers.
recruitRegister the current machine as a new worker in the mesh.

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.

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.

Ask ModelReins to process a prompt and wait for the result. The job is routed to the best available worker.

// In an MCP client context
const 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.

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}`);

Poll a specific job or get an overview of the worker mesh.

// Check a specific job
const job = await mcp.callTool("modelreins", "status", {
jobId: "job_abc123"
});
console.log(job.state); // "pending" | "running" | "completed" | "failed"
// Overview of all workers
const overview = await mcp.callTool("modelreins", "status", {});
console.log(overview.workers); // [{ name, provider, status, jobsCompleted }]
console.log(overview.queueDepth); // 3

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`);
VariableDefaultDescription
MODELREINS_API_URLhttp://localhost:7420URL of the ModelReins coordinator
MODELREINS_API_KEYAPI key for authentication
MODELREINS_MCP_TIMEOUT30000Timeout in ms for synchronous completions
  • Use complete for quick, interactive work. Use dispatch for anything that might take more than a few seconds.
  • The recruit tool 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 complete call with no provider specified will use whatever routing strategy is configured.