@salesforce/mcp 0.17.2-dev.2 → 0.18.0

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/lib/index.d.ts CHANGED
@@ -4,11 +4,12 @@ export default class McpServerCommand extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
6
  orgs: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
7
- toolsets: import("@oclif/core/interfaces").OptionFlag<(import("@salesforce/mcp-provider-api/src/toolset.js").Toolset | "all")[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ toolsets: import("@oclif/core/interfaces").OptionFlag<(import("@salesforce/mcp-provider-api/src/enums.js").Toolset | "all")[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  version: import("@oclif/core/interfaces").BooleanFlag<void>;
9
9
  'no-telemetry': import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  'dynamic-tools': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ 'allow-non-ga-tools': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  };
13
14
  static examples: {
14
15
  description: string;
package/lib/index.js CHANGED
@@ -92,6 +92,9 @@ You can also use special values to control access to orgs:
92
92
  char: 'd',
93
93
  exclusive: ['toolsets'],
94
94
  }),
95
+ 'allow-non-ga-tools': Flags.boolean({
96
+ summary: 'Enable the ability to register tools that are not yet generally available (GA)',
97
+ }),
95
98
  };
96
99
  static examples = [
97
100
  {
@@ -106,6 +109,10 @@ You can also use special values to control access to orgs:
106
109
  description: 'Allow access to 3 specific orgs and enable all toolsets',
107
110
  command: '<%= config.bin %> --orgs test-org@example.com,my-dev-hub,my-alias',
108
111
  },
112
+ {
113
+ description: 'Allow tools that are not generally available (GA) to be registered with the server',
114
+ command: '<%= config.bin %> --orgs DEFAULT_TARGET_ORG --allow-non-ga-tools',
115
+ },
109
116
  ];
110
117
  telemetry;
111
118
  async run() {
@@ -135,7 +142,7 @@ You can also use special values to control access to orgs:
135
142
  });
136
143
  await maybeBuildIndex(this.config.dataDir);
137
144
  const services = new Services({ telemetry: this.telemetry, dataDir: this.config.dataDir });
138
- await registerToolsets(flags.toolsets ?? ['all'], flags['dynamic-tools'] ?? false, server, services);
145
+ await registerToolsets(flags.toolsets ?? ['all'], flags['dynamic-tools'] ?? false, flags['allow-non-ga-tools'] ?? false, server, services);
139
146
  const transport = new StdioServerTransport();
140
147
  await server.connect(transport);
141
148
  console.error(`✅ Salesforce MCP Server v${this.config.version} running on stdio`);
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { McpTool, McpToolConfig, Toolset } from '@salesforce/mcp-provider-api';
2
+ import { McpTool, McpToolConfig, ReleaseState, Toolset } from '@salesforce/mcp-provider-api';
3
3
  import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
4
4
  import { SfMcpServer } from '../sf-mcp-server.js';
5
5
  declare const enableToolsParamsSchema: z.ZodObject<{
@@ -15,6 +15,7 @@ type OutputArgsShapeType = z.ZodRawShape;
15
15
  export declare class EnableToolsMcpTool extends McpTool<InputArgsShapeType, OutputArgsShapeType> {
16
16
  private readonly server;
17
17
  constructor(server: SfMcpServer);
18
+ getReleaseState(): ReleaseState;
18
19
  getToolsets(): Toolset[];
19
20
  getName(): string;
20
21
  getConfig(): McpToolConfig<InputArgsShapeType, OutputArgsShapeType>;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { z } from 'zod';
17
- import { McpTool, Toolset } from '@salesforce/mcp-provider-api';
17
+ import { McpTool, ReleaseState, Toolset } from '@salesforce/mcp-provider-api';
18
18
  import { enableTools as utilEnableTools } from '../utils/tools.js';
19
19
  const enableToolsParamsSchema = z.object({
20
20
  tools: z.array(z.string()).describe('The names of the tools to enable'),
@@ -25,6 +25,9 @@ export class EnableToolsMcpTool extends McpTool {
25
25
  super();
26
26
  this.server = server;
27
27
  }
28
+ getReleaseState() {
29
+ return ReleaseState.GA;
30
+ }
28
31
  getToolsets() {
29
32
  return [Toolset.CORE];
30
33
  }
@@ -1,7 +1,8 @@
1
- import { McpTool, McpToolConfig, Toolset } from '@salesforce/mcp-provider-api';
1
+ import { McpTool, McpToolConfig, ReleaseState, Toolset } from '@salesforce/mcp-provider-api';
2
2
  import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
3
3
  export declare class ListToolsMcpTool extends McpTool {
4
4
  getToolsets(): Toolset[];
5
+ getReleaseState(): ReleaseState;
5
6
  getName(): string;
6
7
  getConfig(): McpToolConfig;
7
8
  exec(): Promise<CallToolResult>;
@@ -13,12 +13,15 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { McpTool, Toolset } from '@salesforce/mcp-provider-api';
16
+ import { McpTool, ReleaseState, Toolset } from '@salesforce/mcp-provider-api';
17
17
  import { listAllTools } from '../utils/tools.js';
18
18
  export class ListToolsMcpTool extends McpTool {
19
19
  getToolsets() {
20
20
  return [Toolset.CORE];
21
21
  }
22
+ getReleaseState() {
23
+ return ReleaseState.GA;
24
+ }
22
25
  getName() {
23
26
  return 'sf-list-tools';
24
27
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { McpTool, McpToolConfig, Toolset, Services } from '@salesforce/mcp-provider-api';
2
+ import { McpTool, McpToolConfig, Toolset, Services, ReleaseState } from '@salesforce/mcp-provider-api';
3
3
  import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
4
4
  /**
5
5
  * Suggest a Salesforce CLI (sf) command based on user input.
@@ -17,6 +17,7 @@ type OutputArgsShape = z.ZodRawShape;
17
17
  export declare class SuggestCliCommandMcpTool extends McpTool<InputArgsShape, OutputArgsShape> {
18
18
  private readonly services;
19
19
  constructor(services: Services);
20
+ getReleaseState(): ReleaseState;
20
21
  getToolsets(): Toolset[];
21
22
  getName(): string;
22
23
  getConfig(): McpToolConfig<InputArgsShape, OutputArgsShape>;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { z } from 'zod';
17
- import { McpTool, Toolset } from '@salesforce/mcp-provider-api';
17
+ import { McpTool, Toolset, ReleaseState } from '@salesforce/mcp-provider-api';
18
18
  import { getAssets } from '../utils/assets.js';
19
19
  /**
20
20
  * Suggest a Salesforce CLI (sf) command based on user input.
@@ -28,6 +28,9 @@ export class SuggestCliCommandMcpTool extends McpTool {
28
28
  super();
29
29
  this.services = services;
30
30
  }
31
+ getReleaseState() {
32
+ return ReleaseState.GA;
33
+ }
31
34
  getToolsets() {
32
35
  return [Toolset.CORE];
33
36
  }
@@ -1,4 +1,4 @@
1
1
  import { Toolset } from '@salesforce/mcp-provider-api';
2
2
  import { SfMcpServer } from '../sf-mcp-server.js';
3
3
  import { Services } from '../services.js';
4
- export declare function registerToolsets(toolsets: Array<Toolset | 'all'>, useDynamicTools: boolean, server: SfMcpServer, services: Services): Promise<void>;
4
+ export declare function registerToolsets(toolsets: Array<Toolset | 'all'>, useDynamicTools: boolean, allowNonGaTools: boolean, server: SfMcpServer, services: Services): Promise<void>;
@@ -14,42 +14,49 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ux } from '@oclif/core';
17
- import { MCP_PROVIDER_API_VERSION, Toolset, TOOLSETS, } from '@salesforce/mcp-provider-api';
17
+ import { MCP_PROVIDER_API_VERSION, ReleaseState, Toolset, TOOLSETS, } from '@salesforce/mcp-provider-api';
18
18
  import { MCP_PROVIDER_REGISTRY } from '../registry.js';
19
19
  import { addTool } from '../utils/tools.js';
20
20
  import { createDynamicServerTools } from '../main-server-provider.js';
21
- export async function registerToolsets(toolsets, useDynamicTools, server, services) {
21
+ export async function registerToolsets(toolsets, useDynamicTools, allowNonGaTools, server, services) {
22
22
  if (useDynamicTools) {
23
23
  const dynamicTools = createDynamicServerTools(server);
24
- ux.stderr('Registering dynamic tools');
24
+ ux.stderr('Registering dynamic tools.');
25
25
  // eslint-disable-next-line no-await-in-loop
26
- await registerTools(dynamicTools, server, useDynamicTools);
26
+ await registerTools(dynamicTools, server, useDynamicTools, allowNonGaTools);
27
27
  }
28
28
  else {
29
- ux.stderr('Skipping registration of dynamic tools');
29
+ ux.stderr('Skipping registration of dynamic tools.');
30
30
  }
31
31
  const toolsetsToEnable = toolsets.includes('all')
32
- ? new Set(TOOLSETS.filter((ts) => ts !== Toolset.EXPERIMENTAL))
33
- : new Set([Toolset.CORE, ...toolsets]);
32
+ ? new Set(TOOLSETS) : new Set([Toolset.CORE, ...toolsets]);
34
33
  const newToolRegistry = await createToolRegistryFromProviders(MCP_PROVIDER_REGISTRY, services);
35
34
  for (const toolset of TOOLSETS) {
36
35
  if (toolsetsToEnable.has(toolset)) {
37
- ux.stderr(`Registering ${toolset} tools`);
36
+ ux.stderr(`Registering tools from the '${toolset}' toolset.`);
38
37
  // eslint-disable-next-line no-await-in-loop
39
- await registerTools(newToolRegistry[toolset], server, useDynamicTools);
38
+ await registerTools(newToolRegistry[toolset], server, useDynamicTools, allowNonGaTools);
40
39
  }
41
40
  else {
42
- ux.stderr(`Skipping registration of ${toolset} tools`);
41
+ ux.stderr(`Skipping registration of the tools from the '${toolset}' toolset.`);
43
42
  }
44
43
  }
45
44
  }
46
- async function registerTools(tools, server, useDynamicTools) {
45
+ async function registerTools(tools, server, useDynamicTools, allowNonGaTools) {
47
46
  for (const tool of tools) {
47
+ if (!allowNonGaTools && tool.getReleaseState() === ReleaseState.NON_GA) {
48
+ ux.stderr(`* Skipping registration of non-ga tool '${tool.getName()}' because the '--allow-non-ga-tools' flag was not set at server startup.`);
49
+ continue;
50
+ }
48
51
  const registeredTool = server.registerTool(tool.getName(), tool.getConfig(), (...args) => tool.exec(...args));
49
52
  const toolsets = tool.getToolsets();
50
53
  if (useDynamicTools && !toolsets.includes(Toolset.CORE)) {
54
+ ux.stderr(`* Registering tool '${tool.getName()}' but marking it as disabled for now because the server is set for dynamic tool loading.`);
51
55
  registeredTool.disable();
52
56
  }
57
+ else {
58
+ ux.stderr(`* Registering tool '${tool.getName()}'.`);
59
+ }
53
60
  // eslint-disable-next-line no-await-in-loop
54
61
  await addTool(registeredTool, tool.getName());
55
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/mcp",
3
- "version": "0.17.2-dev.2",
3
+ "version": "0.18.0",
4
4
  "description": "MCP Server for interacting with Salesforce instances",
5
5
  "bin": {
6
6
  "sf-mcp-server": "bin/run.js"
@@ -49,9 +49,9 @@
49
49
  "@salesforce/apex-node": "^8.2.1",
50
50
  "@salesforce/core": "^8.18.0",
51
51
  "@salesforce/kit": "^3.1.6",
52
- "@salesforce/mcp-provider-api": "^0.1.0",
53
- "@salesforce/mcp-provider-dx-core": "^0.1.2",
54
- "@salesforce/mcp-provider-code-analyzer": "^0.0.1",
52
+ "@salesforce/mcp-provider-api": "0.2.0",
53
+ "@salesforce/mcp-provider-dx-core": "0.2.0",
54
+ "@salesforce/mcp-provider-code-analyzer": "0.0.2",
55
55
  "@salesforce/source-deploy-retrieve": "^12.22.0",
56
56
  "@salesforce/source-tracking": "^7.4.8",
57
57
  "@salesforce/telemetry": "^6.1.0",