Federated content platform
## Hygraph MCP Server: Federated Content Platform The **Hygraph MCP Server** integrates Hygraph (formerly GraphCMS) into Google Antigravity, enabling federated content management with GraphQL APIs, content federation, and remote sources directly from your development environment. ### Why Hygraph MCP? - **Content Federation**: Federate content from multiple sources into a unified API - **Native GraphQL**: Purpose-built GraphQL API with advanced filtering and mutations - **Remote Sources**: Integrate external APIs as first-class content sources - **Schema Builder**: Visual schema builder with custom validations - **Granular Permissions**: Field-level permissions and API access controls ### Key Features #### 1. GraphQL Queries ```python # Query content result = await mcp.query(""" query GetPosts($category: String!) { posts(where: { category: $category }, orderBy: createdAt_DESC, first: 10) { id title slug excerpt author { name avatar { url } } coverImage { url(transformation: { image: { resize: { width: 800 }}}) } } } """, variables={"category": "technology"}) for post in result["posts"]: print(f"Post: {post['title']}") ``` #### 2. Content Mutations ```python # Create content result = await mcp.mutate(""" mutation CreatePost($data: PostCreateInput!) { createPost(data: $data) { id title slug } } """, variables={ "data": { "title": "New Article", "slug": "new-article", "content": {"markdown": "Article content..."}, "author": {"connect": {"id": "author_123"}} } }) # Publish content await mcp.mutate(""" mutation PublishPost($id: ID!) { publishPost(where: { id: $id }) { id stage } } """, variables={"id": result["createPost"]["id"]}) ``` #### 3. Asset Management ```python # Upload asset asset = await mcp.upload_asset( file_path="./images/cover.jpg" ) # Create asset record await mcp.mutate(""" mutation CreateAsset($url: String!) { createAsset(data: { uploadUrl: $url }) { id url fileName } } """, variables={"url": asset["url"]}) ``` #### 4. Schema Introspection ```python # Get schema types schema = await mcp.introspect() for type in schema["types"]: if type["kind"] == "OBJECT": print(f"Type: {type['name']}") for field in type.get("fields", []): print(f" - {field['name']}: {field['type']['name']}") ``` ### Configuration ```json { "mcpServers": { "hygraph": { "command": "npx", "args": ["-y", "@anthropic/mcp-hygraph"], "env": { "HYGRAPH_ENDPOINT": "https://api.hygraph.com/v2/project/master", "HYGRAPH_TOKEN": "your-api-token", "HYGRAPH_STAGE": "PUBLISHED" } } } } ``` ### Use Cases **Unified Content API**: Federate content from multiple CMSs into a single GraphQL endpoint. **E-commerce Content**: Combine product data from commerce platforms with marketing content. **Developer Portals**: Build documentation sites with related API references and examples. **Media Publishers**: Manage articles, authors, categories, and related content with rich relationships. The Hygraph MCP enables federated content management within your development environment.
{
"mcpServers": {
"hygraph": {
"mcpServers": {
"hygraph": {
"env": {
"HYGRAPH_TOKEN": "your-token",
"HYGRAPH_ENDPOINT": "your-endpoint"
},
"args": [
"-y",
"hygraph-mcp-server"
],
"command": "npx"
}
}
}
}
}