Setup
- Go to Project Settings → Project Integrations
- Select Contentful from the list
- Enter your credentials:
- Content Management API (CMA) Token - Your Contentful CMA token
- Get it from Contentful CMA Tokens
- Content Management API (CMA) Token - Your Contentful CMA token
- Test the connection
- Start using Contentful in your prompts
How It Works
HelloLeo uses the Contentful MCP (Model Context Protocol) to interact with your Contentful space. Your CMA token is encrypted and stored securely on the backend.Environment Variables
When you configure Contentful, the following environment variables are automatically set up:VITE_CONTENTFUL_SPACE_ID- Your Contentful space IDVITE_CONTENTFUL_ACCESS_TOKEN- Your Contentful access token
Common Operations
With Contentful integration, you can:- Manage entries - Create, read, update, and delete content entries
- Handle assets - Upload, manage, and retrieve media assets
- Work with content types - Access and modify content type definitions
- Query content - Search and filter entries using Contentful’s query API
- Publish content - Publish and unpublish entries
Example Usage
Display Entries
Create Entry
Query Content
Update Entry
Manage Assets
Best Practices
- Use environment variables - Reference
VITE_CONTENTFUL_SPACE_IDandVITE_CONTENTFUL_ACCESS_TOKENin your code - Specify content types - Always mention which content type you’re working with (e.g., “blog posts”, “products”)
- Mention the integration - Always say “from Contentful” or “to Contentful” so Leo knows which integration to use
- Content model - Be aware of your content model structure and required fields
Troubleshooting
Connection Issues
- Check CMA token - Verify your Contentful CMA token is correct
- Token permissions - Ensure your token has the necessary permissions
- Space ID - Verify your Contentful space ID is correct
Data Not Showing
- Check content type - Ensure you’re using the correct content type ID or name
- Published status - Verify entries are published (CDA only returns published content)
- Permissions - Check that your CMA token has read access
Can’t Create/Update
- Write permissions - Ensure your CMA token has write permissions
- Required fields - Make sure all required fields are provided
- Content type - Verify the content type exists and is accessible
- Data format - Check that data matches your content type schema
