mcp-eval-gateway 1.0.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.
@@ -0,0 +1,81 @@
1
+ import { FetchLike, Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
2
+ import { ToolSet, LanguageModel } from 'ai';
3
+
4
+ declare const EVALUATION_PROMPT = "You are an AI assistant with access to tools.\n\nWhen given a task, you MUST:\n1. Use the available tools to complete the task\n2. Provide summary of each step in your approach, wrapped in <summary> tags\n3. Provide feedback on the tools provided, wrapped in <feedback> tags\n4. Provide your final response, wrapped in <response> tags\n\nSummary Requirements:\n- In your <summary> tags, you must explain:\n - The steps you took to complete the task\n - Which tools you used, in what order, and why\n - The inputs you provided to each tool\n - The outputs you received from each tool\n - A summary for how you arrived at the response\n\nFeedback Requirements:\n- In your <feedback> tags, provide constructive feedback on the tools:\n - Comment on tool names: Are they clear and descriptive?\n - Comment on input parameters: Are they well-documented? Are required vs optional parameters clear?\n - Comment on descriptions: Do they accurately describe what the tool does?\n - Comment on any errors encountered during tool usage: Did the tool fail to execute? Did the tool return too many tokens?\n - Identify specific areas for improvement and explain WHY they would help\n - Be specific and actionable in your suggestions\n\nResponse Requirements:\n- Your response should be concise and directly address what was asked\n- Always wrap your final response in <response> tags\n- If you cannot solve the task return <response>NOT_FOUND</response>\n- For numeric responses, provide just the number\n- For IDs, provide just the ID\n- For names or text, provide the exact text requested\n- Your response should go last";
5
+
6
+ type InitEvalProjectOptions = {
7
+ dir?: string;
8
+ };
9
+ declare function initEvalProject(rootDir: string, options?: InitEvalProjectOptions): void;
10
+
11
+ type ToolsFromMcpOptions = {
12
+ url: string | URL;
13
+ fetch?: FetchLike;
14
+ headers?: Record<string, string>;
15
+ } | {
16
+ transport: Transport;
17
+ };
18
+ declare function toolsFromMcp(options: ToolsFromMcpOptions): Promise<{
19
+ tools: ToolSet;
20
+ close: () => Promise<void>;
21
+ }>;
22
+
23
+ declare function resolveModel(model: string): Promise<LanguageModel>;
24
+
25
+ type EvalTask = {
26
+ name: string;
27
+ prompt: string;
28
+ expected: string;
29
+ required?: boolean;
30
+ setup?: () => void | Promise<void>;
31
+ scorer?: (actual: string | null, task: EvalTask) => number;
32
+ };
33
+ type ToolMetrics = Record<string, {
34
+ count: number;
35
+ durationsMs: number[];
36
+ }>;
37
+ type TaskResult = {
38
+ name: string;
39
+ prompt: string;
40
+ expected: string;
41
+ actual: string | null;
42
+ score: number;
43
+ passed: boolean;
44
+ required: boolean;
45
+ durationMs: number;
46
+ toolMetrics: ToolMetrics;
47
+ numToolCalls: number;
48
+ summary: string | null;
49
+ feedback: string | null;
50
+ };
51
+ type EvalRunResult = {
52
+ total: number;
53
+ correct: number;
54
+ accuracy: number;
55
+ results: TaskResult[];
56
+ report: string;
57
+ };
58
+
59
+ type RunEvalProjectOptions = {
60
+ dir?: string;
61
+ envFile?: string;
62
+ model?: string;
63
+ };
64
+ declare function runEvalProject(rootDir: string, options?: RunEvalProjectOptions): Promise<EvalRunResult>;
65
+
66
+ type RunEvalsOptions = {
67
+ model: string | LanguageModel;
68
+ tools: ToolSet;
69
+ tasks: EvalTask[];
70
+ maxSteps?: number;
71
+ systemPrompt?: string;
72
+ scorer?: (actual: string | null, task: EvalTask) => number;
73
+ };
74
+ declare function runEvals(options: RunEvalsOptions): Promise<EvalRunResult>;
75
+
76
+ declare function assertEvalResult(result: EvalRunResult, options?: {
77
+ threshold?: number;
78
+ }): void;
79
+ declare function writeGitHubSummary(result: EvalRunResult): boolean;
80
+
81
+ export { EVALUATION_PROMPT, type EvalRunResult, type EvalTask, type InitEvalProjectOptions, type RunEvalProjectOptions, type TaskResult, type ToolMetrics, assertEvalResult, initEvalProject, resolveModel, runEvalProject, runEvals, toolsFromMcp, writeGitHubSummary };
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ import {
2
+ EVALUATION_PROMPT,
3
+ assertEvalResult,
4
+ initEvalProject,
5
+ resolveModel,
6
+ runEvalProject,
7
+ runEvals,
8
+ toolsFromMcp,
9
+ writeGitHubSummary
10
+ } from "./chunk-6UIMILU4.js";
11
+ export {
12
+ EVALUATION_PROMPT,
13
+ assertEvalResult,
14
+ initEvalProject,
15
+ resolveModel,
16
+ runEvalProject,
17
+ runEvals,
18
+ toolsFromMcp,
19
+ writeGitHubSummary
20
+ };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "mcp-eval-gateway",
3
+ "version": "1.0.0",
4
+ "description": "Run LLM tool-use evaluations against MCP servers with the Vercel AI SDK",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "bin": {
22
+ "mcp-eval-gateway": "./dist/cli.js"
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "scripts": {
28
+ "test": "vitest run",
29
+ "build": "tsup",
30
+ "prepublishOnly": "npm run build"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/guillegette/mcp-eval-gateway.git"
38
+ },
39
+ "keywords": [
40
+ "mcp",
41
+ "model context protocol",
42
+ "eval",
43
+ "evaluation",
44
+ "llm",
45
+ "ai-sdk"
46
+ ],
47
+ "author": "Guillermo Gette (https://github.com/guillegette)",
48
+ "bugs": {
49
+ "url": "https://github.com/guillegette/mcp-eval-gateway/issues"
50
+ },
51
+ "homepage": "https://github.com/guillegette/mcp-eval-gateway#readme",
52
+ "license": "MIT",
53
+ "engines": {
54
+ "node": ">=22"
55
+ },
56
+ "dependencies": {
57
+ "@modelcontextprotocol/sdk": "^1.30.0",
58
+ "ai": "^7.0.0",
59
+ "jiti": "^2.7.0",
60
+ "yaml": "^2.9.0"
61
+ },
62
+ "peerDependencies": {
63
+ "@ai-sdk/amazon-bedrock": "^5.0.0",
64
+ "@ai-sdk/anthropic": "^4.0.0",
65
+ "@ai-sdk/openai": "^4.0.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "@ai-sdk/amazon-bedrock": {
69
+ "optional": true
70
+ },
71
+ "@ai-sdk/anthropic": {
72
+ "optional": true
73
+ },
74
+ "@ai-sdk/openai": {
75
+ "optional": true
76
+ }
77
+ },
78
+ "devDependencies": {
79
+ "@ai-sdk/amazon-bedrock": "^5.0.66",
80
+ "@ai-sdk/anthropic": "^4.0.44",
81
+ "@ai-sdk/openai": "^4.0.50",
82
+ "@types/node": "^24.0.0",
83
+ "tsup": "^8.5.0",
84
+ "typescript": "^5.9.2",
85
+ "vitest": "^4.1.0",
86
+ "zod": "^4.0.0"
87
+ }
88
+ }