Mcp Sampling Critic logo

Mcp Sampling Critic

Community
roedyrustam
mcp-sampling-critic

MCP client sampling and critic-in-the-loop multi-model consensus / Sampling MCP client dan validasi konsensus multi-model AI.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill namemcp-sampling-critic
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Mcp Sampling Critic AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/mcp-sampling-critic
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/mcp-sampling-critic .claude/skills/mcp-sampling-critic
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mcp Sampling Critic in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mcp Sampling Critic on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mcp Sampling Critic is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

mcp-sampling-critic — vibes-plug Skill

English | Bahasa Indonesia


English

Orchestration & Integration

  • Protocol & Model Sampling: mcp-server-architect, ai-llm-integration-expert, frontier-ai-models-expert
  • Adversarial Audit & Quality: autonomous-red-teamer, ai-code-review-autonomous, anti-slop
  • Multi-Agent Consensus: speculative-multi-draft-synthesizer, multi-agent-orchestration, parallel-tool-orchestrator
  • Testing & Verification: autonomous-tdd-debugger, property-mutation-testing-expert, formal-spec-z3-verifier
  • Lifecycle Gate: zero-to-prod-orchestrator, session-memory-manager

Description

Production protocol for leveraging Model Context Protocol (MCP v1.x) Client Sampling (sampling/createMessage) to create recursive adversarial quality gates. In standard architectures, tools execute code blindly upon invocation. With MCP Sampling, a specialized Critic engine pauses execution, initiates a nested sampling call to the host LLM (or a secondary frontier model), and asks the Critic model to inspect proposed diffs against the 7 Anti-Slop Pillars, security boundaries, and invariant state machines. Writes are only permitted when the Critic grants an APPROVED verdict.

Trigger Conditions

Activate this skill when:

  • Designing autonomous agent loops that modify filesystem files or execute database migrations.
  • Implementing the CRITIC_VALIDATOR swarm topology where an implementer agent's draft must pass an independent quality audit.
  • Eliminating AI-generated placeholders (// TODO), silent error suppressions, or SQL injection vectors before pull request creation.
  • Enforcing human-in-the-loop or critic-in-the-loop safeguards without requiring manual human clicking.

Critic-in-the-Loop Protocol Architecture

PROPOSED CODE DRAFT
        │
        ▼
┌───────────────────────────┐
│ STATIC REGEX & AST FILTER │  Instant rule scan (P1-P7 Anti-Slop, silent catches)
└─────────────┬─────────────┘
              │
  ┌───────────┴───────────┐
  ▼                       ▼
FAIL (Score < 85)     PASS (Score >= 85)
  │                       │
Reject immediately   ┌────▼────────────────────────┐
with suggestions     │ MCP SAMPLING REQUEST        │  sampling/createMessage
                     │ to Host LLM (Independent)   │
                     └────────────┬────────────────┘
                                  │
                                  ▼
                        FINAL CRITIC VERDICT
                     (APPROVED -> Write to disk)
1. MCP Sampling Request Construction (TypeScript)
typescript
export interface SamplingMessagePayload {
  messages: Array<{
    role: 'user' | 'assistant';
    content: { type: 'text'; text: string };
  }>;
  systemPrompt: string;
  maxTokens: number;
  modelPreferences?: {
    hints?: Array<{ name: string }>;
    costPriority?: number;
    speedPriority?: number;
    intelligencePriority?: number;
  };
}

export function buildCriticSamplingPayload(
  targetFile: string,
  proposedCode: string,
  staticFindings: Array<{ ruleName: string; message: string }>
): SamplingMessagePayload {
  const findingsSummary = staticFindings.length > 0
    ? staticFindings.map(f => `- ${f.ruleName}: ${f.message}`).join('\n')
    : 'None detected by initial AST filter.';

  return {
    systemPrompt: `You are the Sovereign Anti-Slop Critic (2026 Edition).
Perform a strict code audit against:
1. Zero placeholder stubs (// TODO, // ...rest of code).
2. Zero silent error suppression (empty catch blocks).
3. 5-state interactive UI contract (hover, focus-visible, active, disabled).
4. SQL injection prevention (parameterized queries only).
Output JSON: { "verdict": "APPROVED" | "REJECTED", "score": 0-100, "rationale": "..." }`,
    maxTokens: 2048,
    modelPreferences: {
      intelligencePriority: 1.0,
      costPriority: 0.2
    },
    messages: [
      {
        role: 'user',
        content: {
          type: 'text',
          text: `Target: ${targetFile}\nPreliminary AST Warnings:\n${findingsSummary}\n\nCode to Audit:\n\`\`\`typescript\n${proposedCode}\n\`\`\``
        }
      }
    ]
  };
}

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec mcp-sampling-critic <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

  • Sampling Protokol & Model: mcp-server-architect, ai-llm-integration-expert, frontier-ai-models-expert
  • Audit Adversarial & Kualitas: autonomous-red-teamer, ai-code-review-autonomous, anti-slop
  • Konsensus Multi-Agen: speculative-multi-draft-synthesizer, multi-agent-orchestration, parallel-tool-orchestrator
  • Pengujian & Verifikasi: autonomous-tdd-debugger, property-mutation-testing-expert, formal-spec-z3-verifier
  • Gerbang Siklus Hidup: zero-to-prod-orchestrator, session-memory-manager

Deskripsi

Protokol produksi untuk memanfaatkan Client Sampling pada Model Context Protocol (sampling/createMessage) guna membangun gerbang kualitas adversarial rekursif. Menggunakan MCP Sampling, server atau subagen menghentikan eksekusi sementara, melakukan panggilan sampling ke LLM host untuk mengaudit usulan perubahan kode terhadap 7 Pilar Anti-Slop, keamanan injeksi SQL, dan penanganan error. Kode hanya ditulis ke disk apabila mendapatkan status APPROVED.

Kondisi Pemicu

  • Merancang alur agen otonom yang memodifikasi file repositori atau migrasi basis data.
  • Menjalankan topologi swarm CRITIC_VALIDATOR di mana draf implementer harus diverifikasi auditor independen.
  • Menghapus stub placeholder malas (// TODO) dan penelanan error secara otomatis sebelum commit.

Pembuatan Payload Permintaan MCP Sampling (TypeScript)

typescript
export interface PayloadPesanSampling {
  messages: Array<{
    role: 'user' | 'assistant';
    content: { type: 'text'; text: string };
  }>;
  systemPrompt: string;
  maxTokens: number;
}

export function bangunPayloadSamplingCritic(
  fileTarget: string,
  drafKode: string,
  peringatanAwal: string[]
): PayloadPesanSampling {
  return {
    systemPrompt: `Anda adalah Auditor Anti-Slop Berdaulat (Edisi 2026).
Lakukan audit kode ketat terhadap:
1. Ketiadaan stub placeholder (// TODO, // ...rest of code).
2. Ketiadaan penelanan error diam-diam (empty catch block).
3. Kontrak 5-state UI interaktif (hover, focus-visible, active, disabled).
4. Pencegahan injeksi SQL (wajib parameterized query).
Keluarkan JSON: { "verdict": "APPROVED" | "REJECTED", "score": 0-100, "rationale": "..." }`,
    maxTokens: 2048,
    messages: [
      {
        role: 'user',
        content: {
          type: 'text',
          text: `File: ${fileTarget}\nPeringatan AST Awal: ${peringatanAwal.join(', ')}\n\nKode yang Diaudit:\n\`\`\`typescript\n${drafKode}\n\`\`\``
        }
      }
    ]
  };
}

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec mcp-sampling-critic <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Mcp Sampling Critic AI skill do?

MCP client sampling and critic-in-the-loop multi-model consensus / Sampling MCP client dan validasi konsensus multi-model AI.

Why use Mcp Sampling Critic on TypingMind?

Because you install it once and use it with any model. Mcp Sampling Critic is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mcp Sampling Critic in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/mcp-sampling-critic. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Mcp Sampling Critic?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mcp Sampling Critic?

As many as you like. As long as a model supports skills, you can use Mcp Sampling Critic with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mcp Sampling Critic AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇