DaaS / Products / AI Agent Manages Notion CMS for Vercel Site

AI Agent Manages Notion CMS for Vercel Site

Build a Bailian AI agent that autonomously creates and updates content in Notion via MCP tool calling, with Notion serving as a headless CMS that feeds a Vercel-hosted frontend application — forming a complete AI-driven content pipeline from generation to delivery.

Products involved

Scenario

Use this pipeline when you need an autonomous AI content workflow that generates, structures, and publishes assets without manual CMS entry. It’s ideal for teams leveraging Alibaba Cloud Bailian for LLM orchestration, Notion for collaborative content storage, and Vercel for high-performance, globally distributed frontend delivery.

Integration steps

  1. Initialize Notion CMS: Create a Notion database. Generate an Internal Integration token with content:read and content:write scopes. Record the DATABASE_ID.
  2. Scaffold Notion MCP Server: Follow notion-build-ai to deploy an MCP server. Configure mcp.json:
  3. ``json { "mcpServers": { "notion": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-notion"], "env": { "NOTION_API_TOKEN": "ntn_..." } } } } ``

  4. Host MCP Layer: Deploy the MCP server on Cloudflare Workers or Alibaba Cloud Linux (alinux+cloudflare/static-site-with-ai-backend-990f4c) for low-latency tool execution.
  5. Register MCP in Bailian: Use bailian-integrate-mcp to attach the tool. Call POST /v1/agents/{agent_id}/tools with:
  6. ``json {"type": "mcp", "url": "https://your-mcp-host.com/sse", "tools": ["create_page", "query_database", "update_page"]} ``

  7. Configure Agent Prompt: Set system instructions: "Always use create_page to add articles to DATABASE_ID. Map inputs to Notion properties: title, status, content."
  8. Build Vercel Frontend: Run npx create-next-app@latest. Install @notionhq/client. In lib/notion.ts:
  9. ``ts import { Client } from '@notionhq/client'; export const notion = new Client({ auth: process.env.NOTION_TOKEN }); ``

  10. Query & Render: In app/page.tsx:
  11. ``ts const posts = await notion.databases.query({ database_id: process.env.NOTION_DB_ID, filter: { property: 'status', select: { equals: 'published' } } }); ``

  12. Deploy: Run vercel deploy --prod. Add export const revalidate = 60; to enable ISR.

Architecture

The Bailian Agent acts as the orchestrator, parsing natural language and invoking MCP tools. The MCP Server (hosted on Cloudflare/Alinux) translates calls into Notion REST requests (POST /v1/pages, PATCH /v1/pages/{id}). Notion serves as the structured headless CMS, storing rich text and metadata. The Vercel Next.js app fetches via @notionhq/client, caches with ISR, and renders the UI. Data flows: User Prompt → Bailian → MCP → Notion API → Vercel ISR Cache → Frontend.

Prerequisites

Common pitfalls

Typical questions

FAQ

Q: How does the AI agent automate content management and publishing between Notion and Vercel? A: The Bailian AI agent autonomously creates and updates content in Notion via MCP tool calling, which serves as a headless CMS to feed a Vercel-hosted frontend. This integration forms a complete AI-driven content pipeline that automates the entire workflow from generation to live delivery.