@verdict-ai/mcp 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Verdict contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,25 @@
1
- # Temporary Holding Version
1
+ # @verdict-ai/mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Stdio MCP server exposing evaluation tools to agents.
4
+
5
+ ```bash
6
+ npm install @verdict-ai/mcp
7
+ ```
8
+
9
+ Add this to `claude_desktop_config.json`:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "verdict": {
15
+ "command": "npx",
16
+ "args": ["-y", "@verdict-ai/mcp"],
17
+ "env": {
18
+ "VERDICT_API_URL": "http://localhost:8787"
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ Requires Node 20 or newer. [Documentation](https://verdict-docs.developerolim.workers.dev/reference/mcp). MIT licensed.
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Starts the executable transport at the process boundary.
4
+ * Library imports remain side-effect free; startup failures must be visible to the invoking process.
5
+ */
6
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
+ import { createMcpServer } from "./index.js";
8
+ const server = createMcpServer();
9
+ await server.connect(new StdioServerTransport());
10
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;AACjC,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Exposes rubric, evaluation and human-review operations as MCP tools.
3
+ * Local engines and remote clients share result projections; transport schemas validate tool arguments.
4
+ */
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import { Engine } from "@verdict-ai/core";
7
+ import { Verdict } from "@verdict-ai/sdk";
8
+ /**
9
+ * Verdict MCP server. Two modes:
10
+ * - local: runs the engine in-process (set VERDICT_DATA_DIR to persist; needs provider keys e.g. ANTHROPIC_API_KEY)
11
+ * - remote: proxies to a Verdict API (set VERDICT_API_URL + VERDICT_API_KEY)
12
+ */
13
+ export interface McpOptions {
14
+ engine?: Engine;
15
+ client?: Verdict;
16
+ mode?: "local" | "remote";
17
+ apiUrl?: string;
18
+ apiKey?: string;
19
+ dataDir?: string;
20
+ allowLocalFiles?: boolean;
21
+ }
22
+ /** Returns a configured MCP server using local or remote dependencies; transport startup remains the caller responsibility. */
23
+ export declare function createMcpServer(opts?: McpOptions): McpServer;
package/dist/index.js ADDED
@@ -0,0 +1,152 @@
1
+ import { summarize } from "./summary.js";
2
+ import { evaluateSubject, compareSubjects } from "./operations.js";
3
+ /**
4
+ * Exposes rubric, evaluation and human-review operations as MCP tools.
5
+ * Local engines and remote clients share result projections; transport schemas validate tool arguments.
6
+ */
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { Aggregation, calibrate, coerceScore, criterionScale, scaleRange, NotFoundError, ValidationError, Engine, FileStore, Input, loadRubricText, MemoryStore, parseRubric } from "@verdict-ai/core";
9
+ import { Verdict } from "@verdict-ai/sdk";
10
+ import { z } from "zod";
11
+ /** Returns a configured MCP server using local or remote dependencies; transport startup remains the caller responsibility. */
12
+ export function createMcpServer(opts = {}) {
13
+ const mode = opts.mode ?? (process.env.VERDICT_API_URL ? "remote" : "local");
14
+ const client = opts.client ?? (mode === "remote" ? new Verdict({ baseUrl: opts.apiUrl ?? process.env.VERDICT_API_URL, apiKey: opts.apiKey ?? process.env.VERDICT_API_KEY }) : undefined);
15
+ const engine = opts.engine ?? (mode === "local" ? new Engine({ store: (opts.dataDir ?? process.env.VERDICT_DATA_DIR) ? new FileStore(opts.dataDir ?? process.env.VERDICT_DATA_DIR) : new MemoryStore(), ingest: { allowLocalFiles: opts.allowLocalFiles ?? true } }) : undefined);
16
+ const server = new McpServer({ name: "verdict", version: "0.1.0" }, { instructions: "Verdict scores documents, websites, YouTube videos, JSON and text against customizable rubrics. Judges: decision models (Jev / Clef / OpenAI Decisions — typed questions, probabilities, one call per rubric), humans, deterministic benchmarks, optional generative LLM for rationales. Create or inline a rubric, then call evaluate." });
17
+ registerRubrics(server, engine, client);
18
+ registerEvaluations(server, engine, client);
19
+ registerHuman(server, engine, client);
20
+ return server;
21
+ }
22
+ const text = (v) => ({ content: [{ type: "text", text: JSON.stringify(v, null, 2) }] });
23
+ function registerRubrics(server, engine, client) {
24
+ server.registerTool("validate_rubric", {
25
+ title: "Validate rubric",
26
+ description: "Validate a rubric (JSON object or YAML string) and return it with defaults filled in. Use before evaluate to catch mistakes.",
27
+ inputSchema: { rubric: z.union([z.string(), z.record(z.string(), z.unknown())]) },
28
+ }, async ({ rubric }) => toolResult(async () => {
29
+ try {
30
+ return text({ valid: true, rubric: typeof rubric === "string" ? loadRubricText(rubric) : parseRubric(rubric) });
31
+ }
32
+ catch (e) {
33
+ return text({ valid: false, error: e.message });
34
+ }
35
+ }));
36
+ server.registerTool("create_rubric", {
37
+ title: "Create rubric",
38
+ description: "Store a rubric and get back its id for reuse. Criteria need id/name; optional weight, scale, anchors (= rubric levels for decision models), judge ({type: decision|human|benchmark|llm|panel}; default decision/typesafe). Aggregation supports weighted_mean, weighted_sum, mean, median, min, max, geometric_mean, formula; gates; grades; passThreshold.",
39
+ inputSchema: { rubric: z.union([z.string(), z.record(z.string(), z.unknown())]) },
40
+ }, async ({ rubric }) => toolResult(async () => {
41
+ const parsed = typeof rubric === "string" ? loadRubricText(rubric) : parseRubric(rubric);
42
+ return text(client ? await client.rubrics.create(parsed) : await engine.createRubric(parsed));
43
+ }));
44
+ server.registerTool("list_rubrics", { title: "List rubrics", description: "List stored rubrics.", inputSchema: {} }, async () => toolResult(async () => (text(client ? (await client.rubrics.list()).data.map((r) => ({ id: r.id, name: r.name, criteria: r.criteria.length })) : (await engine.store.listRubrics()).map((r) => ({ id: r.id, name: r.name, criteria: r.criteria.length }))))));
45
+ server.registerTool("calibration_report", {
46
+ title: "Calibration report", description: "Compare decision confidence against human consensus on stored evaluations.",
47
+ inputSchema: { rubricId: z.string(), target: z.number().min(0).max(1).optional(), buckets: z.number().int().min(1).max(1000).optional() },
48
+ }, async ({ rubricId, ...options }) => toolResult(async () => {
49
+ if (client)
50
+ return text(await client.rubrics.calibration(rubricId, options));
51
+ await engine.resolveRubric(rubricId);
52
+ return text(calibrate(await engine.store.listEvaluations({ rubricId, limit: 1000 }), options));
53
+ }));
54
+ }
55
+ function registerEvaluations(server, engine, client) {
56
+ server.registerTool("evaluate", {
57
+ title: "Evaluate",
58
+ description: "Score a subject against a rubric. `rubric` is a stored rubric id or an inline rubric. Inputs can be text, json, file (path or base64), url, or youtube. Returns the total score, grade, pass/fail, per-criterion scores with rationales, and any pending human tasks.",
59
+ inputSchema: {
60
+ rubric: z.union([z.string(), z.record(z.string(), z.unknown())]),
61
+ inputs: z.array(Input).min(1),
62
+ name: z.string().optional().describe("Subject name for reports"),
63
+ idempotencyKey: z.string().min(1).max(255).optional(),
64
+ metadata: z.record(z.string(), z.unknown()).optional(),
65
+ },
66
+ }, async ({ rubric, inputs, name, metadata, idempotencyKey }) => toolResult(async () => {
67
+ await validateRubricReference(rubric, engine, client);
68
+ const result = await evaluateSubject({ engine, client }, { rubric, inputs, name, metadata, idempotencyKey });
69
+ return text({ ...summarize(result.evaluation), replayed: result.replayed });
70
+ }));
71
+ server.registerTool("compare", {
72
+ title: "Compare / rank",
73
+ description: "Evaluate several subjects against one rubric and return a ranking (leaderboard).",
74
+ inputSchema: {
75
+ rubric: z.union([z.string(), z.record(z.string(), z.unknown())]),
76
+ idempotencyKey: z.string().min(1).max(255).optional(),
77
+ subjects: z.array(z.object({ name: z.string(), inputs: z.array(Input).min(1) })).min(2),
78
+ },
79
+ }, async ({ rubric, subjects, idempotencyKey }) => toolResult(async () => {
80
+ await validateRubricReference(rubric, engine, client);
81
+ const result = await compareSubjects({ engine, client }, { rubric, subjects, idempotencyKey });
82
+ return text({ ranking: result.ranking, replayed: result.replayed });
83
+ }));
84
+ }
85
+ function registerHuman(server, engine, client) {
86
+ server.registerTool("get_evaluation", { title: "Get evaluation", description: "Fetch an evaluation by id (status, scores, rationales, pending human tasks).", inputSchema: { id: z.string() } }, async ({ id }) => toolResult(async () => {
87
+ if (client)
88
+ return text(summarize(await client.evaluations.get(id)));
89
+ const ev = await engine.store.getEvaluation(id);
90
+ return text(ev ? summarize(ev) : { error: `evaluation ${id} not found` });
91
+ }));
92
+ server.registerTool("submit_human_score", {
93
+ title: "Submit human score",
94
+ description: "Submit a human rater's score for a criterion that is waiting on a human. Score is a number on the criterion scale or an ordinal/binary label.",
95
+ inputSchema: { evaluationId: z.string(), criterionId: z.string(), raterId: z.string(), score: z.union([z.number(), z.string()]), rationale: z.string().optional() },
96
+ }, async ({ evaluationId, ...s }) => toolResult(async () => {
97
+ // Remote submissions use the API validation against its frozen rubric.
98
+ if (client)
99
+ return text(summarize(await client.evaluations.submitScore(evaluationId, s)));
100
+ const evaluation = await engine.store.getEvaluation(evaluationId);
101
+ if (!evaluation)
102
+ throw new NotFoundError(`evaluation ${evaluationId} not found`);
103
+ const criterion = evaluation.rubric.criteria.find(c => c.id === s.criterionId);
104
+ if (!criterion)
105
+ throw new ValidationError(`unknown criterion ${s.criterionId}`);
106
+ // Choices have optional score mappings; only scale-based submissions need range validation.
107
+ if (criterion.choices && !Object.hasOwn(criterion.choices, String(s.score)))
108
+ throw new ValidationError(`unknown choice ${s.score}`);
109
+ if (!criterion.choices) {
110
+ const scale = criterionScale(evaluation.rubric, criterion);
111
+ const [min, max] = scaleRange(scale);
112
+ const numeric = typeof s.score === "number" ? s.score : Number(s.score);
113
+ if (Number.isFinite(numeric) && (numeric < min || numeric > max))
114
+ throw new ValidationError(`score must be between ${min} and ${max}`);
115
+ coerceScore(s.score, scale);
116
+ }
117
+ return text(summarize(await engine.submitScore(evaluationId, s)));
118
+ }));
119
+ server.registerTool("reaggregate", {
120
+ title: "Re-aggregate",
121
+ description: "Recompute the total with a different aggregation (method, formula, weights via gates/grades/passThreshold) without re-running judges. Useful for what-if analysis.",
122
+ inputSchema: { evaluationId: z.string(), aggregation: z.record(z.string(), z.unknown()), persist: z.boolean().default(false) },
123
+ }, async ({ evaluationId, aggregation, persist }) => toolResult(async () => (text(summarize(client ? (await client.evaluations.reaggregate(evaluationId, Aggregation.partial().parse(aggregation), persist)) : await engine.reaggregate(evaluationId, Aggregation.partial().parse(aggregation), undefined, persist))))));
124
+ server.registerTool("list_human_tasks", { title: "List human tasks", description: "Criteria waiting on human raters.", inputSchema: { rater: z.string().optional() } }, async ({ rater }) => toolResult(async () => {
125
+ if (client)
126
+ return text((await client.tasks.list(rater)).data);
127
+ // why: filter only tenant-visible pending work; named assignments take precedence over allowed-rater pools.
128
+ const list = await engine.store.listEvaluations({ status: "pending_human", limit: TASK_INBOX_LIMIT });
129
+ return text(list.flatMap((e) => e.pendingTasks.filter((t) => !rater || (t.raterId ? t.raterId === rater : !t.allowedRaters || t.allowedRaters.includes(rater))).map((t) => ({ evaluationId: e.id, rubric: e.rubric.name, subject: e.subject.name, ...t }))));
130
+ }));
131
+ }
132
+ // MCP callers need protocol error content, including when a local adapter rejects.
133
+ async function toolResult(work) {
134
+ try {
135
+ return await work();
136
+ }
137
+ catch (error) {
138
+ return { isError: true, ...text({ error: error instanceof Error ? error.message : String(error) }) };
139
+ }
140
+ }
141
+ // why: match the REST inbox cap so local MCP calls do not scan unbounded evaluation history.
142
+ const TASK_INBOX_LIMIT = 500;
143
+ // Stored references need a lookup; inline rubrics are validated by the operation parser.
144
+ async function validateRubricReference(rubric, engine, client) {
145
+ if (typeof rubric !== "string")
146
+ return;
147
+ // Remote APIs resolve ids themselves; avoid adding a lookup to every remote evaluation.
148
+ if (client)
149
+ return;
150
+ await engine.resolveRubric(rubric);
151
+ }
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,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IAAsB;IACjD,IAAI,CAAC;QAAC,OAAO,MAAM,IAAI,EAAE,CAAC;IAAC,CAAC;IAC5B,OAAO,KAAK,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IAAC,CAAC;AACzH,CAAC;AAED,6FAA6F;AAC7F,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAG7B,yFAAyF;AACzF,KAAK,UAAU,uBAAuB,CAAC,MAAwC,EAAE,MAAe,EAAE,MAAgB;IAChH,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO;IACvC,wFAAwF;IACxF,IAAI,MAAM;QAAE,OAAO;IACnB,MAAM,MAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { type Engine, type Input, type Subject } from "@verdict-ai/core";
2
+ import type { Verdict } from "@verdict-ai/sdk";
3
+ type Dependencies = {
4
+ engine?: Engine;
5
+ client?: Verdict;
6
+ };
7
+ type RubricReference = string | Record<string, unknown>;
8
+ /** Transport-independent operation; the idempotency key selects reservation before any judge work. */
9
+ export declare function evaluateSubject(dependencies: Dependencies, params: {
10
+ rubric: RubricReference;
11
+ inputs: Input[];
12
+ name?: string;
13
+ metadata?: Record<string, unknown>;
14
+ idempotencyKey?: string;
15
+ }): Promise<{
16
+ evaluation: import("@verdict-ai/sdk").EvaluationView;
17
+ replayed: boolean;
18
+ } | {
19
+ evaluation: import("@verdict-ai/core").Evaluation;
20
+ replayed: boolean;
21
+ }>;
22
+ /** Shares local and remote ranking semantics without depending on the MCP server. */
23
+ export declare function compareSubjects(dependencies: Dependencies, params: {
24
+ rubric: RubricReference;
25
+ subjects: Subject[];
26
+ idempotencyKey?: string;
27
+ }): Promise<{
28
+ replayed: boolean;
29
+ ranking: Array<{
30
+ rank: number;
31
+ evaluationId: string;
32
+ subject: string;
33
+ score?: number;
34
+ grade?: string;
35
+ passed?: boolean;
36
+ status: string;
37
+ }>;
38
+ evaluations: import("@verdict-ai/sdk").EvaluationView[];
39
+ } | {
40
+ ranking: {
41
+ rank: number;
42
+ evaluationId: string;
43
+ subject: string;
44
+ score: number | undefined;
45
+ grade: string | undefined;
46
+ passed: boolean | undefined;
47
+ status: import("@verdict-ai/core").EvaluationStatus;
48
+ }[];
49
+ evaluations: import("@verdict-ai/core").Evaluation[];
50
+ replayed: boolean;
51
+ }>;
52
+ export {};
@@ -0,0 +1,39 @@
1
+ import { parseRubric, ValidationError } from "@verdict-ai/core";
2
+ function localEngine(dependencies) {
3
+ if (!dependencies.engine)
4
+ throw new ValidationError("local MCP operation requires an engine");
5
+ return dependencies.engine;
6
+ }
7
+ /** Transport-independent operation; the idempotency key selects reservation before any judge work. */
8
+ export async function evaluateSubject(dependencies, params) {
9
+ const { client } = dependencies;
10
+ const { inputs, name, metadata, idempotencyKey } = params;
11
+ const rubric = typeof params.rubric === "string" ? params.rubric : parseRubric(params.rubric);
12
+ if (client) {
13
+ const request = { rubric, inputs, name, metadata };
14
+ if (idempotencyKey)
15
+ return client.evaluations.createIdempotent(request, idempotencyKey);
16
+ return { evaluation: await client.evaluations.create(request), replayed: false };
17
+ }
18
+ const engine = localEngine(dependencies);
19
+ const request = { rubric, subject: { name, inputs }, metadata };
20
+ if (idempotencyKey)
21
+ return engine.evaluateIdempotent({ ...request, idempotencyKey });
22
+ return { evaluation: await engine.evaluate(request), replayed: false };
23
+ }
24
+ /** Shares local and remote ranking semantics without depending on the MCP server. */
25
+ export async function compareSubjects(dependencies, params) {
26
+ const { client } = dependencies;
27
+ const { subjects, idempotencyKey } = params;
28
+ const rubric = typeof params.rubric === "string" ? params.rubric : parseRubric(params.rubric);
29
+ if (client) {
30
+ if (idempotencyKey)
31
+ return client.batches.createIdempotent({ rubric, subjects }, idempotencyKey);
32
+ return { ...await client.batches.create({ rubric, subjects }), replayed: false };
33
+ }
34
+ const engine = localEngine(dependencies);
35
+ if (idempotencyKey)
36
+ return engine.evaluateBatchIdempotent(rubric, subjects, { idempotencyKey });
37
+ return { ...await engine.evaluateBatch(rubric, subjects), replayed: false };
38
+ }
39
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAyC,MAAM,kBAAkB,CAAC;AAMvG,SAAS,WAAW,CAAC,YAA0B;IAC7C,IAAI,CAAC,YAAY,CAAC,MAAM;QAAE,MAAM,IAAI,eAAe,CAAC,wCAAwC,CAAC,CAAC;IAC9F,OAAO,YAAY,CAAC,MAAM,CAAC;AAC7B,CAAC;AAED,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,YAA0B,EAAE,MAEjE;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAChC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAC1D,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9F,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACnD,IAAI,cAAc;YAAE,OAAO,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACxF,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,QAAQ,EA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CAAC;IAChG,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { Evaluation } from "@verdict-ai/core";
2
+ type SummaryEvaluation = Pick<Evaluation, "id" | "status" | "job" | "aggregate" | "criteria" | "pendingTasks" | "error" | "usage">;
3
+ export declare function summarize(e: SummaryEvaluation): {
4
+ score: number | undefined;
5
+ grade: string | undefined;
6
+ passed: boolean | undefined;
7
+ partial: boolean;
8
+ criteria: {
9
+ id: string;
10
+ name: string;
11
+ status: "error" | "scored" | "pending" | "excluded";
12
+ choice: string | undefined;
13
+ score: number | undefined;
14
+ normalized: number | undefined;
15
+ pending: number;
16
+ confidence: number | undefined;
17
+ probabilities: Record<string, number> | undefined;
18
+ rationale: string | undefined;
19
+ quotes: string[];
20
+ }[];
21
+ pendingTasks: {
22
+ criterionId: string;
23
+ raterId?: string;
24
+ allowedRaters?: string[];
25
+ instructions?: string;
26
+ }[];
27
+ error: string | undefined;
28
+ usage: {
29
+ decisionCalls: number;
30
+ llmCalls: number;
31
+ inputTokens: number;
32
+ outputTokens: number;
33
+ durationMs: number;
34
+ };
35
+ job?: {
36
+ attempts: number;
37
+ maxAttempts: number;
38
+ lastError?: string;
39
+ nextAttemptAt?: string;
40
+ deadLettered?: boolean;
41
+ } | undefined;
42
+ id: string;
43
+ status: import("@verdict-ai/core").EvaluationStatus;
44
+ };
45
+ export {};
@@ -0,0 +1,16 @@
1
+ export function summarize(e) {
2
+ return {
3
+ id: e.id,
4
+ status: e.status,
5
+ ...(e.job ? { job: e.job } : {}),
6
+ score: e.aggregate?.score,
7
+ grade: e.aggregate?.grade,
8
+ passed: e.aggregate?.passed,
9
+ partial: e.aggregate?.partial,
10
+ criteria: e.criteria?.map((c) => ({ id: c.criterionId, name: c.name, status: c.status, choice: c.choice, score: c.score, normalized: c.normalized, pending: c.pending, confidence: c.ratings?.find((r) => typeof r.confidence === "number")?.confidence, probabilities: c.ratings?.find((r) => r.probabilities)?.probabilities, rationale: c.ratings?.find((r) => r.rationale)?.rationale, quotes: c.ratings?.flatMap((r) => r.quotes ?? []).slice(0, 3) })),
11
+ pendingTasks: e.pendingTasks,
12
+ error: e.error,
13
+ usage: e.usage,
14
+ };
15
+ }
16
+ //# sourceMappingURL=summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,SAAS,CAAC,CAAoB;IAC5C,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK;QACzB,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK;QACzB,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM;QAC3B,OAAO,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO;QAC7B,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5b,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,KAAK,EAAE,CAAC,CAAC,KAAK;KACf,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@verdict-ai/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Verdict MCP server — expose the evaluation engine to any agent.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "verdict-mcp": "./dist/bin.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "@modelcontextprotocol/sdk": "^1.32.2",
19
+ "zod": "^4.6.7",
20
+ "@verdict-ai/sdk": "0.1.0",
21
+ "@verdict-ai/core": "0.1.0"
22
+ },
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/Ustay-coder/verdict.git",
27
+ "directory": "packages/mcp"
28
+ },
29
+ "homepage": "https://github.com/Ustay-coder/verdict#readme",
30
+ "bugs": {
31
+ "url": "https://github.com/Ustay-coder/verdict/issues"
32
+ },
33
+ "keywords": [
34
+ "evaluation",
35
+ "rubric",
36
+ "decision-model",
37
+ "jev",
38
+ "clef",
39
+ "scoring",
40
+ "llm-judge",
41
+ "mcp"
42
+ ],
43
+ "engines": {
44
+ "node": ">=20"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "files": [
50
+ "dist",
51
+ "README.md",
52
+ "LICENSE"
53
+ ],
54
+ "sideEffects": false,
55
+ "scripts": {
56
+ "build": "tsc -p tsconfig.json && chmod +x dist/bin.js",
57
+ "typecheck": "tsc -p tsconfig.json --noEmit",
58
+ "test": "vitest run --passWithNoTests"
59
+ }
6
60
  }