@mcp-use/client 2.0.2-canary.2 → 2.1.0-canary.4

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/dist/index.js CHANGED
@@ -1219,7 +1219,7 @@ init_connector_telemetry();
1219
1219
  init_logging();
1220
1220
 
1221
1221
  // src/utils/version.ts
1222
- var VERSION = "2.0.2-canary.2";
1222
+ var VERSION = "2.1.0-canary.4";
1223
1223
  function getPackageVersion() {
1224
1224
  return VERSION;
1225
1225
  }
@@ -2840,8 +2840,8 @@ async function createOAuthProvider(serverUrl, options = {}) {
2840
2840
  }
2841
2841
 
2842
2842
  // src/transport/http.ts
2843
- init_logging();
2844
2843
  init_json_schema_validator();
2844
+ init_logging();
2845
2845
  init_base();
2846
2846
  import {
2847
2847
  Client,
@@ -2995,7 +2995,7 @@ var HttpConnector = class extends BaseConnector {
2995
2995
  is401Error = status === 401;
2996
2996
  httpStatusCode = status;
2997
2997
  if (status === 400 && streamableErr.message.includes("Missing session ID")) {
2998
- fallbackReason = "Server requires session ID (FastMCP compatibility)";
2998
+ fallbackReason = "Server requires session ID";
2999
2999
  logger.warn(`\u26A0\uFE0F ${fallbackReason}`);
3000
3000
  } else if (status === 404 || status === 405) {
3001
3001
  fallbackReason = `Server returned ${status} - server likely doesn't support streamable HTTP`;
@@ -3011,7 +3011,7 @@ var HttpConnector = class extends BaseConnector {
3011
3011
  const errorMsg = err.message || "";
3012
3012
  is401Error = detectUnauthorized(err) || errorStr.includes("401") || errorMsg.includes("Unauthorized");
3013
3013
  if (errorStr.includes("Missing session ID") || errorStr.includes("Bad Request: Missing session ID") || errorMsg.includes("FastMCP session ID error")) {
3014
- fallbackReason = "Server requires session ID (FastMCP compatibility)";
3014
+ fallbackReason = "Server requires session ID";
3015
3015
  logger.warn(`\u26A0\uFE0F ${fallbackReason}`);
3016
3016
  } else if (errorStr.includes("405 Method Not Allowed") || errorStr.includes("404 Not Found")) {
3017
3017
  fallbackReason = "Server doesn't support streamable HTTP (405/404)";
@@ -3406,6 +3406,9 @@ import path from "path";
3406
3406
  // src/core/base.ts
3407
3407
  init_logging();
3408
3408
 
3409
+ // src/core/skills.ts
3410
+ var SKILLS_EXTENSION_ID = "io.modelcontextprotocol/skills";
3411
+
3409
3412
  // src/core/session.ts
3410
3413
  var MCPConnection = class {
3411
3414
  /**
@@ -3851,6 +3854,48 @@ var MCPConnection = class {
3851
3854
  async request(method, params = null, options) {
3852
3855
  return this.connector.request(method, params, options);
3853
3856
  }
3857
+ /** List one page of skills advertised through the experimental extension. */
3858
+ async listSkills(cursor, options) {
3859
+ return await this.request(
3860
+ "skills/list",
3861
+ cursor === void 0 ? {} : { cursor },
3862
+ options
3863
+ );
3864
+ }
3865
+ /** List the complete skill catalog, following pagination defensively. */
3866
+ async listAllSkills(options) {
3867
+ const skills = [];
3868
+ const seenCursors = /* @__PURE__ */ new Set();
3869
+ let cursor;
3870
+ do {
3871
+ const page = await this.listSkills(cursor, options);
3872
+ skills.push(...Array.isArray(page.skills) ? page.skills : []);
3873
+ cursor = page.nextCursor;
3874
+ if (cursor !== void 0) {
3875
+ if (seenCursors.has(cursor)) {
3876
+ throw new Error("skills/list returned a repeated pagination cursor");
3877
+ }
3878
+ seenCursors.add(cursor);
3879
+ }
3880
+ } while (cursor !== void 0);
3881
+ return { skills };
3882
+ }
3883
+ /** Get one skill by its canonical `SKILL.md` URI. */
3884
+ async getSkill(uri, options) {
3885
+ return await this.request(
3886
+ "skills/get",
3887
+ { uri },
3888
+ options
3889
+ );
3890
+ }
3891
+ /** Read one non-recursive skill directory. */
3892
+ async readResourceDirectory(uri, cursor, options) {
3893
+ return await this.request(
3894
+ "resources/directory/read",
3895
+ cursor === void 0 ? { uri } : { uri, cursor },
3896
+ options
3897
+ );
3898
+ }
3854
3899
  };
3855
3900
 
3856
3901
  // src/core/base.ts
@@ -5755,6 +5800,7 @@ export {
5755
5800
  OAuthFlowError,
5756
5801
  POSTHOG_API_KEY,
5757
5802
  POSTHOG_HOST,
5803
+ SKILLS_EXTENSION_ID,
5758
5804
  StdioConnectionManager,
5759
5805
  StdioConnector,
5760
5806
  Tel,