cleanpastedtext-mcp 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare const VERSION = "0.2.0";
2
+ export declare const VERSION = "0.3.0";
3
3
  /** Inputs above this size are refused so one call cannot stall the host. */
4
4
  export declare const MAX_INPUT_CHARS = 1000000;
5
5
  /**
package/dist/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
- import { cleanText, DEFAULT_PRESET, PRESET_DESCRIPTIONS, PRESETS, } from "cleanpastedtext";
4
- export const VERSION = "0.2.0";
3
+ import { analyzeAiSignals, cleanText, FAMILY_LABELS, SIGNAL_GENRES, DEFAULT_PRESET, PRESET_DESCRIPTIONS, PRESETS, } from "cleanpastedtext";
4
+ export const VERSION = "0.3.0";
5
5
  /** Inputs above this size are refused so one call cannot stall the host. */
6
6
  export const MAX_INPUT_CHARS = 1_000_000;
7
7
  const PRESET_NAMES = Object.keys(PRESETS);
@@ -111,6 +111,57 @@ export function createServer() {
111
111
  structuredContent: { preset: resolved.name, cleanedText, changeCount, detections, hiddenMessages },
112
112
  };
113
113
  });
114
+ const genreNames = Object.keys(SIGNAL_GENRES);
115
+ server.registerTool("ai_signals", {
116
+ title: "AI-style writing signals",
117
+ description: "Report published AI-writing patterns in a text as explainable evidence, never a verdict: chatbot-interface residue (citation tokens, placeholders, assistant openers and sign-offs) and a Low/Medium/High style strength from overused vocabulary, phrase templates, chat formatting, em-dash rate and participial clauses. Every signal lists the matched text, its source and the human writing it also appears in. Run it on the original paste, before cleaning. Under 150 words the style is not assessed. Do not present the result as proof of AI authorship; non-native and formal human writing can score Medium or High.",
118
+ inputSchema: {
119
+ text: textInput,
120
+ genre: z.enum(genreNames).optional().describe(`Kind of writing; changes weights. ${genreNames.map((g) => `${g} (${SIGNAL_GENRES[g]})`).join(", ")}. Defaults to general.`),
121
+ },
122
+ outputSchema: {
123
+ level: z.enum(["not-enough-text", "low", "medium", "high"]),
124
+ points: z.number(),
125
+ words: z.number(),
126
+ genre: z.string(),
127
+ families: z.array(z.object({ family: z.string(), points: z.number(), cap: z.number() })),
128
+ signals: z.array(z.object({
129
+ id: z.string(),
130
+ family: z.string(),
131
+ label: z.string(),
132
+ matches: z.array(z.string()),
133
+ count: z.number(),
134
+ points: z.number(),
135
+ note: z.string(),
136
+ falsePositives: z.string(),
137
+ source: z.object({ title: z.string(), url: z.string() }),
138
+ })),
139
+ residue: z.array(z.object({
140
+ id: z.string(),
141
+ label: z.string(),
142
+ matches: z.array(z.string()),
143
+ count: z.number(),
144
+ strength: z.enum(["definitive", "strong"]),
145
+ note: z.string(),
146
+ source: z.object({ title: z.string(), url: z.string() }),
147
+ })),
148
+ notes: z.array(z.string()),
149
+ lexiconVersion: z.string(),
150
+ },
151
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
152
+ }, async ({ text, genre }) => {
153
+ const report = analyzeAiSignals(text, genre ?? "general");
154
+ const lines = [
155
+ `AI-style signals: ${report.level} (${report.points} points across ${report.families.length} families, ${report.words} words). Evidence, not a verdict.`,
156
+ ...report.residue.map((r) => `CHATBOT RESIDUE: ${r.label} ×${r.count} (${r.strength})`),
157
+ ...report.signals.map((sig) => `- ${sig.label} [${FAMILY_LABELS[sig.family]}] +${sig.points}: ${sig.matches.slice(0, 2).join(" / ")}`),
158
+ ...report.notes.map((n) => `Note: ${n}`),
159
+ ];
160
+ return {
161
+ content: [{ type: "text", text: lines.join("\n") }],
162
+ structuredContent: report,
163
+ };
164
+ });
114
165
  server.registerTool("list_presets", {
115
166
  title: "List cleaning presets",
116
167
  description: "List the available cleaning presets with a description and the exact options each one turns on.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cleanpastedtext-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local MCP server that lets AI agents inspect and clean hidden Unicode, odd spaces and AI-style typography in text. Runs on your machine; text is never sent anywhere.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@modelcontextprotocol/sdk": "^1.32.2",
28
- "cleanpastedtext": "^0.2.0",
28
+ "cleanpastedtext": "^0.3.0",
29
29
  "zod": "^4.6.7"
30
30
  },
31
31
  "keywords": [