Add You.com MCP setup template to mcp-bridge
- commit
- 69857c27c80b60210773f6c7e92a3b8326f0e865
- author
- mouse-value-add · · 2026-09-02 09:33 UTC
- parent
- fdc6643
- signature
- unsigned
3 files · +64 -0
M examples/extensions/mcp-bridge/README.md +25 -0
| @@ -211,6 +211,31 @@ Standard MCP config — same as Claude Desktop, with zot-specific extensions: | |||
| 211 | 211 | "context7": { | |
| 212 | 212 | "command": "npx", | |
| 213 | 213 | "args": ["-y", "@upstash/context7-mcp@latest"] | |
| 214 | + | }, | |
| 215 | + | ||
| 216 | + | // You.com web search (streamable-http, keyless) | |
| 217 | + | "you": { | |
| 218 | + | "transport": "streamable-http", | |
| 219 | + | "url": "https://api.you.com/mcp?profile=free" | |
| 220 | + | } | |
| 221 | + | } | |
| 222 | + | } | |
| 223 | + | ``` | |
| 224 | + | ||
| 225 | + | ### You.com template | |
| 226 | + | ||
| 227 | + | `/mcp setup add you` registers the keyless You.com MCP profile | |
| 228 | + | (`you-search`). It needs no account or API key. To move to the | |
| 229 | + | authenticated server with the full You.com tool set, edit | |
| 230 | + | `$ZOT_HOME/mcp.json` after adding the template: | |
| 231 | + | ||
| 232 | + | ```jsonc | |
| 233 | + | { | |
| 234 | + | "you": { | |
| 235 | + | "transport": "streamable-http", | |
| 236 | + | "url": "https://api.you.com/mcp", | |
| 237 | + | "headers": { | |
| 238 | + | "Authorization": "Bearer YOUR_YDC_API_KEY" | |
| 214 | 239 | } | |
| 215 | 240 | } | |
| 216 | 241 | } | |
| @@ -211,6 +211,31 @@ Standard MCP config — same as Claude Desktop, with zot-specific extensions: | |||||
| 211 | "context7": { | 211 | "context7": { | ||
| 212 | "command": "npx", | 212 | "command": "npx", | ||
| 213 | "args": ["-y", "@upstash/context7-mcp@latest"] | 213 | "args": ["-y", "@upstash/context7-mcp@latest"] | ||
| 214 | + | }, | |||
| 215 | + | ||||
| 216 | + | // You.com web search (streamable-http, keyless) | |||
| 217 | + | "you": { | |||
| 218 | + | "transport": "streamable-http", | |||
| 219 | + | "url": "https://api.you.com/mcp?profile=free" | |||
| 220 | + | } | |||
| 221 | + | } | |||
| 222 | + | } | |||
| 223 | + | ``` | |||
| 224 | + | ||||
| 225 | + | ### You.com template | |||
| 226 | + | ||||
| 227 | + | `/mcp setup add you` registers the keyless You.com MCP profile | |||
| 228 | + | (`you-search`). It needs no account or API key. To move to the | |||
| 229 | + | authenticated server with the full You.com tool set, edit | |||
| 230 | + | `$ZOT_HOME/mcp.json` after adding the template: | |||
| 231 | + | ||||
| 232 | + | ```jsonc | |||
| 233 | + | { | |||
| 234 | + | "you": { | |||
| 235 | + | "transport": "streamable-http", | |||
| 236 | + | "url": "https://api.you.com/mcp", | |||
| 237 | + | "headers": { | |||
| 238 | + | "Authorization": "Bearer YOUR_YDC_API_KEY" | |||
| 214 | } | 239 | } | ||
| 215 | } | 240 | } | ||
| 216 | } | 241 | } | ||
M examples/extensions/mcp-bridge/setup.go +10 -0
| @@ -62,6 +62,16 @@ func setupTemplates() map[string]serverTemplate { | |||
| 62 | 62 | } | |
| 63 | 63 | }, | |
| 64 | 64 | }, | |
| 65 | + | "you": { | |
| 66 | + | Name: "you", | |
| 67 | + | Description: "Current web search via the keyless You.com MCP server (you-search). Add an Authorization Bearer header with a YDC_API_KEY for the full tool set.", | |
| 68 | + | Config: func(cwd string) ServerConfig { | |
| 69 | + | return ServerConfig{ | |
| 70 | + | Transport: "streamable-http", | |
| 71 | + | URL: "https://api.you.com/mcp?profile=free", | |
| 72 | + | } | |
| 73 | + | }, | |
| 74 | + | }, | |
| 65 | 75 | } | |
| 66 | 76 | } | |
| 67 | 77 | ||
| @@ -62,6 +62,16 @@ func setupTemplates() map[string]serverTemplate { | |||||
| 62 | } | 62 | } | ||
| 63 | }, | 63 | }, | ||
| 64 | }, | 64 | }, | ||
| 65 | + | "you": { | |||
| 66 | + | Name: "you", | |||
| 67 | + | Description: "Current web search via the keyless You.com MCP server (you-search). Add an Authorization Bearer header with a YDC_API_KEY for the full tool set.", | |||
| 68 | + | Config: func(cwd string) ServerConfig { | |||
| 69 | + | return ServerConfig{ | |||
| 70 | + | Transport: "streamable-http", | |||
| 71 | + | URL: "https://api.you.com/mcp?profile=free", | |||
| 72 | + | } | |||
| 73 | + | }, | |||
| 74 | + | }, | |||
| 65 | } | 75 | } | ||
| 66 | } | 76 | } | ||
| 67 | 77 | ||||
M examples/extensions/mcp-bridge/setup_test.go +29 -0
| @@ -58,6 +58,35 @@ func TestHandleSetupAddFilesystemProject(t *testing.T) { | |||
| 58 | 58 | } | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | + | func TestHandleSetupAddYouGlobal(t *testing.T) { | |
| 62 | + | tmp := t.TempDir() | |
| 63 | + | t.Setenv("ZOT_HOME", tmp) | |
| 64 | + | ||
| 65 | + | out, err := handleSetup([]string{"add", "you"}, tmp) | |
| 66 | + | if err != nil { | |
| 67 | + | t.Fatalf("handleSetup add you: %v", err) | |
| 68 | + | } | |
| 69 | + | if out == "" { | |
| 70 | + | t.Fatal("expected setup output") | |
| 71 | + | } | |
| 72 | + | ||
| 73 | + | data, err := os.ReadFile(filepath.Join(tmp, "mcp.json")) | |
| 74 | + | if err != nil { | |
| 75 | + | t.Fatalf("read mcp.json: %v", err) | |
| 76 | + | } | |
| 77 | + | var cfg Config | |
| 78 | + | if err := json.Unmarshal(data, &cfg); err != nil { | |
| 79 | + | t.Fatalf("parse mcp.json: %v", err) | |
| 80 | + | } | |
| 81 | + | you := cfg.MCPServers["you"] | |
| 82 | + | if you.Transport != "streamable-http" || you.URL != "https://api.you.com/mcp?profile=free" { | |
| 83 | + | t.Fatalf("unexpected you config: %+v", you) | |
| 84 | + | } | |
| 85 | + | if len(you.Headers) != 0 { | |
| 86 | + | t.Fatalf("keyless template must not write auth headers: %+v", you.Headers) | |
| 87 | + | } | |
| 88 | + | } | |
| 89 | + | ||
| 61 | 90 | func TestHandleSetupDuplicate(t *testing.T) { | |
| 62 | 91 | tmp := t.TempDir() | |
| 63 | 92 | t.Setenv("ZOT_HOME", tmp) | |
| @@ -58,6 +58,35 @@ func TestHandleSetupAddFilesystemProject(t *testing.T) { | |||||
| 58 | } | 58 | } | ||
| 59 | } | 59 | } | ||
| 60 | 60 | ||||
| 61 | + | func TestHandleSetupAddYouGlobal(t *testing.T) { | |||
| 62 | + | tmp := t.TempDir() | |||
| 63 | + | t.Setenv("ZOT_HOME", tmp) | |||
| 64 | + | ||||
| 65 | + | out, err := handleSetup([]string{"add", "you"}, tmp) | |||
| 66 | + | if err != nil { | |||
| 67 | + | t.Fatalf("handleSetup add you: %v", err) | |||
| 68 | + | } | |||
| 69 | + | if out == "" { | |||
| 70 | + | t.Fatal("expected setup output") | |||
| 71 | + | } | |||
| 72 | + | ||||
| 73 | + | data, err := os.ReadFile(filepath.Join(tmp, "mcp.json")) | |||
| 74 | + | if err != nil { | |||
| 75 | + | t.Fatalf("read mcp.json: %v", err) | |||
| 76 | + | } | |||
| 77 | + | var cfg Config | |||
| 78 | + | if err := json.Unmarshal(data, &cfg); err != nil { | |||
| 79 | + | t.Fatalf("parse mcp.json: %v", err) | |||
| 80 | + | } | |||
| 81 | + | you := cfg.MCPServers["you"] | |||
| 82 | + | if you.Transport != "streamable-http" || you.URL != "https://api.you.com/mcp?profile=free" { | |||
| 83 | + | t.Fatalf("unexpected you config: %+v", you) | |||
| 84 | + | } | |||
| 85 | + | if len(you.Headers) != 0 { | |||
| 86 | + | t.Fatalf("keyless template must not write auth headers: %+v", you.Headers) | |||
| 87 | + | } | |||
| 88 | + | } | |||
| 89 | + | ||||
| 61 | func TestHandleSetupDuplicate(t *testing.T) { | 90 | func TestHandleSetupDuplicate(t *testing.T) { | ||
| 62 | tmp := t.TempDir() | 91 | tmp := t.TempDir() | ||
| 63 | t.Setenv("ZOT_HOME", tmp) | 92 | t.Setenv("ZOT_HOME", tmp) | ||