@sellable/mcp 0.1.447 → 0.1.448

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/README.md CHANGED
@@ -521,9 +521,10 @@ compatibility and as the tested foundation-memory engine.
521
521
 
522
522
  - `list_workspaces` - List accessible workspaces
523
523
  - `get_active_workspace` - Show active workspace selection
524
+ - `get_workspace` - Show workspace members and pending invites
524
525
  - `set_active_workspace` - Set active workspace by ID
525
- - `create_workspace` - Create a new workspace
526
- - `add_teammate` - Invite a teammate
526
+ - `create_workspace` - Create a new workspace and make it active
527
+ - `add_teammate` - Invite a teammate to the active workspace or a provided `workspaceId`
527
528
 
528
529
  ### Campaign Tools (Free)
529
530
 
package/dist/api.d.ts CHANGED
@@ -8,6 +8,9 @@ export interface DownloadToFileResult {
8
8
  contentType: string | null;
9
9
  status: number;
10
10
  }
11
+ export interface ApiRequestOptions {
12
+ workspaceId?: string | null;
13
+ }
11
14
  export declare class SellableApiError extends Error {
12
15
  status: number;
13
16
  body: string;
@@ -19,10 +22,10 @@ export declare class SellableApi {
19
22
  private buildError;
20
23
  private requestResponse;
21
24
  private request;
22
- get<T>(path: string): Promise<T>;
25
+ get<T>(path: string, options?: ApiRequestOptions): Promise<T>;
23
26
  getText(path: string): Promise<string>;
24
27
  downloadToFile(requestPath: string, destinationPath: string): Promise<DownloadToFileResult>;
25
- post<T>(path: string, body?: object): Promise<T>;
28
+ post<T>(path: string, body?: object, options?: ApiRequestOptions): Promise<T>;
26
29
  put<T>(path: string, body?: object): Promise<T>;
27
30
  patch<T>(path: string, body?: object): Promise<T>;
28
31
  delete<T>(path: string): Promise<T>;
package/dist/api.js CHANGED
@@ -35,11 +35,13 @@ export class SellableApi {
35
35
  : undefined;
36
36
  return new SellableApiError(status, errorText, guidance);
37
37
  }
38
- async requestResponse(method, path, body) {
38
+ async requestResponse(method, path, body, options) {
39
39
  // Re-read config on every request so workspace switches take effect immediately
40
40
  const config = getConfig();
41
41
  const url = `${config.apiUrl}${path}`;
42
- const workspaceId = config.activeWorkspaceId || config.workspaceId || null;
42
+ const workspaceId = options && Object.prototype.hasOwnProperty.call(options, "workspaceId")
43
+ ? options.workspaceId
44
+ : config.activeWorkspaceId || config.workspaceId || null;
43
45
  const response = await fetch(url, {
44
46
  method,
45
47
  headers: {
@@ -55,12 +57,12 @@ export class SellableApi {
55
57
  }
56
58
  return response;
57
59
  }
58
- async request(method, path, body) {
59
- const response = await this.requestResponse(method, path, body);
60
+ async request(method, path, body, options) {
61
+ const response = await this.requestResponse(method, path, body, options);
60
62
  return response.json();
61
63
  }
62
- async get(path) {
63
- return this.request("GET", path);
64
+ async get(path, options) {
65
+ return this.request("GET", path, undefined, options);
64
66
  }
65
67
  async getText(path) {
66
68
  const response = await this.requestResponse("GET", path);
@@ -93,8 +95,8 @@ export class SellableApi {
93
95
  }
94
96
  }
95
97
  }
96
- async post(path, body) {
97
- return this.request("POST", path, body);
98
+ async post(path, body, options) {
99
+ return this.request("POST", path, body, options);
98
100
  }
99
101
  async put(path, body) {
100
102
  return this.request("PUT", path, body);
package/dist/index-dev.js CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
package/dist/server.js CHANGED
@@ -50,7 +50,7 @@ import { handleVerifyTableRow } from "./tools/verify-row.js";
50
50
  import { sanitizeWatchUrlsForMcpResult } from "./tools/watch-url-security.js";
51
51
  import { getCampaignWaterfall, setCampaignWaterfallOrder, } from "./tools/waterfalls.js";
52
52
  import { exportWorkspaceCsv } from "./tools/workspace-export.js";
53
- import { addTeammate, createWorkspace, getActiveWorkspace, listWorkspaces, setActiveWorkspace, } from "./tools/workspaces.js";
53
+ import { addTeammate, createWorkspace, getActiveWorkspace, getWorkspace, listWorkspaces, setActiveWorkspace, } from "./tools/workspaces.js";
54
54
  import { checkForUpdates, logUpdateNotice } from "./update-check.js";
55
55
  const server = new Server({
56
56
  name: "sellable-mcp",
@@ -179,6 +179,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
179
179
  case "get_active_workspace":
180
180
  result = getActiveWorkspace();
181
181
  break;
182
+ case "get_workspace":
183
+ result = await getWorkspace(args?.workspaceId);
184
+ break;
182
185
  case "set_active_workspace":
183
186
  result = await setActiveWorkspace(args?.workspaceId, args?.userConfirmed);
184
187
  break;
@@ -7612,6 +7612,25 @@ export declare const allTools: ({
7612
7612
  readonly required: readonly ["waterfallKey", "orderedSlotKeys"];
7613
7613
  readonly additionalProperties: false;
7614
7614
  };
7615
+ } | {
7616
+ name: string;
7617
+ description: string;
7618
+ inputSchema: {
7619
+ type: string;
7620
+ properties: {
7621
+ workspaceId: {
7622
+ type: string;
7623
+ };
7624
+ userConfirmed?: undefined;
7625
+ name?: undefined;
7626
+ email?: undefined;
7627
+ role?: undefined;
7628
+ redirectTo?: undefined;
7629
+ campaignId?: undefined;
7630
+ };
7631
+ required: string[];
7632
+ additionalProperties: boolean;
7633
+ };
7615
7634
  } | {
7616
7635
  name: string;
7617
7636
  description: string;
@@ -7659,6 +7678,9 @@ export declare const allTools: ({
7659
7678
  inputSchema: {
7660
7679
  type: string;
7661
7680
  properties: {
7681
+ workspaceId: {
7682
+ type: string;
7683
+ };
7662
7684
  email: {
7663
7685
  type: string;
7664
7686
  };
@@ -7672,7 +7694,6 @@ export declare const allTools: ({
7672
7694
  campaignId: {
7673
7695
  type: string;
7674
7696
  };
7675
- workspaceId?: undefined;
7676
7697
  userConfirmed?: undefined;
7677
7698
  name?: undefined;
7678
7699
  };
@@ -6,6 +6,32 @@ type WorkspaceSummary = {
6
6
  isDefault: boolean;
7
7
  createdAt: string;
8
8
  };
9
+ type WorkspaceDetails = {
10
+ id: string;
11
+ name: string;
12
+ slug: string;
13
+ credits: number;
14
+ role: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ archivedAt: string | null;
18
+ members: Array<{
19
+ id: string;
20
+ userId: string;
21
+ email: string;
22
+ role: string;
23
+ createdAt: string;
24
+ }>;
25
+ pendingInvites: Array<{
26
+ id: string;
27
+ email: string;
28
+ role: string;
29
+ invitedByEmail: string | null;
30
+ createdAt: string;
31
+ expiresAt: string;
32
+ redirectTo: string | null;
33
+ }>;
34
+ };
9
35
  export declare const workspaceToolDefinitions: ({
10
36
  name: string;
11
37
  description: string;
@@ -23,6 +49,25 @@ export declare const workspaceToolDefinitions: ({
23
49
  required: never[];
24
50
  additionalProperties: boolean;
25
51
  };
52
+ } | {
53
+ name: string;
54
+ description: string;
55
+ inputSchema: {
56
+ type: string;
57
+ properties: {
58
+ workspaceId: {
59
+ type: string;
60
+ };
61
+ userConfirmed?: undefined;
62
+ name?: undefined;
63
+ email?: undefined;
64
+ role?: undefined;
65
+ redirectTo?: undefined;
66
+ campaignId?: undefined;
67
+ };
68
+ required: string[];
69
+ additionalProperties: boolean;
70
+ };
26
71
  } | {
27
72
  name: string;
28
73
  description: string;
@@ -70,6 +115,9 @@ export declare const workspaceToolDefinitions: ({
70
115
  inputSchema: {
71
116
  type: string;
72
117
  properties: {
118
+ workspaceId: {
119
+ type: string;
120
+ };
73
121
  email: {
74
122
  type: string;
75
123
  };
@@ -83,7 +131,6 @@ export declare const workspaceToolDefinitions: ({
83
131
  campaignId: {
84
132
  type: string;
85
133
  };
86
- workspaceId?: undefined;
87
134
  userConfirmed?: undefined;
88
135
  name?: undefined;
89
136
  };
@@ -98,6 +145,9 @@ export declare function getActiveWorkspace(): {
98
145
  activeWorkspaceId: string | null;
99
146
  activeWorkspaceName: string | null;
100
147
  };
148
+ export declare function getWorkspace(workspaceId: string): Promise<{
149
+ workspace: WorkspaceDetails;
150
+ }>;
101
151
  export declare function setActiveWorkspace(workspaceId: string, userConfirmed?: boolean): Promise<{
102
152
  ok: boolean;
103
153
  error: string;
@@ -132,6 +182,7 @@ export declare function createWorkspace(name: string): Promise<{
132
182
  activeWorkspaceId: string;
133
183
  }>;
134
184
  export declare function addTeammate(input: {
185
+ workspaceId?: string;
135
186
  email: string;
136
187
  role?: "ADMIN" | "MEMBER";
137
188
  redirectTo?: string;
@@ -21,6 +21,18 @@ export const workspaceToolDefinitions = [
21
21
  additionalProperties: false,
22
22
  },
23
23
  },
24
+ {
25
+ name: "get_workspace",
26
+ description: "Get details of an accessible workspace including members and pending invites.",
27
+ inputSchema: {
28
+ type: "object",
29
+ properties: {
30
+ workspaceId: { type: "string" },
31
+ },
32
+ required: ["workspaceId"],
33
+ additionalProperties: false,
34
+ },
35
+ },
24
36
  {
25
37
  name: "set_active_workspace",
26
38
  description: "Set active workspace by ID. Only call this when the user explicitly asks to switch workspace.",
@@ -39,7 +51,7 @@ export const workspaceToolDefinitions = [
39
51
  },
40
52
  {
41
53
  name: "create_workspace",
42
- description: "Create a new workspace.",
54
+ description: "Create a new workspace. The authenticated user becomes OWNER and the new workspace becomes active for subsequent active-workspace tools.",
43
55
  inputSchema: {
44
56
  type: "object",
45
57
  properties: {
@@ -51,10 +63,11 @@ export const workspaceToolDefinitions = [
51
63
  },
52
64
  {
53
65
  name: "add_teammate",
54
- description: "Invite a teammate to the active workspace.",
66
+ description: "Invite a teammate to a workspace. Defaults to the active workspace; pass workspaceId to invite to a specific accessible workspace without switching active workspace.",
55
67
  inputSchema: {
56
68
  type: "object",
57
69
  properties: {
70
+ workspaceId: { type: "string" },
58
71
  email: { type: "string" },
59
72
  role: { type: "string", enum: ["ADMIN", "MEMBER"] },
60
73
  redirectTo: { type: "string" },
@@ -77,6 +90,11 @@ export function getActiveWorkspace() {
77
90
  activeWorkspaceName: config.activeWorkspaceName || null,
78
91
  };
79
92
  }
93
+ export async function getWorkspace(workspaceId) {
94
+ const api = getApi();
95
+ const { workspace } = await api.get(`/api/v3/workspaces/${encodeURIComponent(workspaceId)}`);
96
+ return { workspace };
97
+ }
80
98
  export async function setActiveWorkspace(workspaceId, userConfirmed) {
81
99
  const api = getApi();
82
100
  const { workspaces } = await api.get("/api/v3/workspaces");
@@ -126,8 +144,9 @@ export async function createWorkspace(name) {
126
144
  };
127
145
  }
128
146
  export async function addTeammate(input) {
147
+ const args = input || {};
129
148
  const config = getConfig();
130
- const workspaceId = config.activeWorkspaceId || config.workspaceId;
149
+ const workspaceId = args.workspaceId || config.activeWorkspaceId || config.workspaceId;
131
150
  if (!workspaceId) {
132
151
  return {
133
152
  ok: false,
@@ -135,5 +154,6 @@ export async function addTeammate(input) {
135
154
  };
136
155
  }
137
156
  const api = getApi();
138
- return api.post("/api/v3/workspaces/invites", input);
157
+ const { workspaceId: _workspaceId, ...inviteInput } = args;
158
+ return api.post("/api/v3/workspaces/invites", inviteInput, { workspaceId });
139
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.447",
3
+ "version": "0.1.448",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",