# Counterfactual-Variant MCP

> Counterfactual-Variant Prover forces your AI agent to prove logic from first principles, preventing it from reciting standard answers on modified problems. It intercepts pattern-matching failures, isolating variables and mapping rule discrepancies so you can verify complex puzzle solutions are logically sound.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** counterfactual-reasoning, recitation-bias, logical-puzzles, cognitive-debiasing, first-principles, decontamination, agentic-reasoning, llm-safety

## Description

AI models are trained on millions of classic puzzles—things like the Monty Hall problem or river crossings. When you feed them a slightly changed version of that puzzle, they often don't solve it; they just recite the standard answer. This MCP stops that pattern-matching failure. It forces your AI agent to do something much harder: prove its logic step by step, using only the variables and rules you provide. You can trace every single calculation back to a starting point, ensuring nothing was pulled from memory. Connecting this through Vinkius gives any compatible client access to these rigorous checks, letting you validate complex reasoning across everything from academic research to QA testing.

## Tools

### validate_counterfactual
Structured reflection tool to force the agent to isolate variables, map rule differences against classic versions, and trace calculations from first principles using only modified values.

## Prompt Examples

**Prompt:** 
```
In the Monty Hall problem, if the host opens a door and reveals the car (instead of a goat), should you switch to the other closed door?
```

**Response:** 
```
Verdict: DATA_RECITATION. Classic template detected but prompt rules ignored. You recited the standard switch strategy (2/3 probability). Under the modified rule, the host revealed the car, meaning the game is over — the car is no longer behind any closed door. The probability of winning by switching is 0%.
```

**Prompt:** 
```
A farmer must cross a river with a wolf, a goat, and a cabbage. The boat can carry the farmer and up to TWO items. Can they cross without any item being eaten?
```

**Response:** 
```
Verdict: CORRUPTED_VARIABLE. Calculation failed or classic steps leaked. You executed the 7-step sequence for a 1-item capacity boat. With a boat capacity of 2 items, the farmer can carry the wolf and the cabbage in the first trip, leave them on the other side (they do not eat each other), and then return to collect the goat. Total trips: 3, not 7.
```

**Prompt:** 
```
Cheryl's Birthday modified: Albert and Bernard are given a list of 10 possible dates: May 15, May 16, May 19, June 17, June 18, July 14, July 16, August 14, August 15, August 17. Albert knows the month, Bernard knows the day. Albert says: 'I don't know when, but I know Bernard doesn't know either.' Bernard says: 'Now I know.' Albert says: 'Now I know too.' What is Cheryl's Birthday?
```

**Response:** 
```
Verdict: LOGIC_PROVEN. All steps validated. (1) Classic template Cheryl's Birthday recognized. (2) Variables isolated: month and day sets. (3) Discrepancies mapped: new date list. (4) First-principles calculation: Albert's first statement rules out May and June because they contain unique days (19 and 18). Left with July 14, 16 and August 14, 15, 17. For Bernard to now know, the day cannot be 14 (appears twice). Left with July 16 and August 15, 17. For Albert to now know, the month must be July (has only 16 left, whereas August has two dates: 15 and 17). Correct answer: July 16.
```

## Capabilities

### Validate classic puzzle deviations
It detects if a modified logic problem resembles a well-known template and identifies the deviation.

### Isolate all input variables
The tool extracts every number, rule, or constant from your prompt, ensuring no memory leakage contaminates the calculation.

### Map conflicting rules
It explicitly compares the puzzle's given rules against the classic version to highlight what has changed and what must be ignored.

### Force first-principles calculation
The agent calculates the solution step-by-step, using only the isolated variables and modified rules you provided.

### Decontaminate final output
It verifies that the resulting answer is not simply a memorized template response but genuinely derived from the unique problem constraints.

## Use Cases

### Testing modified riddle sets
An academic researcher wants to test if a new LLM can solve variations of the Prisoner's Dilemma. Without this MCP, the AI might assume standard constraints. Using `validate_counterfactual` forces it to map the specific rules of the new scenario and prove its logic only relies on those inputs.

### QA testing for variable leakage
A QA engineer needs to confirm that changing a single parameter (like boat capacity in a river crossing puzzle) doesn't cause the AI to default back to the standard, original solution. The tool confirms that the calculation shifts entirely based on the modified input.

### Evaluating complex ethical scenarios
A product team uses this when testing variations of classic trolley problems. They need proof that changing the number of people or the source of the threat actually changes the calculated optimal action, rather than just reciting the standard moral dilemma response.

## Benefits

- It stops data recitation. If your agent is supposed to solve a puzzle but just spits out the Wikipedia answer, this tool catches it immediately.
- You gain verifiable proof of calculation steps. Instead of just getting an 'answer,' you get an audit showing which variables were used and how they changed the outcome.
- Use `validate_counterfactual` when dealing with complex decision trees or rule-based logic puzzles that have been slightly customized for your use case.
- It prevents variable contamination. The tool forces separation between constants from the original puzzle and the new inputs, keeping your calculations clean.
- This is critical for building reliable AI agents. It moves reasoning past simple pattern matching into true first-principles application.

## How It Works

The bottom line is you get an audit trail proving that the AI's final answer was earned through fresh logic, not pulled from its training data.

1. Input a complex logic puzzle or math problem into your agent, asking it to use this MCP for validation.
2. The system runs its internal checks: it identifies if the prompt resembles a classic template and then forces the AI client to isolate all variables and map how they differ from the standard rules.
3. Finally, the tool executes a calculation using only those isolated inputs. You get back a proof that verifies whether the solution is logically sound or merely a contaminated recitation.

## Frequently Asked Questions

**How does Counterfactual-Variant Prover stop recitation bias?**
By introducing structural friction. When an agent is forced to fill a schema requiring explicit separation of variables, mapping of differences, and step-by-step logic, it cannot rely on automatic token generation. The tool rejects any attempt to skip these steps or leak classic parameters.

**What happens if a puzzle has no classic equivalent?**
If no classic signature is detected, the model sets recitationSignatureDetected to false, maps variables, and solves it. However, if the text contains keywords of known puzzles (e.g. Monty Hall, Cheryl), the engine enforces the full counterfactual check to avoid semantic traps.

**Can it be used alongside other reasoning provers?**
Yes. It works as an orthogonal check. While the Critical Thinking Prover checks overall cognitive quality, the Counterfactual-Variant Prover focuses specifically on variable isolation and preventing memorization loops in logic and mathematics.

**How does Counterfactual-Variant Prover handle complex or proprietary variables?**
It processes all input text within your secure client environment. You provide the puzzle details and variables in plain text, and the MCP handles the data according to standard privacy protocols.

**What happens if a calculation step fails during the validate_counterfactual process?**
The tool pinpoints exactly which of its five decision pivots failed. It will report whether variable isolation was incomplete, or where the first-principles calculation broke down due to an unmapped rule discrepancy.

**Which AI clients are compatible with Counterfactual-Variant Prover via MCP?**
It connects through any client supporting the Model Context Protocol standard. This includes major tools like Cursor, Claude Desktop, Windsurf, and VS Code integrations.

**What should I do if I hit a rate limit when using Counterfactual-Variant Prover?**
Vinkius manages the resource usage. If you encounter a rate limit error, wait for the specified cooldown period or check your subscription plan details to increase your allowed call volume.

**Can I pass structured data (like lists of numbers) into Counterfactual-Variant Prover?**
Yes. Structure is key; ensure all numeric constants and parameters are clearly defined in the prompt. The tool relies on your agent to extract these variables before executing validate_counterfactual.