forcedotcom/sf-skills / skills/experience-app-mcp-delivery-generate
experience-app-mcp-delivery-generate
VerifiedPackage and deliver an existing Salesforce hosted MCP server/App MCP for an Experience Site as an MCP configuration file or a Claude plugin repository. Discover the serving URL and External Client Application client ID, generate client configuration, optionally bundle skills in a plugin, and provide local testing and private GitHub handoff instructions. Plugin packaging supports Claude only; reject requests for Codex, ChatGPT, or other plugin platforms. Use for connecting clients and packaging delivery, not for creating or activating the Salesforce MCP server.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.5 KB |
| references/eca-consumer-key.md | markdown | 2.1 KB |
| references/mcp-config-delivery.md | markdown | 2.6 KB |
| references/plugin-format-and-publishing.md | markdown | 8.5 KB |
| scripts/developer_name.mjs | script | 464 B |
| scripts/discover_mcp_context.mjsexecutable | script | 6.0 KB |
| scripts/generate_mcp_config.mjsexecutable | script | 1.5 KB |
| scripts/generate_plugin.mjsexecutable | script | 10.8 KB |
| scripts/mcp_config.mjs | script | 3.9 KB |
| scripts/preflight.mjsexecutable | script | 5.0 KB |
| scripts/retrieve_eca_consumer_key.mjsexecutable | script | 5.1 KB |
scripts/mcp_config.mjs
View on GitHub// Connection validation shared by standalone configuration and plugin delivery.
function need(condition, message) { if (!condition) throw new Error(message); }
function text(value, name) { need(typeof value === "string" && value.trim(), `${name} must be a non-empty string`); return value.trim(); }
// Org environment → route segment between the domain token and the site.
const ENVIRONMENT_SEGMENTS = { production: "", developer: "develop", sandbox: "sandbox", scratch: "scratch" };
function checkDomain(domain, environment) {
need(/^[a-z0-9]+(?:[a-z0-9.-]*[a-z0-9])?$/.test(domain) && !domain.includes(".."), "domain must be the routing domain token, not a URL or full instance hostname");
need(!domain.endsWith("salesforce.com"), "Use the routing domain token, not the full Salesforce hostname");
need(!domain.includes("."), `${environment} domain must not contain dots`);
if (environment === "sandbox") need(/^[a-z0-9-]+--[a-z0-9]+$/.test(domain), "sandbox domain must be {my-domain}--{sandbox-name}");
else need(!domain.includes("--"), `${environment} domain must not contain a sandbox suffix`);
}
function mcpUrl(mcp) {
need(mcp.sitePrefix === undefined, "mcp.sitePrefix is no longer supported; supply the exact site developer name as mcp.siteDeveloperName");
if (mcp.url) {
need(!mcp.domain && !mcp.environment && mcp.siteDeveloperName === undefined, "Supply a verified URL or route components, not both");
const url = new URL(mcp.url);
need(url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash, "MCP URL must use HTTPS without credentials, query, or fragment");
return url.href;
}
const environment = text(mcp.environment, "mcp.environment");
need(Object.hasOwn(ENVIRONMENT_SEGMENTS, environment), `mcp.environment must be one of: ${Object.keys(ENVIRONMENT_SEGMENTS).join(", ")}`);
const domain = text(mcp.domain, "mcp.domain");
checkDomain(domain, environment);
const siteDeveloperName = text(mcp.siteDeveloperName, "mcp.siteDeveloperName");
need(/^[A-Za-z0-9_-]+$/.test(siteDeveloperName), "siteDeveloperName must be the exact site developer name without slashes");
const name = text(mcp.mcpName, "mcp.mcpName");
need(/^[A-Za-z][A-Za-z0-9_]*$/.test(name), "mcpName must be the exact server DeveloperName");
const segment = ENVIRONMENT_SEGMENTS[environment];
return `https://api.salesforce.com/platform/mcp/v1/p/${encodeURIComponent(domain)}/${segment ? `${segment}/` : ""}${encodeURIComponent(siteDeveloperName)}/custom/${encodeURIComponent(name)}`;
}
export function createMcpConfig(config) {
need(config.mcp && typeof config.mcp === "object", "mcp configuration is required");
const serverKey = text(config.mcp.serverName, "mcp.serverName");
need(/^[A-Za-z0-9_-]+$/.test(serverKey), "mcp.serverName must contain letters, numbers, underscores, or hyphens");
const clientId = text(config.mcp.clientId, "mcp.clientId");
need(!/[\s<>]/.test(clientId), "Use the actual ECA consumer key as clientId, not a placeholder or ECA record ID");
need(clientId !== config.mcp.ecaId, "clientId must be the ECA consumer key, not its record ID");
const url = mcpUrl(config.mcp);
// Custom client conventions must be explicitly selected, not inferred from submission.
const authStyle = config.authStyle ?? "claude-code";
need(["requested", "claude-code"].includes(authStyle), "authStyle must be requested or claude-code");
const server = { type: "http", url };
if (authStyle === "requested") server.auth = { CLIENT_ID: clientId };
else server.oauth = { clientId };
if (config.mcp.callbackPort !== undefined) {
need(authStyle === "claude-code", "mcp.callbackPort requires the claude-code OAuth profile");
const port = config.mcp.callbackPort;
need(Number.isInteger(port) && port >= 1 && port <= 65535, "mcp.callbackPort must be a JSON integer from 1 through 65535; omit it when skipped");
server.oauth.callbackPort = port;
}
return { mcpServers: { [serverKey]: server } };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |