Skip to main content
Glama
Open-Detector MCP

Open-Detector MCP

by eslam-allam

Open-Detector MCP

An MCP server that scores academic papers for AI-like style, paragraph by paragraph, and gives an agent a concrete loop for revising them. It wraps the open-source Open-Detector BERT model (followsci/bert-ai-text-detector, MIT) and is built to be installed as a uv tool and used by coding/research agents.

Why paragraph-level: the model was trained on academic paragraphs. In testing it is confident and stable there (100% AI on formulaic LLM abstracts, 0% on twenty pre-2023 arXiv abstracts), but noisy on isolated sentences. This server therefore makes the paragraph the unit of scoring, skips headings/titles and bibliographies, and treats sentence-level spans as an explicitly weak localisation hint.

Install

# from GitHub
uv tool install "git+https://github.com/eslam-allam/open-detector-mcp"

# CPU-only (much smaller install: skips CUDA wheels)
uv tool install "git+https://github.com/eslam-allam/open-detector-mcp" --torch-backend cpu

# from a local clone
uv tool install .

This installs two commands:

Command

Purpose

open-detector-mcp

the MCP stdio server

open-detector

CLI: score, plan, compare, status, download

The first detection downloads ~440 MB of model weights from Hugging Face (one-time, cached in ~/.cache/huggingface). Pre-fetch it with:

open-detector download

Related MCP server: slop-guard

Wire it into an MCP client

opencode (~/.config/opencode/opencode.json):

{
  "mcp": {
    "servers": {
      "open-detector": {
        "type": "local",
        "command": ["open-detector-mcp"]
      }
    }
  }
}

Claude Desktop:

{
  "mcpServers": {
    "open-detector": {
      "command": "open-detector-mcp"
    }
  }
}

Tools

Tool

What it does

get_model_status(warmup=false)

Cache/download state; warmup=true loads and warms the model. Returns instantly otherwise.

detect_ai_text(text, detail="paragraph", include_text=false, exclude_references=true)

Overall ai_pct, verdict, paragraph bands, per-paragraph scores + style flags.

detect_ai_file(path, ...)

Same for .txt, .md, .rst, .tex, .docx, .pdf — the server reads the file, so large drafts stay out of the model's context.

get_rewrite_plan(path=... or text=..., top_n=5, min_ai_pct=50, include_text=true)

Ranked rewrite targets with full text, deterministic style issues and edit-level hints.

read_paragraphs(path, indices)

Exact paragraph text by stable index (max 50 per call).

compare_texts(text_a, text_b)

Before/after scores, per-paragraph deltas, improved/regressed counts.

compare_files(path_a, path_b)

Same for two files; aligns paragraphs by similarity when counts differ.

There is also a humanize_paper prompt and an open-detector://guide resource with the same workflow.

Agent workflow

get_model_status(warmup=true)
detect_ai_file("paper.docx")
get_rewrite_plan(path="paper.docx", top_n=5)
  → rewrite paragraph 8, 3, 12 ...
compare_texts(original_paragraph, rewritten_paragraph)
  → repeat until every paragraph is < 50%, ideally < 20%

get_rewrite_plan is the entry point for humanizing: it returns the exact paragraph text plus issues such as uniform sentence length, stock transitions (moreover, furthermore, ultimately), LLM-favoured vocabulary (delve, seamless, pivotal, holistic), formulaic constructions (not only … but also, it is important to note), em-dash overuse and nominalisation density. Hints are edit-level, e.g. "3 generic connectives in 86 words (34.9 per 1000): moreover ×1, furthermore ×1, ultimately ×1 — delete most and let argument order carry the logic."

Light paraphrases do not move this model: in testing, a synonym-swap edit stayed at 100% AI while a structural rewrite dropped to 0%. Agents should change sentence order, specificity and rhythm, not just wording.

Scoring semantics

  • ai_pct is 0–100, higher = more AI-like. Verdicts: LIKELY AI ≥ 60, MIXED 40–59, LIKELY HUMAN < 40.

  • Bands per paragraph: high ≥ 80, medium 50–79, low 20–49, human < 20.

  • Paragraphs below 8 words and heading-like fragments (short, no terminal punctuation) are Skipped but keep their index.

  • The overall score is the mean of scored paragraph scores. A document with a few 100% paragraphs and many 0% paragraphs reports a middling average; use bands and paragraphs_flagged for the real picture.

  • Long paragraphs (> 480 tokens) are split on sentence boundaries and combined by token count; chunked: true exposes the per-chunk scores.

  • exclude_references=true (default) cuts everything after a References/Bibliography/Works Cited heading. Reference lists are formulaic and would skew the average.

  • detail="windows" adds 3-sentence candidate spans inside already-flagged paragraphs. Treat them as weak hints only; the paragraph score governs. Re-score the whole paragraph after editing.

CLI

open-detector score paper.docx                 # table
open-detector score paper.docx --json          # full report
open-detector score - < paper.txt              # stdin
open-detector plan paper.docx --top 5          # rewrite targets + hints
open-detector compare before.txt after.txt     # before/after delta
open-detector status                           # model cache / device
open-detector download                         # pre-fetch weights

Environment variables

Variable

Default

Meaning

OPEN_DETECTOR_DEVICE

auto

auto, cpu, cuda, mps

OPEN_DETECTOR_MODEL

followsci/bert-ai-text-detector

Alternative 2-class Hugging Face text-classification model

OPEN_DETECTOR_READY_TIMEOUT

900

Seconds a tool waits for the startup model download

Caveats

  • This is stylometric evidence, not proof of misconduct. The upstream project makes the same point: academic integrity should be judged on content authenticity, not writing style.

  • English academic prose only; the model is bert-base-uncased.

  • False positives happen, especially on formulaic human writing (reviews that enumerate "First… Next… Finally…"). Treat a high score as a prompt to edit, not an accusation.

  • Paragraph scores are not calibrated probabilities; they are highly saturated (often 0% or 100%). Use compare_texts deltas for measuring an edit.

  • DOCX body paragraphs are read; tables are skipped. PDF extraction depends on the PDF's text layer. Legacy .doc is not supported — export to .docx or .txt.

  • No writing tools: the server reads and scores files, but the agent edits with its own tools. This keeps your paper's source-of-truth editing under your control.

Development

uv sync --all-groups
uv run pytest
uv run open-detector-mcp

Credits & license

Available Tools

7 tools
compare_filesB

Compare two versions of a paper on disk (e.g. original.docx vs revised.docx).

Same response as compare_texts. Paragraph counts should match for index pairing to be meaningful; the response warns when they differ.

Inputs: path_a (required), path_b (required), exclude_references.

compare_textsA

Score two versions of a text and report the before/after delta.

Paragraphs are paired by index, so use it for paragraph-level rewrites or in-place edits that preserve paragraph boundaries. Negative delta_ai_pct is an improvement. Also returns per-paragraph deltas and improved/regressed counts.

Inputs: text_a (required), text_b (required), exclude_references.

detect_ai_fileA

Score a local paper (.txt, .md, .tex, .docx, .pdf) without loading it into context.

Args: path: Path to the file (~ is expanded). detail: 'paragraph' (default) or 'windows'. include_text: Include each paragraph's full text (large; usually use get_rewrite_plan or read_paragraphs instead). exclude_references: Drop the bibliography (default true).

DOCX body paragraphs and PDF page text are extracted; DOCX tables are skipped. Same response shape as detect_ai_text, plus source metadata.

Inputs: path (required), detail, include_text, exclude_references.

detect_ai_textA

Score a string of academic text for AI-like style, paragraph by paragraph.

Args: text: The text to analyse. detail: 'paragraph' (default, reliable) or 'windows' (adds weak 3-sentence candidate spans inside flagged paragraphs; doubles cost). include_text: Include each paragraph's full text in the response. Off by default to keep context small. exclude_references: Drop everything after a References/Bibliography heading (default true; reference lists skew the average).

Returns overall ai_pct (0-100, higher = more AI-like), verdict, paragraph bands, per-paragraph scores with stable indices, and deterministic style flags.

Inputs: text (required), detail, include_text, exclude_references.

get_model_statusA

Check whether the detector is cached, downloading, or loaded.

Returns instantly unless warmup=true. Call this before the first detection so you can warn the user about the one-time ~440 MB Hugging Face download. Set warmup=true to load the model into memory before scoring (adds a few seconds, avoids a slow first detection).

Inputs: warmup.

get_rewrite_planA

Rank the paragraphs most worth rewriting and explain what to change.

Pass exactly one of 'path' or 'text'. Returns the overall score plus targets sorted by ai_pct, each with full paragraph text, deterministic style issues (uniform sentence length, stock transitions, buzzwords, em dashes, etc.) and concrete hints. This is the best tool to start a humanization pass.

Args: path: Paper file (.txt/.md/.tex/.docx/.pdf). text: Text to analyse instead of a file. top_n: Maximum number of targets to return (default 5). min_ai_pct: Only include paragraphs at or above this score (default 50). include_text: Include each target's full text (default true). exclude_references: Drop the bibliography (default true).

Inputs: path, text, top_n, min_ai_pct, +2 more.

read_paragraphsA

Fetch exact paragraph text by index (for rewriting without loading the whole paper).

Indices come from detect_ai_file / get_rewrite_plan and are stable for the same file and exclude_references setting. Request at most 50 at a time.

Inputs: path (required), indices (required), exclude_references.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool has a clearly stated role, and descriptions explicitly differentiate the text-vs-file pairs (detect_ai_text/detect_ai_file, compare_texts/compare_files). The only mild overlap is that get_rewrite_plan accepts either path or text, so it partially duplicates the detection tools' input surface, but its output purpose (ranked rewrite targets) is distinct.

    Naming Consistency5/5

    All seven tools follow a consistent snake_case verb_noun pattern (get_model_status, detect_ai_text, detect_ai_file, get_rewrite_plan, read_paragraphs, compare_texts, compare_files). The verb choice is meaningful and predictable: get/read for retrieval, detect for scoring, compare for deltas.

    Tool Count5/5

    Seven tools is well within the ideal 3-15 range and every tool earns its place: status check, two entry points for scoring, a planning tool, a targeted paragraph reader, and two comparison variants. No redundant or filler tools.

    Completeness4/5

    The surface covers the full workflow: warmup/status, scoring (text and file), rewrite planning, targeted paragraph retrieval, and before/after comparison, with paragraph indices linking tools together. Minor gaps exist around configuration (thresholds, model choice) and explicit model unload/reset, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables agents to analyze prose for formulaic AI writing patterns and return a 0–100 score, band label, violations with context, and concrete advice through its MCP tools.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables agents and users to analyze text or files for formulaic AI writing patterns and receive a 0–100 score, band label, violations with surrounding context, and concrete advice. It works programmatically without LLM judges or API calls.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables agents to analyze text or files for formulaic AI writing patterns, returning a 0–100 score, band label, specific violations, and concrete advice without LLM judges or API calls.
      -