Skip to content

Commit afbbeb6

Browse files
committed
test(mcp): update tests and docs for websearch MCP
- Update index.test.ts to verify 3 MCPs (websearch, context7, grep_app) - Add Exa/websearch documentation to README.md MCPs section 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent d9d549e commit afbbeb6

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ These tools enable agents to reference previous conversations and maintain conti
582582
- Use camelCase for function names
583583
```
584584
- **Online**: Project rules aren't everything. Built-in MCPs for extended capabilities:
585+
- **websearch**: Real-time web search powered by [Exa AI](https://exa.ai)
585586
- **context7**: Official documentation lookup
586587
- **grep_app**: Ultra-fast code search across public GitHub repos (great for finding implementation examples)
587588

@@ -983,16 +984,17 @@ Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `sessio
983984

984985
### MCPs
985986

986-
Context7 and grep.app MCP enabled by default.
987+
Exa, Context7 and grep.app MCP enabled by default.
987988

989+
- **websearch**: Real-time web search powered by [Exa AI](https://exa.ai) - searches the web and returns relevant content
988990
- **context7**: Fetches up-to-date official documentation for libraries
989991
- **grep_app**: Ultra-fast code search across millions of public GitHub repositories via [grep.app](https://grep.app)
990992

991993
Don't want them? Disable via `disabled_mcps` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
992994

993995
```json
994996
{
995-
"disabled_mcps": ["context7", "grep_app"]
997+
"disabled_mcps": ["websearch", "context7", "grep_app"]
996998
}
997999
```
9981000

src/mcp/index.test.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ describe("createBuiltinMcps", () => {
1010
const result = createBuiltinMcps(disabledMcps)
1111

1212
//#then
13+
expect(result).toHaveProperty("websearch")
1314
expect(result).toHaveProperty("context7")
1415
expect(result).toHaveProperty("grep_app")
15-
expect(Object.keys(result)).toHaveLength(2)
16+
expect(Object.keys(result)).toHaveLength(3)
1617
})
1718

1819
test("should filter out disabled built-in MCPs", () => {
@@ -23,19 +24,21 @@ describe("createBuiltinMcps", () => {
2324
const result = createBuiltinMcps(disabledMcps)
2425

2526
//#then
27+
expect(result).toHaveProperty("websearch")
2628
expect(result).not.toHaveProperty("context7")
2729
expect(result).toHaveProperty("grep_app")
28-
expect(Object.keys(result)).toHaveLength(1)
30+
expect(Object.keys(result)).toHaveLength(2)
2931
})
3032

31-
test("should filter out both built-in MCPs when both disabled", () => {
33+
test("should filter out all built-in MCPs when all disabled", () => {
3234
//#given
33-
const disabledMcps = ["context7", "grep_app"]
35+
const disabledMcps = ["websearch", "context7", "grep_app"]
3436

3537
//#when
3638
const result = createBuiltinMcps(disabledMcps)
3739

3840
//#then
41+
expect(result).not.toHaveProperty("websearch")
3942
expect(result).not.toHaveProperty("context7")
4043
expect(result).not.toHaveProperty("grep_app")
4144
expect(Object.keys(result)).toHaveLength(0)
@@ -49,9 +52,10 @@ describe("createBuiltinMcps", () => {
4952
const result = createBuiltinMcps(disabledMcps)
5053

5154
//#then
55+
expect(result).toHaveProperty("websearch")
5256
expect(result).not.toHaveProperty("context7")
5357
expect(result).toHaveProperty("grep_app")
54-
expect(Object.keys(result)).toHaveLength(1)
58+
expect(Object.keys(result)).toHaveLength(2)
5559
})
5660

5761
test("should handle empty disabled_mcps by default", () => {
@@ -60,9 +64,10 @@ describe("createBuiltinMcps", () => {
6064
const result = createBuiltinMcps()
6165

6266
//#then
67+
expect(result).toHaveProperty("websearch")
6368
expect(result).toHaveProperty("context7")
6469
expect(result).toHaveProperty("grep_app")
65-
expect(Object.keys(result)).toHaveLength(2)
70+
expect(Object.keys(result)).toHaveLength(3)
6671
})
6772

6873
test("should only filter built-in MCPs, ignoring unknown names", () => {
@@ -73,8 +78,9 @@ describe("createBuiltinMcps", () => {
7378
const result = createBuiltinMcps(disabledMcps)
7479

7580
//#then
81+
expect(result).toHaveProperty("websearch")
7682
expect(result).toHaveProperty("context7")
7783
expect(result).toHaveProperty("grep_app")
78-
expect(Object.keys(result)).toHaveLength(2)
84+
expect(Object.keys(result)).toHaveLength(3)
7985
})
8086
})

0 commit comments

Comments
 (0)