MCP Tool Best Practice: Always create Lightning-compatible Salesforce apps by default
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:
- Specifically working with existing Classic apps/components
- The use case requires Classic-only features
- User explicitly requests Classic app
Implementation
Update the following locations:
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
```
mcp__salesforce-metadata__create_apptool implementation - Update default parameters to include Lightning form factors
- 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
- Salesforce formFactors documentation: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_customapplication.htm
- Lightning Experience vs Classic differences
Labels
enhancement, salesforce, mcp, documentation, best-practice
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗