Socket
Book a DemoInstallSign in
Socket

@thinkhive/mcp-explainer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thinkhive/mcp-explainer

MCP server for ThinkHive Explainer API v3 - Run-centric architecture with facts vs inferences, deterministic linking, calibrated predictions, and AI agent observability

latest
Source
npmnpm
Version
3.0.1
Version published
Maintainers
1
Created
Source

@thinkhive/mcp-explainer v2.0.1

MCP (Model Context Protocol) server for the ThinkHive Explainer API. Provides AI agents with access to trace analysis, RAG evaluation, hallucination detection, quality metrics, and business impact analytics.

What's New in v2.0.0

  • RAG Evaluation: Measure context relevance, groundedness, faithfulness, and citation accuracy
  • Hallucination Detection: Identify unsupported claims, factual errors, and contradictions
  • Quality Metrics: Track quality scores across agents with trend analysis
  • ROI Analytics: Calculate business impact, revenue at risk, and cost savings
  • Silent Failure Detection: Find cases where agents appear successful but failed to help
  • Fix Generation: AI-powered fix suggestions for failure patterns
  • Enhanced Prompts: Pre-built prompts for common analysis workflows

Features

  • 25+ powerful tools for trace analysis, quality metrics, and business analytics
  • STDIO transport for Claude Code CLI integration
  • HTTP/SSE transport for web clients and external integrations
  • Comprehensive trace support: multi-turn conversations, tool calls, RAG context
  • Company isolation for multi-tenant security
  • Audit logging for compliance
  • Tier-based feature gates (free, starter, professional, enterprise)

Installation

npm install @thinkhive/mcp-explainer

Quick Start

Claude Code CLI

Add to your Claude Code configuration (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "thinkhive-explainer": {
      "command": "npx",
      "args": ["@thinkhive/mcp-explainer"],
      "env": {
        "THINKHIVE_API_KEY": "thk_your_api_key_here",
        "THINKHIVE_API_URL": "https://demo.thinkhive.ai"
      }
    }
  }
}

Programmatic Usage

import { startStdioServer } from '@thinkhive/mcp-explainer';

// Start STDIO server
await startStdioServer();

HTTP/SSE Transport

import express from 'express';
import { setupHttpTransport } from '@thinkhive/mcp-explainer';

const app = express();
app.use(express.json());

setupHttpTransport({
  app,
  basePath: '/mcp',
});

app.listen(3001, () => {
  console.log('MCP server running on http://localhost:3001');
});

Environment Variables

VariableRequiredDefaultDescription
THINKHIVE_API_KEYYes-Your ThinkHive API key
THINKHIVE_API_URLNohttps://demo.thinkhive.aiThinkHive API URL

Available Tools

Trace Analysis

ToolDescriptionTier
trace_explainAnalyze with RAG eval & hallucination detectionFree
trace_searchSearch traces using natural languageStarter+
trace_get_explanationGet stored explanation by trace IDFree
trace_patternsGet failure patterns for an agentStarter+
trace_statsGet statistics for tracesFree
trace_batch_analyzeAnalyze multiple traces at onceStarter+

Quality Metrics (NEW)

ToolDescriptionTier
quality_rag_evaluateEvaluate RAG quality (groundedness, faithfulness)Professional+
quality_hallucination_detectDetect hallucinations in responsesProfessional+
quality_get_scoresGet quality scores for trace/agentStarter+

ROI Analytics (NEW)

ToolDescriptionTier
roi_get_summaryGet ROI summary with revenue impactProfessional+
roi_get_correlationsGet performance-to-business correlationsProfessional+
roi_calculate_impactCalculate business impact for failuresProfessional+

Failure Clusters

ToolDescriptionTier
cluster_listList failure clusters for an agentStarter+
cluster_detailsGet cluster details with examplesStarter+

Fix Generation (NEW)

ToolDescriptionTier
fix_generateGenerate fix suggestions for failuresProfessional+
fix_listList generated fixesProfessional+

Silent Failures (NEW)

ToolDescriptionTier
silent_failures_detectDetect silent failuresProfessional+
silent_failures_summaryGet silent failure summaryProfessional+

Webhooks

ToolDescriptionTier
webhook_listList configured webhooksProfessional+
webhook_createCreate a new webhookProfessional+
webhook_deleteDelete a webhookProfessional+
webhook_testTest a webhookProfessional+

Evaluation

ToolDescriptionTier
eval_runRun evaluation against golden datasetStarter+
eval_list_setsList evaluation setsStarter+
eval_get_resultsGet evaluation resultsStarter+

Tool Examples

Analyze a Trace with Quality Metrics

{
  "trace": {
    "id": "trace-123",
    "userMessage": "What's the refund policy?",
    "agentResponse": "Our refund policy allows returns within 30 days...",
    "outcome": "success"
  },
  "options": {
    "evaluateRAG": true,
    "detectHallucinations": true,
    "computeBusinessImpact": true
  }
}

Evaluate RAG Quality

{
  "traceId": "trace-123",
  "question": "What's the refund policy?",
  "answer": "Our refund policy allows returns within 30 days...",
  "contexts": [
    "Customers may return items within 30 days of purchase...",
    "Refunds are processed within 5-7 business days..."
  ]
}

Get ROI Summary

{
  "agentId": "customer-support",
  "dateRange": {
    "from": "2024-01-01T00:00:00Z",
    "to": "2024-01-31T23:59:59Z"
  },
  "includeProjections": true
}

Detect Silent Failures

{
  "agentId": "sales-assistant",
  "signals": [
    "repeat_contact",
    "escalation",
    "negative_feedback"
  ]
}

Available Prompts

PromptDescription
analyze-traceAnalyze a trace and provide insights
debug-failureDebug a failed interaction
explain-clusterExplain a failure cluster
quality-reportGenerate quality report for an agent
roi-analysisGenerate ROI analysis
hallucination-reviewReview detected hallucinations

Supported Models (December 2025)

The ThinkHive API backend uses the latest AI models for maximum accuracy:

Azure OpenAI

  • GPT-5 Series: gpt-5.2, gpt-5, gpt-5-pro, gpt-5-mini
  • GPT-4.1 Series: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano
  • O-Series Reasoning: o4-mini, o3-pro, o3, o3-mini
  • Embeddings: text-embedding-3-large, text-embedding-3-small

Anthropic Claude (via Azure)

  • Claude 4.5 Series: claude-opus-4.5, claude-sonnet-4.5, claude-haiku-4.5

Google Gemini (Direct API)

  • Gemini 3: gemini-3-flash, gemini-3-flash-lite
  • Gemini 2.5: gemini-2.5-pro, gemini-2.5-flash

API Key Tiers

TierRate LimitFeatures
Free10/minBasic explainability
Starter60/min+ Search, batch analysis, patterns, quality metrics
Professional300/min+ RAG eval, hallucination detection, ROI analytics, webhooks
Enterprise1,000/minAll features + dedicated support

Security

  • API Key Authentication: Secure key validation with company scoping
  • Company Isolation: All queries scoped to authenticated company
  • Rate Limiting: Per-API-key rate limiting
  • Audit Logging: All tool calls logged for compliance

Troubleshooting

"API key required" error

Make sure THINKHIVE_API_KEY environment variable is set.

Rate limit exceeded

Wait for the rate limit window to reset (1 minute) or upgrade your tier.

Feature not available

Some features require higher tiers. Check the tier column in the tools table.

  • ThinkHive Platform
  • API Documentation
  • MCP Specification
  • GitHub Issues

License

MIT

Keywords

mcp

FAQs

Package last updated on 02 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts