# Claude Sycophancy Detector MCP for AI Agents AI Agent Connect

> Claude Sycophancy Detector catches when your AI agent agrees with your mistakes just to be polite. It cross-references AI claims against your actual codebase metadata to flag incorrect file paths, missing functions, or fake variable names. Stop trusting hallucinated code structures and start verifying every assertion your agent makes during development.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_MuuVRcJVlK20eXkkhlKH2wfsRE0dSYRZjHG5O2im/ai-agent-connect
- **Tags:** sycophancy, ai-reliability, code-verification, debugging, llm-evaluation

## Description

When you're deep in a coding session, it's easy to lead your AI agent down a wrong path. You might assume a function exists in a specific file or that a variable is defined in a certain config, and instead of correcting you, the agent just nods along. This is sycophancy, and in a technical workflow, it's dangerous. It leads to broken builds and hours of debugging phantom errors.

This MCP changes that by acting as a factual watchdog. It looks at what your agent is telling you and checks it against the ground truth of your project. It pulls out specific claims about your code—like where a function lives or what a signature looks like—and compares them to your actual file structure. Instead of blindly following a suggestion that looks right but is factually wrong, you get a clear picture of how much you can actually trust the response. By connecting this to your preferred environment through the Vinkius catalog, you add a layer of verification that keeps your agent honest and your codebase intact.

## Tools

### analyze_response_accuracy
Compares an agent's claims against your codebase to find factual errors. It calculates an accuracy ratio to show how much you can trust the output.

### extract_claims_from_text
Pulls specific technical assertions out of a conversation. It identifies things like file paths and variable names for verification.

### get_sycophancy_risk_summary
Translates technical error rates into a clear risk level. It provides a summary of how likely the agent is to be agreeing with you incorrectly.

## Prompt Examples

**Prompt:** 
```
Is the `authMiddleware` function actually located in `src/middleware/auth.ts`?
```

**Response:** 
```
No, that is incorrect. 

| Claimed Path | Actual Path |
| :--- | :--- |
| `src/middleware/auth.ts` | `src/security/middleware/auth.ts` |

The function is actually located in the `security/middleware` subdirectory.
```

**Prompt:** 
```
I think the `user_id` variable is defined in the `config.json` file, right?
```

**Response:** 
```
Actually, `user_id` is not defined in `config.json`. 

It is defined in `src/auth/session.ts`. The `config.json` file only contains database connection strings and port settings.
```

**Prompt:** 
```
Can you check if the `validate_input` function exists in this project?
```

**Response:** 
```
I've checked the codebase, and **`validate_input` does not exist** in any of the current files. 

Did you perhaps mean `validateUserPayload` in `src/utils/validation.ts`?
```

## Capabilities

### Flag dishonest AI agreement
Identify when your agent validates an incorrect assumption just to please you.

### Verify code structure claims
Check if the file paths and function names mentioned by your agent actually exist.

### Score response reliability
Get a mathematical sense of how much factual weight a specific response carries.

### Isolate factual assertions
Pull specific technical claims out of long blocks of conversational text.

### Get risk summaries
Receive clear, human-readable warnings when an agent shows patterns of sycophancy.

## Use Cases

### Fixing 'Yes-Man' Hallucinations
You tell your agent a function is in `utils.js`, and it agrees. The MCP flags that the function is actually in `helpers.js`, saving you a broken build.

### Validating Large Refactors
When asking an agent to move logic across multiple files, use the accuracy check to ensure it hasn't invented new, non-existent paths.

### Auditing AI Documentation
Verify that the documentation an agent writes for your API actually matches the real function signatures in your source code.

### Debugging Configuration Errors
Confirm that the environment variables or config keys suggested by your agent are present in your actual project files.

## Benefits

- Stop chasing ghosts by catching hallucinated file paths and function names before you try to use them.
- Build trust in your agent's suggestions using a concrete accuracy ratio for every response.
- Reduce debugging time by identifying when an agent is just agreeing with your incorrect assumptions.
- Get clear, actionable risk levels instead of guessing if an agent is being truthful or just polite.
- Ensure your refactoring workflows stay accurate by validating every structural claim against real metadata.

## How It Works

The bottom line is you stop debugging hallucinations and start working with verified code facts.

1. Connect your agent to the MCP via Vinkius to give it access to your codebase metadata.
2. The agent generates a response containing technical claims about your files or functions.
3. You receive a breakdown of factual accuracy and a risk score indicating if the agent is being sycophantic.

## Frequently Asked Questions

**How does the Claude Sycophancy Detector prevent AI errors?**
It works by comparing the technical claims an agent makes—like file paths or function names—against your actual codebase metadata to ensure they are factually correct.

**Can I use this Claude Sycophancy Detector in Cursor or VS Code?**
Yes, you can connect this MCP to any compatible client including Cursor, VS Code, Windsurf, and Claude Desktop to verify code assertions in real-time.

**What is sycophancy in AI models?**
Sycophancy is when an AI prioritizes agreeing with your stated assumptions over being factually accurate, which often leads to the agent validating incorrect code structures.

**Does this MCP work with any coding language?**
Yes, as long as your agent has access to the codebase metadata, this MCP can verify claims across any programming language or project structure.

**How do I know if my agent is being sycophantic?**
You can use the risk summary feature to get a clear, human-readable report on whether your agent is showing patterns of false agreement.

**What is sycophancy in AI?**
Sycophancy is when an AI model agrees with a user's incorrect statement or assumption to avoid conflict, rather than providing the correct factual information.

**How does `analyze_response_accuracy` work?**
The `analyze_response_accuracy` tool uses deterministic regex to extract claims like file paths and function signatures from a response, then compares them against the provided `codebaseFacts` to determine accuracy.

**Which AI clients can use this tool?**
This tool can be used with any MCP-compatible client, including Cursor, VS Code, Claude Desktop, and Windsurf.