Skip to content

Commit fea5d58

Browse files
Merge pull request #10 from mclenhard/feat/add-evals
adds eval testing
2 parents d129447 + 9b9d055 commit fea5d58

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ Add this to your `claude_desktop_config.json`:
157157
}
158158
```
159159

160+
## Running evals
161+
162+
The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can see the full documentation [here](https://www.mcpevals.io/docs).
163+
164+
```bash
165+
SEARXNG_URL=SEARXNG_URL OPENAI_API_KEY=your-key npx mcp-eval evals.ts index.ts
166+
```
160167

161168
## License
162169

evals.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//evals.ts
2+
3+
import { EvalConfig } from 'mcp-evals';
4+
import { openai } from "@ai-sdk/openai";
5+
import { grade, EvalFunction } from "mcp-evals";
6+
7+
const searxng_web_searchEval: EvalFunction = {
8+
name: "searxng_web_search Tool Evaluation",
9+
description: "Evaluates searxng_web_search tool functionality",
10+
run: async () => {
11+
const result = await grade(openai("gpt-4o"), "Search for the latest news on climate change using the searxng_web_search tool and summarize the top findings.");
12+
return JSON.parse(result);
13+
}
14+
};
15+
16+
const config: EvalConfig = {
17+
model: openai("gpt-4o"),
18+
evals: [searxng_web_searchEval ]
19+
};
20+
21+
export default config;
22+
23+
export const evals = [searxng_web_searchEval ];

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
"postversion": "node scripts/update-version.js && git add index.ts && git commit --amend --no-edit"
4141
},
4242
"dependencies": {
43+
"@modelcontextprotocol/sdk": "1.10.1",
44+
"mcp-evals": "^1.0.18",
4345
"@modelcontextprotocol/sdk": "1.15.0",
4446
"node-html-markdown": "^1.3.0"
4547
},

0 commit comments

Comments
 (0)