@youdotcom-oss/mcp 2.0.7 → 2.0.8

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.
package/bin/stdio.js CHANGED
@@ -6498,7 +6498,7 @@ var require_dist = __commonJS((exports, module) => {
6498
6498
  exports.default = formatsPlugin;
6499
6499
  });
6500
6500
 
6501
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6501
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
6502
6502
  import process3 from "node:process";
6503
6503
 
6504
6504
  // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
@@ -20034,7 +20034,7 @@ function date4(params) {
20034
20034
  // ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
20035
20035
  config(en_default());
20036
20036
 
20037
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
20037
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
20038
20038
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
20039
20039
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
20040
20040
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
@@ -20876,7 +20876,7 @@ class UrlElicitationRequiredError extends McpError {
20876
20876
  }
20877
20877
  }
20878
20878
 
20879
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
20879
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
20880
20880
  class ReadBuffer {
20881
20881
  append(chunk) {
20882
20882
  this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
@@ -20906,7 +20906,7 @@ function serializeMessage(message) {
20906
20906
  `;
20907
20907
  }
20908
20908
 
20909
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
20909
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
20910
20910
  class StdioServerTransport {
20911
20911
  constructor(_stdin = process3.stdin, _stdout = process3.stdout) {
20912
20912
  this._stdin = _stdin;
@@ -21256,23 +21256,18 @@ var fetchSearchResults = async ({
21256
21256
  } else if (errorCode === 402) {
21257
21257
  let errorMessage = "Free tier limit exceeded. Please upgrade to continue.";
21258
21258
  let upgradeUrl = "https://you.com/platform";
21259
- try {
21260
- const json2 = await response.json();
21261
- const parseResult = ApiErrorResponseSchema.safeParse(json2);
21262
- if (parseResult.success) {
21263
- const errorBody = parseResult.data;
21264
- if (errorBody.message) {
21265
- errorMessage = errorBody.message;
21266
- }
21267
- if (errorBody.upgrade_url) {
21268
- upgradeUrl = errorBody.upgrade_url;
21269
- }
21270
- if (errorBody.reset_at) {
21271
- const resetDate = new Date(errorBody.reset_at).toLocaleDateString();
21272
- errorMessage += ` Limit resets on ${resetDate}.`;
21273
- }
21274
- }
21275
- } catch {}
21259
+ const json2 = await response.json();
21260
+ const errorBody = ApiErrorResponseSchema.parse(json2);
21261
+ if (errorBody.message) {
21262
+ errorMessage = errorBody.message;
21263
+ }
21264
+ if (errorBody.upgrade_url) {
21265
+ upgradeUrl = errorBody.upgrade_url;
21266
+ }
21267
+ if (errorBody.reset_at) {
21268
+ const resetDate = new Date(errorBody.reset_at).toLocaleDateString();
21269
+ errorMessage += ` Limit resets on ${resetDate}.`;
21270
+ }
21276
21271
  throw new Error(`${errorMessage} Upgrade at: ${upgradeUrl}`);
21277
21272
  }
21278
21273
  throw new Error(`Failed to perform search. Error code: ${errorCode}`);
@@ -25320,7 +25315,7 @@ function object2(shape, params) {
25320
25315
  };
25321
25316
  return new ZodMiniObject(def);
25322
25317
  }
25323
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
25318
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
25324
25319
  function isZ4Schema(s) {
25325
25320
  const schema = s;
25326
25321
  return !!schema._zod;
@@ -25464,7 +25459,7 @@ function getLiteralValue(schema) {
25464
25459
  return;
25465
25460
  }
25466
25461
 
25467
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
25462
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
25468
25463
  function isTerminal(status) {
25469
25464
  return status === "completed" || status === "failed" || status === "cancelled";
25470
25465
  }
@@ -26705,7 +26700,7 @@ var zodToJsonSchema = (schema, options) => {
26705
26700
  }
26706
26701
  return combined;
26707
26702
  };
26708
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
26703
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
26709
26704
  function mapMiniTarget(t) {
26710
26705
  if (!t)
26711
26706
  return "draft-7";
@@ -26747,7 +26742,7 @@ function parseWithCompat(schema, data) {
26747
26742
  return result.data;
26748
26743
  }
26749
26744
 
26750
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
26745
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
26751
26746
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
26752
26747
 
26753
26748
  class Protocol {
@@ -27582,7 +27577,7 @@ function mergeCapabilities(base, additional) {
27582
27577
  return result;
27583
27578
  }
27584
27579
 
27585
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
27580
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
27586
27581
  var import_ajv = __toESM(require_ajv(), 1);
27587
27582
  var import_ajv_formats = __toESM(require_dist(), 1);
27588
27583
  function createDefaultAjvInstance() {
@@ -27622,7 +27617,7 @@ class AjvJsonSchemaValidator {
27622
27617
  }
27623
27618
  }
27624
27619
 
27625
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
27620
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
27626
27621
  class ExperimentalServerTasks {
27627
27622
  constructor(_server) {
27628
27623
  this._server = _server;
@@ -27630,6 +27625,62 @@ class ExperimentalServerTasks {
27630
27625
  requestStream(request, resultSchema, options) {
27631
27626
  return this._server.requestStream(request, resultSchema, options);
27632
27627
  }
27628
+ createMessageStream(params, options) {
27629
+ const clientCapabilities = this._server.getClientCapabilities();
27630
+ if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
27631
+ throw new Error("Client does not support sampling tools capability.");
27632
+ }
27633
+ if (params.messages.length > 0) {
27634
+ const lastMessage = params.messages[params.messages.length - 1];
27635
+ const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
27636
+ const hasToolResults = lastContent.some((c) => c.type === "tool_result");
27637
+ const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
27638
+ const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
27639
+ const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
27640
+ if (hasToolResults) {
27641
+ if (lastContent.some((c) => c.type !== "tool_result")) {
27642
+ throw new Error("The last message must contain only tool_result content if any is present");
27643
+ }
27644
+ if (!hasPreviousToolUse) {
27645
+ throw new Error("tool_result blocks are not matching any tool_use from the previous message");
27646
+ }
27647
+ }
27648
+ if (hasPreviousToolUse) {
27649
+ const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
27650
+ const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
27651
+ if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
27652
+ throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
27653
+ }
27654
+ }
27655
+ }
27656
+ return this.requestStream({
27657
+ method: "sampling/createMessage",
27658
+ params
27659
+ }, CreateMessageResultSchema, options);
27660
+ }
27661
+ elicitInputStream(params, options) {
27662
+ const clientCapabilities = this._server.getClientCapabilities();
27663
+ const mode = params.mode ?? "form";
27664
+ switch (mode) {
27665
+ case "url": {
27666
+ if (!clientCapabilities?.elicitation?.url) {
27667
+ throw new Error("Client does not support url elicitation.");
27668
+ }
27669
+ break;
27670
+ }
27671
+ case "form": {
27672
+ if (!clientCapabilities?.elicitation?.form) {
27673
+ throw new Error("Client does not support form elicitation.");
27674
+ }
27675
+ break;
27676
+ }
27677
+ }
27678
+ const normalizedParams = mode === "form" && params.mode === undefined ? { ...params, mode: "form" } : params;
27679
+ return this.requestStream({
27680
+ method: "elicitation/create",
27681
+ params: normalizedParams
27682
+ }, ElicitResultSchema, options);
27683
+ }
27633
27684
  async getTask(taskId, options) {
27634
27685
  return this._server.getTask({ taskId }, options);
27635
27686
  }
@@ -27644,7 +27695,7 @@ class ExperimentalServerTasks {
27644
27695
  }
27645
27696
  }
27646
27697
 
27647
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
27698
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
27648
27699
  function assertToolsCallTaskCapability(requests, method, entityName) {
27649
27700
  if (!requests) {
27650
27701
  throw new Error(`${entityName} does not support task creation (required for ${method})`);
@@ -27679,7 +27730,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
27679
27730
  }
27680
27731
  }
27681
27732
 
27682
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
27733
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
27683
27734
  class Server extends Protocol {
27684
27735
  constructor(_serverInfo, options) {
27685
27736
  super(options);
@@ -28012,7 +28063,7 @@ class Server extends Protocol {
28012
28063
  }
28013
28064
  }
28014
28065
 
28015
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
28066
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
28016
28067
  var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
28017
28068
  function isCompletable(schema) {
28018
28069
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
@@ -28026,7 +28077,7 @@ var McpZodTypeKind;
28026
28077
  McpZodTypeKind2["Completable"] = "McpCompletable";
28027
28078
  })(McpZodTypeKind || (McpZodTypeKind = {}));
28028
28079
 
28029
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
28080
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
28030
28081
  var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
28031
28082
  function validateToolName(name) {
28032
28083
  const warnings = [];
@@ -28084,7 +28135,7 @@ function validateAndWarnToolName(name) {
28084
28135
  return result.isValid;
28085
28136
  }
28086
28137
 
28087
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
28138
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
28088
28139
  class ExperimentalMcpServerTasks {
28089
28140
  constructor(_mcpServer) {
28090
28141
  this._mcpServer = _mcpServer;
@@ -28099,7 +28150,7 @@ class ExperimentalMcpServerTasks {
28099
28150
  }
28100
28151
  }
28101
28152
 
28102
- // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
28153
+ // ../../node_modules/.bun/@modelcontextprotocol+sdk@1.27.0+702d06f8eea47248/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
28103
28154
  class McpServer {
28104
28155
  constructor(serverInfo, options) {
28105
28156
  this._registeredResources = {};
@@ -28821,7 +28872,7 @@ var EMPTY_COMPLETION_RESULT = {
28821
28872
  // package.json
28822
28873
  var package_default = {
28823
28874
  name: "@youdotcom-oss/mcp",
28824
- version: "2.0.7",
28875
+ version: "2.0.8",
28825
28876
  description: "You.com API Model Context Protocol Server - For programmatic API access, use @youdotcom-oss/api",
28826
28877
  license: "MIT",
28827
28878
  engines: {
@@ -28877,7 +28928,7 @@ var package_default = {
28877
28928
  },
28878
28929
  mcpName: "io.github.youdotcom-oss/mcp",
28879
28930
  dependencies: {
28880
- "@youdotcom-oss/api": "0.3.3",
28931
+ "@youdotcom-oss/api": "0.3.4",
28881
28932
  zod: "^4.3.6",
28882
28933
  "@hono/mcp": "^0.2.3",
28883
28934
  "@modelcontextprotocol/sdk": "^1.25.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdotcom-oss/mcp",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "You.com API Model Context Protocol Server - For programmatic API access, use @youdotcom-oss/api",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "mcpName": "io.github.youdotcom-oss/mcp",
58
58
  "dependencies": {
59
- "@youdotcom-oss/api": "0.3.3",
59
+ "@youdotcom-oss/api": "0.3.4",
60
60
  "zod": "^4.3.6",
61
61
  "@hono/mcp": "^0.2.3",
62
62
  "@modelcontextprotocol/sdk": "^1.25.3",
@@ -8,7 +8,7 @@ import type { SearchStructuredContent } from '../search/search.schema.ts'
8
8
  let client: Client
9
9
 
10
10
  beforeAll(async () => {
11
- await $`bun run build` // 1256
11
+ await $`bun run build`
12
12
  const transport = new StdioClientTransport({
13
13
  command: 'npx',
14
14
  args: [Bun.resolveSync('../../bin/stdio', import.meta.dir)],
@@ -23,7 +23,7 @@ beforeAll(async () => {
23
23
  })
24
24
 
25
25
  await client.connect(transport)
26
- })
26
+ }, 30_000)
27
27
 
28
28
  afterAll(async () => {
29
29
  await client.close()