@youdotcom-oss/mcp 1.3.7 → 1.3.9-next.1

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.
Files changed (33) hide show
  1. package/README.md +2 -0
  2. package/bin/stdio.js +900 -781
  3. package/dist/contents/contents.schemas.d.ts +39 -0
  4. package/dist/contents/contents.utils.d.ts +28 -0
  5. package/dist/contents/register-contents-tool.d.ts +10 -0
  6. package/dist/express/express.schemas.d.ts +56 -0
  7. package/dist/express/express.utils.d.ts +45 -0
  8. package/dist/express/register-express-tool.d.ts +6 -0
  9. package/dist/get-mcp-server.d.ts +2 -0
  10. package/dist/http.d.ts +3 -0
  11. package/{src/utils.ts → dist/main.d.ts} +1 -0
  12. package/dist/search/register-search-tool.d.ts +6 -0
  13. package/dist/search/search.schemas.d.ts +131 -0
  14. package/dist/search/search.utils.d.ts +96 -0
  15. package/dist/shared/api-constants.d.ts +9 -0
  16. package/dist/shared/check-response-for-errors.d.ts +6 -0
  17. package/dist/shared/format-search-results-text.d.ts +19 -0
  18. package/dist/shared/generate-error-report-link.d.ts +9 -0
  19. package/dist/shared/get-logger.d.ts +7 -0
  20. package/dist/shared/use-client-version.d.ts +6 -0
  21. package/dist/stdio.d.ts +2 -0
  22. package/package.json +15 -7
  23. package/src/contents/contents.utils.ts +1 -2
  24. package/src/contents/tests/contents.utils.spec.ts +69 -57
  25. package/src/express/express.utils.ts +2 -4
  26. package/src/express/tests/express.utils.spec.ts +74 -62
  27. package/src/main.ts +9 -0
  28. package/src/search/search.schemas.ts +23 -4
  29. package/src/search/search.utils.ts +3 -2
  30. package/src/search/tests/search.utils.spec.ts +125 -57
  31. package/src/shared/api-constants.ts +10 -0
  32. package/src/tests/http.spec.ts +35 -31
  33. package/src/tests/tool.spec.ts +490 -402
@@ -283,36 +283,40 @@ describe('HTTP MCP Endpoint Basic Functionality', () => {
283
283
  expect(text).toContain('42');
284
284
  });
285
285
 
286
- test('mcp server handles search tool request for latest tech news', async () => {
287
- const response = await fetch(`${baseUrl}/mcp`, {
288
- method: 'POST',
289
- headers: {
290
- 'Content-Type': 'application/json',
291
- Accept: 'application/json, text/event-stream',
292
- Authorization: `Bearer ${testApiKey}`,
293
- },
294
- body: JSON.stringify({
295
- jsonrpc: '2.0',
296
- method: 'tools/call',
297
- id: 100,
298
- params: {
299
- name: 'you-search',
300
- arguments: {
301
- query: 'latest tech news',
302
- count: 3,
303
- },
286
+ test(
287
+ 'mcp server handles search tool request for latest tech news',
288
+ async () => {
289
+ const response = await fetch(`${baseUrl}/mcp`, {
290
+ method: 'POST',
291
+ headers: {
292
+ 'Content-Type': 'application/json',
293
+ Accept: 'application/json, text/event-stream',
294
+ Authorization: `Bearer ${testApiKey}`,
304
295
  },
305
- }),
306
- });
307
-
308
- expect(response.status).toBe(200);
309
- expect(response.headers.get('content-type')).toContain('text/event-stream');
310
-
311
- const text = await response.text();
312
- expect(text).toContain('data:');
313
- expect(text).toContain('jsonrpc');
314
- expect(text).toContain('result');
315
- expect(text).toContain('latest tech news');
316
- expect(text).toContain('Search Results for');
317
- });
296
+ body: JSON.stringify({
297
+ jsonrpc: '2.0',
298
+ method: 'tools/call',
299
+ id: 100,
300
+ params: {
301
+ name: 'you-search',
302
+ arguments: {
303
+ query: 'latest tech news',
304
+ count: 3,
305
+ },
306
+ },
307
+ }),
308
+ });
309
+
310
+ expect(response.status).toBe(200);
311
+ expect(response.headers.get('content-type')).toContain('text/event-stream');
312
+
313
+ const text = await response.text();
314
+ expect(text).toContain('data:');
315
+ expect(text).toContain('jsonrpc');
316
+ expect(text).toContain('result');
317
+ expect(text).toContain('latest tech news');
318
+ expect(text).toContain('Search Results for');
319
+ },
320
+ { retry: 2 },
321
+ );
318
322
  });