MCP Support (BETA)
What is MCP?
MCP (Model Context Protocol) is a standardized protocol that allows AI agents to interact with Playground in a structured, safe way. Instead of manually creating plays step-by-step, you can now ask an AI agent to generate plays from your requirements, significantly reducing the time needed to create new Salesforce components.
Think of it as having an AI assistant that:
- Searches for existing similar plays to prevent duplicates
- Help generates professional titles and descriptions
- Help writing Salesforce component code in the correct deployment structure
- Handles file uploads reliably
- Keeps you in control with approval workflows
Key Capabilities
1. Smart Duplicate Detection (mandatory first step)
Before anything is created, Playground MCP searches for related plays and returns every match with its title, details and a direct link. The agent must show these to you and wait for your decision — use or fork an existing play, or confirm you want a new one — before it does anything else. This prevents duplicate work and encourages collaboration across your team.
2. Suggested Play Metadata
Playground MCP suggests:
- Professional titles - Multiple suggestions based on your requirements
- Descriptions - Rich, formatted descriptions stored on Playground as HTML; the agent shows you a clean, plain-text version so you never see raw HTML tags
- No manual typing needed
3. User Approval Workflow
You remain in full control:
- Review all generated titles and descriptions
- Amend them as needed
- Explicitly approve before proceeding
4. Naming Convention Support
Define how component names should be formatted to match your coding standards:
- Prefix strategy:
ACME_AccountTrigger - Suffix strategy:
AccountTrigger_v2 - Namespace strategy:
acme.AccountTrigger - Custom strategy: Your own naming pattern
5. Code Structure & Templates
The AI agent writes the actual Salesforce code. Playground MCP keeps it correct and deployable:
- Templates - Skeleton files (Apex classes, triggers, metadata XML) with the right API version and TODO placeholders for you and the agent to fill
- Correct SFDX source layout - A
sfdx-project.jsonat the root plus every metadata file underforce-app/main/default/{classes,triggers,flows,...}, each paired with its-meta.xml .playgignore- Best-practice ignore patterns so uploads stay clean
6. Reliable File Upload
Packages are staged through Playground's requestId upload API and the play is created from that staged package, which means:
- Retry-safe uploads (a failed push can be retried without re-uploading from scratch)
- No timeout errors
- Direct compatibility with the Playground backend
Typical Workflow
Step 1: Define Requirements
Start by telling the AI agent what you want to build:
Step 2: Check for Duplicates (mandatory)
Playground MCP searches for existing similar plays and returns each match with its title, details and a link. The agent shows these to you and waits — tell it whether to use/fork an existing play or to create a new one. Nothing else happens until you decide.
Step 3: Review Suggested Metadata
- Title options: "Account Validator", "Phone Validation Engine", etc.
- Description: A rich description, stored on Playground as HTML — the agent shows you a clean plain-text version
- You approve/amend both before proceeding
Step 4: Define Naming Convention
Ensures all components the agent creates follow your organization's standards.
Step 5: Write the Code in the Right Structure
The AI agent writes the components (e.g. ACME_AccountTrigger.trigger, ACME_BusinessLogicHandler.cls) following your naming convention. The MCP server keeps everything in the correct SFDX source layout — a sfdx-project.json at the root and files under force-app/main/default/{classes,triggers,flows,...} (each with its -meta.xml) — returns template skeletons to follow, and provides a .playgignore file so uploads stay clean.
Step 6: Push to Playground
- The package is uploaded and the play is created on Playground
- The play is created as a Draft — pushing does not publish it
- The agent shows you the play's details and a link to open it; from there you can validate and submit it for approval in Playground as usual
Time saved: From 30+ minutes → 2-3 minutes of interactive time
Getting Started
Permissions
MCP access is gated at two levels:
- Domain-level — an admin must enable MCP under Control Panel → Advanced Features.
- Role-level — an admin must enable Use MCP for your role under Control Panel → Roles.
If either is off, requests are declined with:
"MCP access isn't enabled for your account yet. Please contact your system admin to get it turned on."
Setup
Playground uses the MCP OAuth flow to connect. There is no static token to paste into your client's config — the client handles authentication for you. All you need is a single Connect Token, which Playground uses to verify your identity when the authorization screen opens.
- Go to your profile → App Passwords and generate a new app password.
- When MCP is enabled for your domain and role, the same screen shows a Connect Token — click to copy it. This one token bundles your instance URL, nickname, and app password, so you don't have to enter them separately.
- In your MCP client, add the Playground MCP server:Server URL: https://mcp.playg.app/mcpAuthorization: OAuth (handled automatically by the client)
- When the client opens the Playground authorization screen, paste the Connect Token and approve. You'll be redirected back and connected.
For step-by-step guides for a specific agent, see Claude Setup and ChatGPT Setup.
Security Best Practices
- ⚠️ Never share your Connect Token (it contains your credentials)
- ⚠️ Keep your app password private — regenerate if compromised
- ✅ Always use HTTPS (never HTTP)
- ✅ Treat your Connect Token like a password
- ✅ Always copy the token from Profile → App Passwords — don't construct it manually
System Requirements
- Playground 2.0.0 or later
- MCP enabled for your domain (Control Panel → Advanced Features) and role (Control Panel → Roles)
- An AI agent that supports MCP with OAuth (e.g. Claude, ChatGPT)
- Basic knowledge of Salesforce components
Limitations & Known Constraints
What MCP Does NOT Do
- ❌ Deploy to Salesforce orgs (your code is prepared in a deployable structure — deployment is up to you)
- ❌ Generate complex business logic (skeleton code provided; you fill TODO sections)
- ❌ Validate against your existing Salesforce metadata
- ❌ Handle advanced Salesforce patterns (custom objects, permission sets, etc.)
Current Scope
- Supports creating new plays only (not updating existing)
- Single-play creation per workflow
- Tested up to 50MB file sizes
- Requires manual code review before deployment
Best Practices
✅ Do's
- ✅ Review all generated code before using
- ✅ Test thoroughly in sandbox first
- ✅ Use meaningful naming conventions
- ✅ Provide detailed requirements to the AI agent
- ✅ Report issues and provide feedback
- ✅ Keep credentials secure
❌ Don'ts
- ❌ Use generated code directly in production
- ❌ Rely solely on auto-generated descriptions
- ❌ Share credentials or auth tokens
- ❌ Create plays for complex business logic without review
- ❌ Bypass the approval workflow
- ❌ Deploy without testing
Troubleshooting
"No related plays found" when they exist
- Try simpler keywords
- Check user permissions on Playground
- Verify auth credentials are correct
Upload timeout errors
- Reduce file size by using
.playgignore - Check Playground backend status
- Retry the upload
Component naming conflicts
- Use unique prefix/suffix strategy
- Check existing component names in Playground
- Contact support if namespace issues persist
Generated code has TODOs
- This is by design - you provide the business logic
- Review and complete all TODO sections before deployment
- Do NOT use auto-generated code as-is in production
Can't complete the OAuth connection
- Verify MCP is enabled for your domain (Control Panel → Advanced Features) and your role (Control Panel → Roles)
- Confirm your Connect Token was copied from Profile → App Passwords and pasted exactly as-is
- Ensure there are no extra spaces or line breaks in the token
- Try regenerating the app password and copying a fresh Connect Token
FAQ
Q: Is MCP free?
A: Yes, MCP is included with your Playground subscription (Beta).
Q: What agents can connect?
A: Any AI agent supporting MCP with OAuth, including Claude and ChatGPT.
Q: What if generated code has issues?
A: You're responsible for reviewing and testing. Complete all TODO sections and validate in sandbox first.
Q: Can I use this in production?
A: Use at your own risk. We recommend thorough testing before production use.
Q: How do I report issues?
A: Visit the Playground Community to report issues and get support.
Support & Feedback
Report Issues
Visit the Playground Community to:
- Report bugs and issues
- Request features
- Get help with setup
- Share feedback
Provide Feedback
We actively collect feedback on:
- Missing features you need
- Confusing workflows
- Generated code quality
- Documentation gaps
Your input shapes the product roadmap.
Legal Disclaimer
⚠️ BETA FEATURE DISCLAIMER
This MCP Server is provided "AS-IS" in BETA and subject to change without notice. While we test thoroughly, we make no guarantees regarding:
- Availability or uptime
- Absence of bugs or errors
- Compatibility with future versions
- Generated code quality or security
Use at your own risk. You are fully responsible for reviewing, testing, and validating any generated code before use in production.