# Contentful Graphql — how to use (mcp.ai)

Connect your Contentful Graphql account and use 2 tools for developer tools straight from your AI agent. Connect with your own API key. 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.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_contentful_graphql?ms=1787295960000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `contentful_graphql_get_cma_token`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/contentful_graphql`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/contentful_graphql/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/contentful_graphql/get/cma/token` — Tool to retrieve a Contentful Management API (CMA) access token. Use when making CMA calls to ensure valid authorization.
- `POST https://api.mcp.ai/api/contentful_graphql/graph/ql/content/api/persisted/query` — Execute a GraphQL query using Automatic Persisted Queries (APQ). APQ reduces bandwidth by sending only a SHA256 hash instead of the full query text after initial registration. Workflow: 1. First reque
  - body: { query?: string, version?: integer, space_id: string, variables?: object, sha256_hash: string, access_token?: string, environment_id: string }

## Example prompts
- "What can I do in Contentful Graphql?"
- "Show me a summary of my Contentful Graphql account"

## More
- Page: https://mcp.ai/contentful_graphql
- Agent spec (llms.txt): https://mcp.ai/contentful_graphql/llms.txt
- Postman collection: https://mcp.ai/contentful_graphql/postman.json
