Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AIFire in da houseCheck it out free

contentful-delivery-mcp

MCP.Pizza Chef: mshaaban0

The Contentful Delivery MCP Server provides a seamless interface for AI assistants to query and retrieve content from Contentful's Delivery API. It supports natural language queries to access entries, assets, and content types, enabling dynamic content retrieval within AI workflows. This server simplifies integration with Contentful by exposing structured content data in real-time to LLMs, facilitating content-driven applications and AI-enhanced content management.

Use This MCP server To

Query Contentful entries using natural language Retrieve content assets by ID or type Filter content by specific content types Integrate Contentful content into AI chatbots Enable dynamic content fetching in AI workflows Support content-driven application development Automate content retrieval for marketing tools Provide real-time content access for virtual assistants

README

Contentful Delivery MCP Server

A Model Context Protocol (MCP) server that provides seamless access to Contentful's Delivery API through AI assistants. Query and retrieve content entries, assets, and content types using natural language.

Contentful Delivery Server MCP server

Quick Start

Install the package in your project:

npm install @mshaaban0/contentful-delivery-mcp-server

Or globally:

npm install -g @mshaaban0/contentful-delivery-mcp-server

Set up your Contentful credentials:

export CONTENTFUL_SPACE_ID="your_space_id"
export CONTENTFUL_ACCESS_TOKEN="your_access_token"
# Optional: Restrict content to specific content types
export CONTENTFUL_CONTENT_TYPE_IDS="blogPost,article,product"

Features

  • Natural language queries to search content
  • Retrieve entries by ID or content type
  • Asset management
  • Content type schema access
  • Pagination support
  • Rich text content handling

Available Tools

  • query_entries - Natural language search across all content
  • get_entry - Fetch specific entry by ID
  • get_entries - List entries with filtering
  • get_assets - Browse all assets
  • get_asset - Get asset details by ID
  • get_content_type - View content type schema
  • get_content_types - List available content types

Integration with Mastra AI

Mastra AI provides seamless integration with this MCP server. Here's how to set it up:

import { MastraMCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";

// Initialize the MCP client
const contentfulClient = new MastraMCPClient({
  name: "contentful-delivery",
  server: {
    command: "npx",
    args: ["-y", "@mshaaban0/contentful-delivery-mcp-server@latest"],
    env: {
      CONTENTFUL_ACCESS_TOKEN: "your_access_token",
      CONTENTFUL_SPACE_ID: "your_space_id",
      // Optional: Restrict content to specific content types
      CONTENTFUL_CONTENT_TYPE_IDS: "blogPost,article,product"
    }
  }
});

// Create an AI agent with access to Contentful
const assistant = new Agent({
  name: "Content Assistant",
  instructions: `
    You are a helpful assistant with access to our content database.
    Use the available tools to find and provide accurate information.
  `,
  model: "gpt-4",
});

// Connect and register tools
await contentfulClient.connect();
const tools = await contentfulClient.tools();
assistant.__setTools(tools);

// Example usage
const response = await assistant.chat("Find articles about machine learning");

Development

# Clone the repo
git clone https://github.com/mshaaban0/contentful-delivery-mcp-server.git

# Install dependencies
npm install

# Build
npm run build

# Development with auto-rebuild
npm run watch

# Run the inspector
npm run inspector

Debugging

The MCP Inspector provides a web interface for debugging:

npm run inspector

Visit the provided URL to access the debugging tools.

Resources

Security Audits

MseeP.ai Security Assessment Badge

License

MIT

contentful-delivery-mcp FAQ

How do I set up Contentful credentials for this MCP server?
Set environment variables CONTENTFUL_SPACE_ID and CONTENTFUL_ACCESS_TOKEN with your Contentful space ID and access token respectively.
Can I restrict queries to specific content types?
Yes, by setting the CONTENTFUL_CONTENT_TYPE_IDS environment variable with a comma-separated list of content type IDs.
Does this server support natural language queries?
Yes, it allows querying Contentful content using natural language inputs.
How do I install the Contentful Delivery MCP Server?
Install via npm using 'npm install @mshaaban0/contentful-delivery-mcp-server' or globally with '-g' flag.
Is this MCP server compatible with multiple LLM providers?
Yes, it is provider-agnostic and works with OpenAI, Anthropic Claude, and Google Gemini models.
What types of content can I retrieve with this server?
You can retrieve entries, assets, and content types from your Contentful space.
Can this server be used in production environments?
Yes, it is designed for real-time content retrieval suitable for production AI applications.
How does this server handle authentication?
Authentication is managed via Contentful API tokens set as environment variables.