developer-toolsapi_key

Contentful Graphql

The Contentful GraphQL Content API allows developers to query and deliver content using GraphQL, providing a flexible and efficient way to access content stored in Contentful.

Verdict

Contentful GraphQL lets your team query structured content from Contentful spaces without leaving Switchy. @mention it to fetch blog posts, product catalogs, or marketing pages using GraphQL — the MCP handles token management and query execution. Content editors and developers get the most value: editors can preview drafts or check published entries, while developers can prototype queries before pushing to production. You'll need a Contentful API key with read access to your space; write operations aren't supported, so this is strictly for retrieval and inspection.

Common use cases

  • Preview draft content before publishing
  • Audit published entries for missing fields
  • Prototype GraphQL queries during standup
  • Fetch product catalog data for reports
  • Validate content structure across environments

Integration

Vendor
Contentful Graphql
Category
developer-tools
Auth
API_KEY
Tools
3
Composio slug
contentful_graphql

Tools

  • Get CMA Token

    Tool to retrieve a Contentful Management API (CMA) access token. Use when making CMA calls to ensure valid authorization.

  • GraphQL Content API Persisted Query

    Tool to execute a persisted GraphQL query via its SHA256 hash. Use after registering a query hash to run cached queries by hash. On first call include full query text; thereafter invoke with only hash and variables.

  • GraphQL Content API Query

    Tool to execute a GraphQL query against a specified space and environment. Use when fetching Contentful content via GraphQL after obtaining or providing a valid token.

Setup

Setup guide

  1. 11. In Switchy, open your workspace settings and navigate to the MCP integrations panel. 2. Select 'Add MCP' and choose Contentful GraphQL from the developer tools category. 3. You'll be prompted to enter your Contentful Space ID, Environment ID (usually 'master'), and a Content Delivery API access token — find these in your Contentful dashboard under Settings > API keys. 4. Paste the token into the API key field and click 'Connect'. 5. Switchy will validate the credentials and confirm the connection. 6. To test, open any Space and type '@Contentful GraphQL fetch the title and slug of all blog posts' — the MCP will execute a GraphQL query and return results inline. 7. If you see content, you're ready; if authentication fails, double-check the token has read permissions for your environment.

What teammates see: by default, memories from Contentful Graphql are scoped to the Space (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Spaces have used this MCP together with a given model.

How Switchy teams use it

Not enough Spaces yet to publish anonymised usage stats (we require ≥ 50 Spaces per week).

Starter prompts

List Recent Blog Posts

@Contentful GraphQL fetch the title, slug, and publishedDate of the five most recent blog posts, ordered by publishedDate descending.
Open in a Space →

Check Missing Images

@Contentful GraphQL query all product entries and return the title and SKU for any that have a null or missing featuredImage field.
Open in a Space →

Preview Draft Content

@Contentful GraphQL switch to the draft environment and fetch all entries with sys.publishedVersion null, showing title and updatedAt.
Open in a Space →

Audit Content Types

@Contentful GraphQL query the content types in this space and return the name and number of fields for each type.
Open in a Space →

Fetch Localized Entries

@Contentful GraphQL fetch all blog posts in the 'de-DE' locale and return the title and slug for each entry.
Open in a Space →

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@Contentful-Graphql fetch all blog posts published in the last 30 days with their authors and tags

Output

This example would return a GraphQL response containing a collection of blog post entries from your Contentful space. Each entry would include fields like title, publishDate, slug, plus nested author references (name, bio, avatar) and associated tag arrays. The response structure mirrors your content model's schema. In a real query, you'd see 0-N posts depending on your publishing cadence, formatted as JSON with sys metadata and localized field values.

Notes

This demonstrates the GraphQL Content API Query tool's read capabilities. You'll need a valid CMA token (obtained via the Get CMA Token tool first) and must specify your space ID and environment. The query syntax must match your Contentful content model exactly—field names, content type IDs, and reference structures are space-specific. No write permissions required for read-only queries.

Prompt

@Contentful-Graphql register this product search query as a persisted query so our frontend can call it by hash instead of sending the full query text

Output

This example would demonstrate registering a GraphQL query (e.g., a product catalog search with filters) and receiving back a SHA256 hash identifier. On the first call, you'd provide the complete query text—something like filtering products by category, price range, and availability. Contentful would return a hash like 'a3f2b9c8...' that your application can subsequently use to execute the same query without transmitting the full query string, reducing payload size and improving cache efficiency.

Notes

This showcases the GraphQL Content API Persisted Query tool's optimization workflow. Persisted queries improve performance and security by allowing hash-based query execution. After registration, your frontend calls the query by hash alone. Note this is a two-step process: first register with full query text, then execute by hash. Useful for production apps with repeated query patterns, but adds complexity for one-off queries.

Prompt

@Contentful-Graphql pull all landing page entries with their SEO metadata and hero images, then draft a content audit report highlighting pages missing alt text or meta descriptions

Output

This example would first execute a GraphQL query fetching landing page content types with fields for metaTitle, metaDescription, heroImage, and imageAlt. The response might show 15 landing pages, with the AI then analyzing which entries have null or empty SEO fields. The resulting audit report would list pages by title and URL slug, flagging 4 pages missing meta descriptions and 2 with hero images lacking alt text, plus recommendations for remediation prioritized by page traffic or importance.

Notes

This synthesis example combines the MCP's data retrieval with AI reasoning to produce actionable insights. It demonstrates how GraphQL's flexible querying lets you fetch exactly the fields needed for content audits, accessibility reviews, or governance checks. Requires read access to your content model and assumes your schema includes SEO/accessibility fields. The AI interprets the structured data but can't write back fixes—you'd handle updates separately via Contentful's UI or CMA.

Use-case deep-dives

Marketing site content updates

When Contentful GraphQL beats manual CMS checks for content teams

A 5-person marketing team publishes weekly blog posts and landing pages through Contentful. They need to verify live content matches what editors approved before pushing social links. This MCP wins here because the GraphQL Content API Query tool pulls exact published state in seconds—no logging into the CMS, no screenshot comparisons. The persisted query tool speeds up repeated checks (same query, different dates). Trade-off: if your team only updates content monthly, the setup overhead isn't worth it. But for weekly or daily publishing cycles, this MCP turns a 10-minute manual check into a 30-second AI query. Worth the API key if you're publishing more than twice a week.

Customer support content lookup

Why this MCP works for support teams with structured help docs

A 3-person support team answers 40 tickets daily, most requiring links to help articles stored in Contentful. They waste 15 minutes per day searching the CMS for the right doc URL. This MCP is the right call because the GraphQL query tool lets the AI search by title, tag, or keyword and return the live URL instantly. The CMA token tool ensures queries hit the latest published version, not a stale cache. Limitation: if your help docs live across multiple systems (Contentful plus Notion plus Google Docs), this MCP only covers the Contentful slice. But if Contentful is your single source of truth for customer-facing content, this MCP pays back setup time in the first week.

Pre-launch content audit workflow

When Contentful GraphQL handles QA for product launches

A 6-person product team launches a new feature every quarter, requiring coordinated updates across 20+ marketing pages, changelog entries, and FAQ sections in Contentful. Two days before launch, they need to confirm every page references the correct feature name and pricing tier. This MCP is overkill for ad-hoc checks but essential for repeatable launch checklists. The persisted query tool caches the audit query (search all pages for feature name, return mismatches), so the same check runs in under 10 seconds each launch cycle. If your launches happen less than quarterly, manual spot-checks are faster. But for teams shipping monthly or faster, this MCP turns a 2-hour manual audit into a 5-minute AI-driven report.

Frequently asked

What does the Contentful GraphQL MCP do in Switchy?

It lets AI agents query your Contentful spaces using GraphQL, retrieve CMA tokens for management operations, and run persisted queries by hash. Useful when you want agents to fetch published content, draft entries, or metadata without writing REST calls. The MCP handles token refresh and query caching so your prompts stay clean.

Do I need a Contentful Management API key or just a Delivery key?

You need a CMA personal access token or OAuth token—the MCP explicitly retrieves CMA tokens for authorization. Delivery API keys won't work because the tools expect management-level access. Generate a PAT in your Contentful account settings under API keys, then paste it into Switchy's API_KEY field during setup.

Can this MCP write or update content in Contentful?

No. The three tools are read-only: they execute GraphQL queries and fetch tokens. If you need to create entries, publish drafts, or modify assets, you'll have to use Contentful's REST Management API directly or build a custom MCP that wraps those endpoints. This integration is purely for querying existing content.

Why use this instead of calling Contentful's GraphQL API myself?

The MCP abstracts token management and persisted-query registration, so your agent prompts don't need to handle OAuth refresh or SHA256 hashing. If you're already comfortable scripting those flows, the raw API is more flexible. If you want agents to query content without boilerplate, the MCP saves setup time.

Who on the team should connect the Contentful GraphQL MCP?

Whoever owns your Contentful organization's API tokens—usually a developer or content ops lead. They'll need permission to generate a CMA token with read access to the spaces your agents will query. Non-technical editors don't need to touch this; they'll just see the results in Switchy conversations.

Data last verified 607 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.