Small-Model Harness MCP
Provides pre_tool_call hooks for schema validation, loop detection, circuit breaker, context budget, and routing awareness in small-model agentic workflows via Hermes plugin.
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., "@Small-Model Harness MCPClassify task: extract product names from reviews"
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.
Small-Model Harness
Defensive harness for running 1B–12B parameter models in production agentic workflows.
Five-layer architecture: routing → validation → constraint → circuit break → context management. Delivered as a Hermes plugin (deterministic enforcement) + MCP server (analysis tools).
The Problem
Small models (1B–12B) have dramatically closed the quality gap with frontier models, but the reliability gap persists:
Failure Mode | Impact | Source |
Doom Loops — repetitive death spirals under greedy sampling | Qwen3.5-4B: 22.9% loop rate | Antidoom (FTPO) |
Context Rot — degradation with input length, not position | Effective window = ~1/3 of stated window | Chroma/NVIDIA |
Format Drift — tool call fragility on long chains | 87% accuracy vs GPT-4o's 92% | Qwen3-32B eval |
Related MCP server: RelayPlane
Architecture
┌─────────────────────────────────────────┐
│ ENTRY POINT / TASK DISPATCH │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
LAYER 1 │ TASK CLASSIFIER │
ROUTING │ Classify complexity, route to model │
│ T1 (<4B) → T2 (4-8B) → T3 (9-12B) → │
│ T4 (cloud) cascade with confidence │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
LAYER 2 │ PRE-CALL VALIDATION │
GUARDRAIL │ Schema check, loop detection, budget │
│ Blocks bad calls BEFORE execution │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
LAYER 3 │ CONSTRAINED DECODING ENGINE │
OUTPUT │ XGrammar token masking (40μs) │
ENFORCEMENT │ Guarantee valid JSON/tool call output │
│ (NOT YET IMPLEMENTED) │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
LAYER 4 │ CIRCUIT BREAKER │
LOOP │ 3-state: closed → open → half-open │
DETECTION │ Detect loops, break circuits, escalate │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
LAYER 5 │ CONTEXT BUDGET │
CONTEXT │ Sliding window compaction │
│ 1/3 effective window rule │
└─────────────────────────────────────────┘Components
Component | What It Does | Status |
Hermes Plugin |
| ✅ Phase 1 |
MCP Server | 5 tools: context status, compaction, task classification, routing, reset | ✅ Phase 2+3 |
Task Classifier | Rule-based complexity scoring and model tier assignment | ✅ Phase 3 |
Context Router | Tier cascade (T1→T2→T3→T4) with failure-based escalation | ✅ Phase 3 |
Output Enforcement | Constrained decoding (XGrammar/Outlines) for guaranteed valid output | ⏳ Planned |
Output Verifier | Post-generation validation of tool call correctness | 📋 Planned |
Installation
As a Hermes Plugin
# Copy plugin to Hermes plugins directory
cp -r hermes-plugin ~/.hermes/profiles/dev/plugins/small-model-harness
# Enable it
hermes plugins enable small-model-harnessAs an MCP Server
Add to ~/.hermes/config.yaml or ~/.hermes/profiles/dev/config.yaml:
mcp_servers:
small-model-harness:
command: python3
args: ["/path/to/mcp-server/server.py"]
enabled: trueMCP Server Tools
Tool | Description |
| Query context budget utilization for a session |
| Compact session context (sliding window summarization) |
| Classify task complexity and suggest model tier |
| Route task to model tier with cascade logic |
| Reset all harness state for a session |
Tier Reference
Tier | Model Size | Example Models | Use Case |
T1 | <4B | SmolLM3, phi-4-mini | Simple extraction, classification |
T2 | 4-8B | Qwen3-8B, Llama 3.2-8B | Single tool calls, basic routing |
T3 | 9-12B | Ornith-1.0-9B, Qwen3-30B-A3B | Multi-step, reasoning, planning |
T4 | Cloud | DeepSeek V4, GPT-4o | Complex chains, security-critical |
Development
# Setup
uv sync --group dev
# Run tests
uv run pytest tests/ -v
# Test MCP server
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2026-07-28","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | python3 mcp-server/server.pyLicense
MIT
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/iknowkungfubar/small-model-harness'
If you have feedback or need assistance with the MCP directory API, please join our Discord server