https://github.com/mshaaban0/contentful-delivery-mcp
Contentful MCP Server for Delivery API
https://github.com/mshaaban0/contentful-delivery-mcp
Last synced: 4 months ago
JSON representation
Contentful MCP Server for Delivery API
- Host: GitHub
- URL: https://github.com/mshaaban0/contentful-delivery-mcp
- Owner: mshaaban0
- Created: 2025-02-20T19:04:43.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T21:57:42.000Z (4 months ago)
- Last Synced: 2025-02-20T22:24:33.275Z (4 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- mcp-index - Contentful Delivery MCP Server - Provides access to Contentful's Delivery API to query and retrieve content entries, assets, and content types using natural language. It enables management of text notes and generation of summaries based on retrieved content. (Content Creation)
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.
## Quick Start
Install the package in your project:
```bash
npm install @mshaaban0/contentful-delivery-mcp-server
```Or globally:
```bash
npm install -g @mshaaban0/contentful-delivery-mcp-server
```Set up your Contentful credentials:
```bash
export CONTENTFUL_SPACE_ID="your_space_id"
export CONTENTFUL_ACCESS_TOKEN="your_access_token"
```## 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](https://mastra.ai) provides seamless integration with this MCP server. Here's how to set it up:
```typescript
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"
}
}
});// 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
```bash
# 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:
```bash
npm run inspector
```Visit the provided URL to access the debugging tools.
## Resources
- [Mastra AI Documentation](https://mastra.ai/docs)
- [Contentful API Reference](https://www.contentful.com/developers/docs/references/)
- [MCP Specification](https://github.com/anthropic-labs/model-context-protocol)## License
MIT