MCPHub LabRegistryconfident-ai/deepeval
confident-ai

confident ai/deepeval

Built by confident-ai โ€ข 14,318 stars

What is confident ai/deepeval?

A high-performance MCP server implementation for confident-ai/deepeval that bridges the gap between the Model Context Protocol and external services. It allows Large Language Models to interact with your data and tools with low latency and native support.

How to use confident ai/deepeval?

1. Ensure you have an MCP-compatible client (like Claude Desktop) installed. 2. Configure your server with: npx @modelcontextprotocol/confident-ai/deepeval 3. Restart your client and verify the new tools are available in the system catalog.
๐Ÿ›ก๏ธ Scoped (Restricted)
npx @modelcontextprotocol/confident-ai-deepeval --scope restricted
๐Ÿ”“ Unrestricted Access
npx @modelcontextprotocol/confident-ai-deepeval

Key Features

Native MCP Protocol Support
High-performance Data Streaming
Type-safe Tool Definitions
Seamless Environment Integration

Optimized Use Cases

Connecting external databases to AI workflows
Automating workflow tasks via natural language
Augmenting developer productivity with specialized tools

confident ai/deepeval FAQ

Q

What is an MCP server?

MCP is an open standard that enables developers to build secure, two-way integrations between AI models and local or remote data sources.

Q

Is this server ready for production?

Yes, this server follows standard MCP security patterns and tool-restricted access.

Official Documentation

View on GitHub
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="assets/hero/wordmark-dark.svg"> <img alt="DeepEval." src="assets/hero/wordmark-light.svg" width="520"> </picture> </p> <p align="center"> <h1 align="center">The LLM Evaluation Framework</h1> </p> <p align="center"> <a href="https://trendshift.io/repositories/5917" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5917" alt="confident-ai%2Fdeepeval | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> </p> <p align="center"> <a href="https://discord.gg/3SEyvpgu2f"> <img alt="discord-invite" src="https://dcbadge.limes.pink/api/server/3SEyvpgu2f?style=flat"> </a> <a href="https://www.reddit.com/r/deepeval/"> <img alt="reddit-community" src="https://img.shields.io/badge/Reddit-r%2Fdeepeval-FF4500?logo=reddit&logoColor=white"> </a> </p> <h4 align="center"> <p> <a href="https://deepeval.com/docs/getting-started?utm_source=GitHub">Documentation</a> | <a href="#-metrics-and-features">Metrics and Features</a> | <a href="#-quickstart">Getting Started</a> | <a href="#-integrations">Integrations</a> | <a href="https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=header_nav&ref_page=github/readme">Confident AI</a> <p> </h4> <p align="center"> <a href="https://github.com/confident-ai/deepeval/releases"> <img alt="GitHub release" src="https://img.shields.io/github/release/confident-ai/deepeval.svg?color=violet"> </a> <a href="https://colab.research.google.com/drive/1PPxYEBa6eu__LquGoFFJZkhYgWVYE6kh?usp=sharing"> <img alt="Try Quickstart in Colab" src="https://colab.research.google.com/assets/colab-badge.svg"> </a> <a href="https://github.com/confident-ai/deepeval/blob/master/LICENSE.md"> <img alt="License" src="https://img.shields.io/github/license/confident-ai/deepeval.svg?color=yellow"> </a> <a href="https://x.com/deepeval"> <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/deepeval?style=social&logo=x"> </a> </p> <p align="center"> <!-- Keep these links. Translations will automatically update with the README. --> <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=de">Deutsch</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=es">Espaรฑol</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=fr">franรงais</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=ja">ๆ—ฅๆœฌ่ชž</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=ko">ํ•œ๊ตญ์–ด</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=pt">Portuguรชs</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=ru">ะ ัƒััะบะธะน</a> | <a href="https://www.readme-i18n.com/confident-ai/deepeval?lang=zh">ไธญๆ–‡</a> </p>

DeepEval is a simple-to-use, open-source LLM evaluation framework, for evaluating large-language model systems. It is similar to Pytest but specialized for unit testing LLM apps. DeepEval incorporates the latest research to run evals via metrics such as G-Eval, task completion, answer relevancy, hallucination, etc., which use LLM-as-a-judge and other NLP models that run locally on your machine.

Whether you're building AI agents, multi-turn chatbots, voice agents, RAG pipelines, or anything else, implemented via LangChain or OpenAI, DeepEval has you covered. With it, you can easily evaluate:

  • LLM apps end-to-end as black boxes
  • Complete AI agent trajectories across every decision and action
  • Individual AI agent steps such as LLM calls, tool use, retrieval, and sub-agent handoffs

Use these evaluations to determine the optimal models, prompts, and architecture to improve your AI quality, prevent prompt drifting, or even transition from OpenAI to Claude with confidence.

Jev is now available in DeepEval, both in existing metrics and the latest JevEval.

[!IMPORTANT] If you're already in production, Confident AI surfaces failing traces before anyone has written an eval for them, clusters them into failure modes, and turns them into your next eval.

Demo GIF

<br />

๐Ÿ”ฅ Metrics and Features

  • ๐Ÿ“ Large variety of ready-to-use LLM eval metrics (all with explanations) powered by ANY LLM of your choice, statistical methods, or NLP models that run locally on your machine covering all use cases:

    • Custom, All-Purpose Metrics:

      • JevEval โ€” a custom metric scored by Jev, a System One model that answers your questions with calibrated probabilities instead of generated text
      • G-Eval โ€” a research-backed LLM-as-a-judge metric for evaluating on any custom criteria with human-like accuracy
      • DAG โ€” DeepEval's graph-based deterministic LLM-as-a-judge metric builder
    • <details> <summary><b>AI Agent Metrics</b></summary> </details>
    • <details> <summary><b>Multi-Turn Metrics</b></summary>
      • Knowledge Retention โ€” evaluate whether the chatbot retains factual information throughout a conversation
      • Conversation Completeness โ€” measure whether the chatbot satisfies user needs throughout a conversation
      • Turn Relevancy โ€” evaluate whether the chatbot generates consistently relevant responses throughout a conversation
      • Turn Faithfulness โ€” check if the chatbot's responses are factually grounded in retrieval context across turns
      • Role Adherence โ€” evaluate whether the chatbot adheres to its assigned role throughout a conversation
      </details>
    • <details> <summary><b>Voice Agent Metrics</b></summary> </details>
    • <details> <summary><b>RAG Metrics</b></summary>
      • Answer Relevancy โ€” measure how relevant the output is to the input
      • Faithfulness โ€” evaluate whether the RAG pipeline's output factually aligns with the retrieval context
      • Contextual Recall โ€” measure how well the RAG pipeline's retrieval context aligns with the expected output
      • Contextual Precision โ€” evaluate whether relevant nodes in the RAG pipeline's retrieval context are ranked higher
      • Contextual Relevancy โ€” measure the overall relevance of the RAG pipeline's retrieval context to the input
      • RAGAS โ€” average of answer relevancy, faithfulness, contextual precision, and contextual recall
      </details>
    • <details> <summary><b>MCP Metrics</b></summary>
      • MCP Task Completion โ€” evaluate how effectively an MCP-based agent accomplishes a task
      • MCP Use โ€” measure how effectively an agent uses its available MCP servers
      • Multi-Turn MCP Use โ€” evaluate MCP server usage across conversation turns
      </details>
    • <details> <summary><b>Multimodal Metrics</b></summary>
      • Text to Image โ€” evaluate image generation quality based on semantic consistency and perceptual quality
      • Image Editing โ€” evaluate image editing quality based on semantic consistency and perceptual quality
      • Image Coherence โ€” measure how well images align with their accompanying text
      • Image Helpfulness โ€” evaluate how effectively images contribute to user comprehension of the text
      • Image Reference โ€” evaluate how accurately images are referred to or explained by accompanying text
      </details>
    • <details> <summary><b>Other Metrics</b></summary>
      • Hallucination โ€” check whether the LLM generates factually correct information against provided context
      • Summarization โ€” evaluate whether summaries are factually correct and include necessary details
      • Bias โ€” detect gender, racial, or political bias in LLM outputs
      • Toxicity โ€” evaluate toxicity in LLM outputs
      • JSON Correctness โ€” check whether the output matches an expected JSON schema
      • Prompt Alignment โ€” measure whether the output aligns with instructions in the prompt template
      </details>
  • ๐ŸŽฏ Supports both end-to-end and component-level LLM evaluation.

  • ๐Ÿงฉ Build your own custom metrics that are automatically integrated with DeepEval's ecosystem.

  • ๐Ÿ”ฎ Generate both single and multi-turn synthetic datasets for evaluation.

  • ๐Ÿ”— Integrates seamlessly with ANY CI/CD environment.

  • ๐Ÿงฌ Optimize prompts automatically based on evaluation results.

  • ๐Ÿ† Easily benchmark ANY LLM on popular LLM benchmarks in under 10 lines of code., including MMLU, HellaSwag, DROP, BIG-Bench Hard, TruthfulQA, HumanEval, GSM8K.

<br />

๐Ÿ”Œ Integrations

DeepEval plugs into any LLM framework โ€” OpenAI Agents, LangChain, CrewAI, and more. The same traces can go to Confident AI once you're live, where evals run on every production trace.

Frameworks

  • LangChain โ€” evaluate LangChain applications with a callback handler
  • LangGraph โ€” evaluate LangGraph agents with a callback handler
  • Pydantic AI โ€” evaluate Pydantic AI agents with type-safe validation
  • CrewAI โ€” evaluate CrewAI multi-agent systems
  • Anthropic โ€” evaluate and trace Claude applications via a client wrapper
  • AWS AgentCore โ€” evaluate agents deployed on Amazon AgentCore
  • Google ADK โ€” evaluate Google ADK agents and multi-agent workflows
  • AI SDK โ€” evaluate AI SDK generations and tool-loop trajectories
  • Mastra โ€” evaluate Mastra agents and workflows with native tracing
  • OpenAI โ€” evaluate and trace OpenAI applications via a client wrapper
  • OpenAI Agents โ€” evaluate OpenAI Agents end-to-end in under a minute
  • LlamaIndex โ€” evaluate AI agents and RAG applications built with LlamaIndex

โ˜๏ธ Platform + Ecosystem

Confident AI is AI monitoring for applications in production. DeepEval tests what you know to test before you ship; Confident AI finds what you didn't, and it's model- and framework-agnostic.

  • Failing traces surface before anyone has written an eval for them, clustered into failure modes, with user sentiment and behavior across traces.
  • Failing traces route to the right annotators and become goldens, so production issues turn into your next eval.
  • For enterprise teams, one system for AI quality: governance as release gates and native red teaming.
  • Prefer to stay in your editor? Inspect failing traces and pull the datasets built from them in Claude Code or Cursor through Confident AI's MCP server.
<p align="center"> <img src="assets/confident-mcp-architecture.png" alt="Confident AI MCP Architecture" width="500"> </p> <br />

๐Ÿค– Vibe-Coder QuickStart

Want your coding agent to add evals and fix failures for you? Install the DeepEval skill, point it at your AI agent, multi-turn chatbot, voice agent, RAG pipeline, or any other LLM app, and ask it to generate a dataset, write the eval suite, run deepeval test run, and iterate on the failing metrics.

Start with the 5-minute vibe-coder guide.

<br />

๐Ÿš€ Human QuickStart

Let's pretend your LLM application is a customer support AI agent; here's how DeepEval can help test what you've built.

Installation

Deepeval works with Python>=3.9+.

pip install -U deepeval

Create an account (highly recommended)

Using the deepeval platform will allow you to generate sharable testing reports on the cloud. It is free, takes no additional code to setup, and we highly recommend giving it a try.

To login, run:

deepeval login

Follow the instructions in the CLI to create an account, copy your API key, and paste it into the CLI. All test cases will automatically be logged (find more information on data privacy here).

Write your first test case

Create a test file:

touch test_ai_agent.py

Open test_ai_agent.py and write your first test case to run an end-to-end evaluation using DeepEval, which treats your LLM app as a black-box:

import pytest
from deepeval import assert_test
from deepeval.metrics import GEval
from deepeval.test_case import LLMTestCase, SingleTurnParams

def test_case():
    correctness_metric = GEval(
        name="Correctness",
        criteria="Determine if the 'actual output' is correct based on the 'expected output'.",
        evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
        threshold=0.5
    )
    test_case = LLMTestCase(
        input="What if these shoes don't fit?",
        # Replace this with the actual output from your LLM application
        actual_output="You have 30 days to get a full refund at no extra cost.",
        expected_output="We offer a 30-day full refund at no extra costs.",
    )
    assert_test(test_case, [correctness_metric])

Set your OPENAI_API_KEY as an environment variable (you can also evaluate using your own custom model, for more details visit this part of our docs):

export OPENAI_API_KEY="..."

And finally, run test_ai_agent.py in the CLI:

deepeval test run test_ai_agent.py

Congratulations! Your test case should have passed โœ… Let's break down what happened.

  • The variable input mimics a user input, and actual_output is a placeholder for what your application's supposed to output based on this input.
  • The variable expected_output represents the ideal answer for a given input, and GEval is a research-backed metric provided by deepeval for you to evaluate your LLM outputs on any custom criteria with human-like accuracy.
  • In this example, the metric criteria is correctness of the actual_output based on the provided expected_output.
  • All metric scores range from 0 - 1, which the threshold=0.5 ultimately determines if your test has passed or not.

Read our documentation for more information!

<br />

Evals With Full Traceability

Use evals_iterator() to run the same dataset through your app, whether you instrument it manually or through one of DeepEval's framework integrations. Because tracing captures the ordered sequence of model decisions, tool calls, and intermediate steps, you can run trajectory-based evaluations over the complete path your AI agent takes.

Here's an example of manual instrumentation:

from deepeval.tracing import observe, update_current_span
from deepeval.test_case import LLMTestCase
from deepeval.metrics import TaskCompletionMetric

@observe()
def inner_component(input: str):
    output = "result"
    update_current_span(test_case=LLMTestCase(input=input, actual_output=output))
    return output

@observe()
def app(input: str):
    return inner_component(input)

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    app(golden.input)
<details> <summary><b>OpenAI</b></summary>
from deepeval.openai import OpenAI
from deepeval.tracing import trace
from deepeval.metrics import TaskCompletionMetric

client = OpenAI()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator():
    with trace(metrics=[TaskCompletionMetric()]):
        client.chat.completions.create(
            model="gpt-4o",
            messages=[{"role": "user", "content": golden.input}],
        )
</details> <details> <summary><b>OpenAI Agents</b></summary>
from agents import Runner
from deepeval.metrics import TaskCompletionMetric

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    Runner.run_sync(agent, golden.input)
</details> <details> <summary><b>AI SDK (TypeScript)</b></summary>
import { generateText } from "ai";
import { configureAiSdkTracing } from "deepeval/integrations/ai-sdk";
import { TaskCompletionMetric } from "deepeval/metrics";

const tracer = configureAiSdkTracing({ name: "my-agent" });

const ask = (input: string) =>
  generateText({
    model,
    prompt: input,
    experimental_telemetry: { isEnabled: true, tracer },
  });

// This metric evaluates the complete trajectory captured for this run.
for await (const golden of dataset.evalsIterator({
  metrics: [new TaskCompletionMetric()],
})) {
  await ask(golden.input);
}
</details> <details> <summary><b>Mastra (TypeScript)</b></summary>
import { Mastra } from "@mastra/core/mastra";
import { Observability } from "@mastra/observability";
import { DeepEvalExporter } from "deepeval/integrations/mastra";
import { TaskCompletionMetric } from "deepeval/metrics";

const mastra = new Mastra({
  agents: { agent },
  observability: new Observability({
    configs: {
      deepeval: { exporters: [new DeepEvalExporter()] },
    },
  }),
});

// This metric evaluates the complete trajectory captured for this run.
for await (const golden of dataset.evalsIterator({
  metrics: [new TaskCompletionMetric()],
})) {
  await mastra.getAgent("agent").generate(golden.input);
}
</details> <details> <summary><b>Anthropic</b></summary>
from deepeval.anthropic import Anthropic
from deepeval.tracing import trace
from deepeval.metrics import TaskCompletionMetric

client = Anthropic()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator():
    with trace(metrics=[TaskCompletionMetric()]):
        client.messages.create(
            model="claude-sonnet-4-5",
            max_tokens=1024,
            messages=[{"role": "user", "content": golden.input}],
        )
</details> <details> <summary><b>LangChain</b></summary>
from deepeval.integrations.langchain import CallbackHandler
from deepeval.metrics import TaskCompletionMetric

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator():
    llm.invoke(
        golden.input,
        config={"callbacks": [CallbackHandler(metrics=[TaskCompletionMetric()])]},
    )
</details> <details> <summary><b>LangGraph</b></summary>
from deepeval.integrations.langchain import CallbackHandler
from deepeval.metrics import TaskCompletionMetric

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator():
    agent.invoke(
        {"messages": [{"role": "user", "content": golden.input}]},
        config={"callbacks": [CallbackHandler(metrics=[TaskCompletionMetric()])]},
    )
</details> <details> <summary><b>Pydantic AI</b></summary>
from deepeval.metrics import TaskCompletionMetric

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    agent.run_sync(golden.input)
</details> <details> <summary><b>CrewAI</b></summary>
from deepeval.integrations.crewai import instrument_crewai
from deepeval.metrics import TaskCompletionMetric

instrument_crewai()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    crew.kickoff({"input": golden.input})
</details> <details> <summary><b>AWS AgentCore</b></summary>
from deepeval.integrations.agentcore import instrument_agentcore
from deepeval.metrics import TaskCompletionMetric

instrument_agentcore()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    invoke({"prompt": golden.input})
</details> <details> <summary><b>LlamaIndex</b></summary>
import asyncio
from deepeval.evaluate.configs import AsyncConfig
from deepeval.metrics import TaskCompletionMetric

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(
    async_config=AsyncConfig(run_async=True),
    metrics=[TaskCompletionMetric()],
):
    task = asyncio.create_task(agent.run(golden.input))
    dataset.evaluate(task)
</details> <details> <summary><b>Google ADK</b></summary>
import asyncio
from deepeval.evaluate.configs import AsyncConfig
from deepeval.integrations.google_adk import instrument_google_adk
from deepeval.metrics import TaskCompletionMetric

instrument_google_adk()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(
    async_config=AsyncConfig(run_async=True),
    metrics=[TaskCompletionMetric()],
):
    task = asyncio.create_task(run_agent(golden.input))
    dataset.evaluate(task)
</details> <details> <summary><b>Strands</b></summary>
from deepeval.integrations.strands import instrument_strands
from deepeval.metrics import TaskCompletionMetric

instrument_strands()

# This metric evaluates the complete trajectory captured for this run.
for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]):
    agent(golden.input)
</details>

Learn more about component-level evaluations here.

<br />

Evaluate Without Pytest Integration

Alternatively, you can evaluate without Pytest, which is more suited for a notebook environment.

from deepeval import evaluate
from deepeval.metrics import AnswerRelevancyMetric
from deepeval.test_case import LLMTestCase

answer_relevancy_metric = AnswerRelevancyMetric(threshold=0.7)
test_case = LLMTestCase(
    input="What if these shoes don't fit?",
    # Replace this with the actual output from your LLM application
    actual_output="We offer a 30-day full refund at no extra costs.",
    retrieval_context=["All customers are eligible for a 30 day full refund at no extra costs."]
)
evaluate([test_case], [answer_relevancy_metric])

Using Standalone Metrics

DeepEval is extremely modular, making it easy for anyone to use any of our metrics. Continuing from the previous example:

from deepeval.metrics import AnswerRelevancyMetric
from deepeval.test_case import LLMTestCase

answer_relevancy_metric = AnswerRelevancyMetric(threshold=0.7)
test_case = LLMTestCase(
    input="What if these shoes don't fit?",
    # Replace this with the actual output from your LLM application
    actual_output="We offer a 30-day full refund at no extra costs.",
    retrieval_context=["All customers are eligible for a 30 day full refund at no extra costs."]
)

answer_relevancy_metric.measure(test_case)
print(answer_relevancy_metric.score)
# All metrics also offer an explanation
print(answer_relevancy_metric.reason)

Note that some metrics are built for specific use cases, such as AI agents, multi-turn chatbots, voice agents, RAG, and more. Make sure to use our docs to pick the right one for your use case.

A Note on Env Variables (.env / .env.local)

DeepEval auto-loads .env.local then .env from the current working directory at import time. Precedence: process env -> .env.local -> .env. Opt out with DEEPEVAL_DISABLE_DOTENV=1.

cp .env.example .env.local
# then edit .env.local (ignored by git)

DeepEval With Confident AI

Confident AI monitors AI applications in production. Evals run on every production trace, failing traces are clustered into failure modes, and each one can be routed to the right annotators โ€” engineers, QA, domain experts or PMs โ€” and turned into a golden for your next eval. The traces your app already produces with DeepEval stream to it with no code changes.

Log in from the CLI to connect:

deepeval login

Test runs also appear on the platform once you're logged in.

Demo GIF

Prefer to stay in your IDE? Inspect failing traces and pull the datasets built from them through Confident AI's MCP server without leaving your editor.

<p align="center"> <img src="assets/confident-mcp-architecture.png" alt="Confident AI MCP Architecture" width="500"> </p>

Learn more in the Confident AI documentation.

<br />

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

<br />

Roadmap

Features:

  • Integration with Confident AI
  • Implement G-Eval
  • Implement RAG metrics
  • Implement Conversational metrics
  • Evaluation Dataset Creation
  • Red-Teaming
  • DAG custom metrics
  • Guardrails
<br />

Authors

Built by the founders of Confident AI. Contact jeffreyip@confident-ai.com for all enquiries.

<br />

License

DeepEval is licensed under Apache 2.0 - see the LICENSE.md file for details.

Global Ranking

7.7
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "confident-ai-deepeval": { "command": "npx", "args": ["confident-ai-deepeval"] } } }