MCP Tool Best Practice: Always create Lightning-compatible Salesforce apps by default

Resolved 💬 2 comments Opened Nov 23, 2025 by CharlesCage Closed Nov 23, 2025

Problem

When creating Salesforce custom applications via MCP tools, the default behavior creates Classic apps which don't appear in the Lightning Experience App Launcher, even when profile visibility is correctly configured.

What Happened

Created a custom Salesforce app using mcp__salesforce-metadata__create_app but it didn't show up in the user's App Launcher despite:

  • ✅ App being created successfully
  • ✅ Profile visibility set to "Visible"
  • ✅ Tabs existing and configured
  • ✅ Page refreshed multiple times

Root Cause: The app was created without formFactors specified, making it a Classic app. Lightning Experience requires formFactors: ["Large"] to display the app in the App Launcher.

Fix Applied:

mcp__salesforce-metadata__update_metadata(
    metadataType="CustomApplication",
    fullName="Pet_Adoption", 
    updates={"formFactors": ["Large"]}
)

Proposed Solution

Update Claude's Salesforce MCP guidance to always create Lightning-compatible apps by default unless:

  1. Specifically working with existing Classic apps/components
  2. The use case requires Classic-only features
  3. User explicitly requests Classic app

Implementation

Update the following locations:

  1. packages/metadata-mcp/CLAUDE.md - Add best practice section:

```markdown
## Salesforce App Best Practices

ALWAYS create Lightning-compatible apps by default:

  • Include formFactors: ["Large"] when creating apps
  • Classic apps don't appear in Lightning Experience App Launcher
  • Only use Classic when explicitly required

```

  1. mcp__salesforce-metadata__create_app tool implementation - Update default parameters to include Lightning form factors
  1. System prompts/guidelines - Add reminder about Lightning vs Classic distinction

Code Example

Current (problematic):

create_app(
    appName="My_App",
    label="My App",
    tabs=[...]
)
# Results in Classic app - invisible in Lightning!

Correct (Lightning-compatible):

# Option 1: Update create_app to include formFactors by default
create_app(
    appName="My_App",
    label="My App", 
    tabs=[...],
    formFactors=["Large"]  # ← Add this!
)

# Option 2: If create_app doesn't support formFactors, follow up with update
update_metadata(
    metadataType="CustomApplication",
    fullName="My_App",
    updates={"formFactors": ["Large"]}
)

User Impact

High - This is a common gotcha that wastes significant time:

  • App appears created but isn't visible
  • Multiple troubleshooting attempts (profile settings, refresh, etc.)
  • Requires deep Salesforce knowledge to diagnose

Related

Labels

enhancement, salesforce, mcp, documentation, best-practice

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗