@mindstone/mcp-server-salesforce 0.2.1 → 0.2.2
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 +1 -1
- package/dist/bridge.d.ts +6 -1
- package/dist/bridge.js +7 -2
- package/dist/tools/auth-tools.js +6 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.js +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Salesforce CRM MCP server — accounts, contacts, opportunities, leads, tasks, u
|
|
|
9
9
|
|
|
10
10
|
## Status
|
|
11
11
|
|
|
12
|
-
- **Version:** [0.2.
|
|
12
|
+
- **Version:** [0.2.2](./CHANGELOG.md) · [npm](https://www.npmjs.com/package/@mindstone/mcp-server-salesforce)
|
|
13
13
|
- **Auth:** OAuth (local 127.0.0.1 callback) or static access token ([`SALESFORCE_CLIENT_SECRET`](./server.json), [`SALESFORCE_ACCESS_TOKEN`](./server.json))
|
|
14
14
|
- **Tools:** [37](./src/tools/) (accounts, contacts, opportunities, leads, tasks, cases, events, search, notes, campaigns, reports, query)
|
|
15
15
|
- **Surface:** cloud-api
|
package/dist/bridge.d.ts
CHANGED
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
export declare const BRIDGE_STATE_PATH: string;
|
|
5
5
|
/**
|
|
6
6
|
* Send a request to the host app bridge.
|
|
7
|
+
*
|
|
8
|
+
* `timeoutMs` defaults to the ordinary per-call budget (REQUEST_TIMEOUT_MS);
|
|
9
|
+
* callers that trigger long host-side flows (e.g. interactive OAuth) can opt
|
|
10
|
+
* into a longer one. The abort itself is never removed — only widened — so a
|
|
11
|
+
* dead bridge still fails within the chosen bound.
|
|
7
12
|
*/
|
|
8
|
-
export declare const bridgeRequest: (urlPath: string, body?: Record<string, unknown
|
|
13
|
+
export declare const bridgeRequest: (urlPath: string, body?: Record<string, unknown>, timeoutMs?: number) => Promise<{
|
|
9
14
|
success: boolean;
|
|
10
15
|
username?: string;
|
|
11
16
|
warning?: string;
|
package/dist/bridge.js
CHANGED
|
@@ -17,15 +17,20 @@ const loadBridgeState = () => {
|
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Send a request to the host app bridge.
|
|
20
|
+
*
|
|
21
|
+
* `timeoutMs` defaults to the ordinary per-call budget (REQUEST_TIMEOUT_MS);
|
|
22
|
+
* callers that trigger long host-side flows (e.g. interactive OAuth) can opt
|
|
23
|
+
* into a longer one. The abort itself is never removed — only widened — so a
|
|
24
|
+
* dead bridge still fails within the chosen bound.
|
|
20
25
|
*/
|
|
21
|
-
export const bridgeRequest = async (urlPath, body = {}) => {
|
|
26
|
+
export const bridgeRequest = async (urlPath, body = {}, timeoutMs = REQUEST_TIMEOUT_MS) => {
|
|
22
27
|
const bridge = loadBridgeState();
|
|
23
28
|
if (!bridge) {
|
|
24
29
|
return { success: false, error: 'Bridge not available' };
|
|
25
30
|
}
|
|
26
31
|
const response = await fetch(`http://127.0.0.1:${bridge.port}${urlPath}`, {
|
|
27
32
|
method: 'POST',
|
|
28
|
-
signal: AbortSignal.timeout(
|
|
33
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
29
34
|
headers: {
|
|
30
35
|
'Content-Type': 'application/json',
|
|
31
36
|
Authorization: `Bearer ${bridge.token}`,
|
package/dist/tools/auth-tools.js
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { withErrorHandling, sanitizeExternalData } from '../utils.js';
|
|
4
4
|
import { getAuthMode, loadToken, startStandaloneOAuth } from '../auth.js';
|
|
5
5
|
import { bridgeRequest } from '../bridge.js';
|
|
6
|
+
import { BRIDGE_OAUTH_TIMEOUT_MS } from '../types.js';
|
|
6
7
|
import { listConnectedAccounts, removeAccount } from '../client.js';
|
|
7
8
|
// Disconnect needs a raw handle the model can copy verbatim into
|
|
8
9
|
// salesforce_disconnect_account, but the storage id is username-derived
|
|
@@ -50,7 +51,11 @@ After connecting, verify with salesforce_list_connected_accounts.`,
|
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
if (mode === 'bridge') {
|
|
53
|
-
|
|
54
|
+
// The host holds this response open until the user completes the
|
|
55
|
+
// interactive OAuth flow in their browser (up to 5 minutes), so this
|
|
56
|
+
// call needs the long budget — the default 30s abort would kill the
|
|
57
|
+
// connect mid-flow while the human is still signing in.
|
|
58
|
+
const result = await bridgeRequest(process.env.MCP_BRIDGE_CONFIGURE_ENDPOINT || '/mcp/configure', {}, BRIDGE_OAUTH_TIMEOUT_MS);
|
|
54
59
|
if (result.success) {
|
|
55
60
|
// The bridge username is host/org-authored external text: envelope
|
|
56
61
|
// it before it reaches model-visible output (AGENTS.md invariant #6).
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const REQUEST_TIMEOUT_MS = 30000;
|
|
2
|
+
/**
|
|
3
|
+
* Bridge budget for the OAuth-initiating `/mcp/configure` call. The host
|
|
4
|
+
* holds that HTTP response open until the user finishes the interactive
|
|
5
|
+
* browser sign-in — both the host's own OAuth flow and this connector's
|
|
6
|
+
* standalone flow cap the wait at 5 minutes. The ordinary 30s
|
|
7
|
+
* REQUEST_TIMEOUT_MS therefore aborts mid-flow on any human-paced connect
|
|
8
|
+
* and reports a spurious failure. 5 minutes + 30s slack for the host's
|
|
9
|
+
* post-auth work (token exchange, config write, reload) — deliberately
|
|
10
|
+
* bounded so a genuinely dead bridge still fails instead of hanging forever.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BRIDGE_OAUTH_TIMEOUT_MS: number;
|
|
2
13
|
export declare const SERVER_NAME = "salesforce-mcp-server";
|
|
3
14
|
/**
|
|
4
15
|
* Salesforce REST API version the connector pins every request to. Pinned
|
package/dist/types.js
CHANGED
|
@@ -2,6 +2,17 @@ import { createRequire } from 'node:module';
|
|
|
2
2
|
const require = createRequire(import.meta.url);
|
|
3
3
|
const pkg = require('../package.json');
|
|
4
4
|
export const REQUEST_TIMEOUT_MS = 30_000;
|
|
5
|
+
/**
|
|
6
|
+
* Bridge budget for the OAuth-initiating `/mcp/configure` call. The host
|
|
7
|
+
* holds that HTTP response open until the user finishes the interactive
|
|
8
|
+
* browser sign-in — both the host's own OAuth flow and this connector's
|
|
9
|
+
* standalone flow cap the wait at 5 minutes. The ordinary 30s
|
|
10
|
+
* REQUEST_TIMEOUT_MS therefore aborts mid-flow on any human-paced connect
|
|
11
|
+
* and reports a spurious failure. 5 minutes + 30s slack for the host's
|
|
12
|
+
* post-auth work (token exchange, config write, reload) — deliberately
|
|
13
|
+
* bounded so a genuinely dead bridge still fails instead of hanging forever.
|
|
14
|
+
*/
|
|
15
|
+
export const BRIDGE_OAUTH_TIMEOUT_MS = 5 * 60 * 1000 + REQUEST_TIMEOUT_MS;
|
|
5
16
|
export const SERVER_NAME = 'salesforce-mcp-server';
|
|
6
17
|
/**
|
|
7
18
|
* Salesforce REST API version the connector pins every request to. Pinned
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-salesforce",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-salesforce",
|
|
5
5
|
"description": "Salesforce CRM MCP server — accounts, contacts, opportunities, leads, tasks, and custom objects via Salesforce API",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|