Skip to main content
Glama
Consiliency

pangram-mcp

by Consiliency

pangram-mcp

An MCP server for Pangram Labs AI-generated-text detection. Exposes a single analyze tool that classifies text as human-written, AI-generated, or AI-assisted — with an overall verdict, per-class fractions, and a per-segment breakdown.

The API key stays in the server's environment and is sent as the x-api-key header; it is never returned to the model or logged. Callers pass text and receive a classification — they never handle the credential.

Install / run

Requires an API key from Pangram Labs:

export PANGRAM_API_KEY="your-key"
uvx pangram-mcp

MCP client config

{
  "mcpServers": {
    "pangram": {
      "command": "uvx",
      "args": ["pangram-mcp"],
      "env": { "PANGRAM_API_KEY": "your-key" }
    }
  }
}

Related MCP server: AI Content Detector

Configuration

Env var

Required

Default

Purpose

PANGRAM_API_KEY

yes

Pangram Labs API key.

PANGRAM_API_BASE

no

https://text.api.pangram.com/v3

Endpoint override.

PANGRAM_TIMEOUT

no

60

Request timeout (seconds).

Tool: analyze

Detect AI-generated text.

Parameter

Type

Description

text

string

Text to classify (required).

public_dashboard_link

bool

Request a public shareable Pangram dashboard link (default false; only for non-sensitive text).

The tool takes inline text only — not a file path. Reading files server-side would let a caller exfiltrate any file the process can read, bypassing the harness's permission-gated file tools. Read files with your own tools and pass the text.

Returns structured output: prediction, prediction_short, headline, fraction_ai / fraction_ai_assisted / fraction_human (0.0–1.0), num_ai_segments / num_ai_assisted_segments / num_human_segments, a windows array (per-segment label, ai_assistance_score, confidence, indices), and an optional dashboard_link.

Development

uv sync --extra dev
uv run pytest
uv run ruff check .
uv run mypy src

License

MIT — see LICENSE.

Available Tools

1 tool
analyzeA
Read-onlyIdempotent

Detect AI-generated text with Pangram Labs.

Classifies the input as human-written, AI-generated, or AI-assisted and returns an overall verdict (prediction), per-class fractions 0.0-1.0 (fraction_ai / fraction_ai_assisted / fraction_human), segment counts, and a per-segment breakdown (windows).

Requires the PANGRAM_API_KEY environment variable.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesText to classify (read files with your own tools first).
public_dashboard_linkNoRequest a PUBLIC shareable Pangram dashboard link for the result. Off by default; only enable for non-sensitive text.

Output Schema

ParametersJSON Schema
NameRequiredDescription
versionNoPangram model version that produced this result.
windowsNoPer-segment breakdown.
headlineNoOne-line human summary.
predictionYesOverall verdict for the whole text.
fraction_aiYesFraction of the text classified as AI-generated (0.0-1.0).
dashboard_linkNoShareable dashboard URL (only if requested).
fraction_humanYesFraction classified as human-written (0.0-1.0).
num_ai_segmentsNo
prediction_shortNoShort form of the verdict.
num_human_segmentsNo
fraction_ai_assistedYesFraction classified as AI-assisted (0.0-1.0).
num_ai_assisted_segmentsNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds genuinely useful context beyond that: it discloses the PANGRAM_API_KEY environment requirement and the shape of the returned verdict. It doesn't mention rate limits or cost, but the auth prerequisite is the key operational detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then supporting detail in a clean two-block layout. Slightly spends words enumerating return fields that an output schema already covers, but nothing is confusing or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With rich annotations and an existing output schema, the description need not explain return values, yet the combination of purpose, auth requirement, and classification semantics leaves an agent fully equipped to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both parameters are already documented in the schema, including the 'read files with your own tools first' hint and the non-sensitive-text caveat on the dashboard link. The description adds no parameter-level syntax or format detail, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Detect AI-generated text with Pangram Labs') and immediately specifies the classification taxonomy (human-written, AI-generated, AI-assisted). There are no siblings to disambiguate from, but the scope is unambiguous on its own.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what the tool does but never states when to reach for it versus alternatives or when not to use it. Usage is only implied by the classification framing; no exclusions or prerequisites are given beyond the API key note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.1.4
    • First observedanalyze

TDQS

A4.1/5.0

Scored across 1 tool

Disambiguation5/5

With only a single tool, there is no possibility of overlap or misselection. The tool's purpose (AI-text detection) is unambiguous.

Naming Consistency5/5

A lone tool named 'analyze' follows a clear verb-style convention and is readable. With one tool there is no convention to violate.

Tool Count3/5

The server wraps a single-purpose detection API, so one tool is defensible, but it feels thin for anything beyond a one-shot call. There is no batch, async, or configuration surface.

Completeness4/5

The core detection operation is fully covered, returning verdicts, class fractions, and per-segment windows. Minor gaps exist for batch/multi-document analysis or history retrieval, but agents can work around them.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers