Live AI Tooling integration for Antigravity and VS Code (GitHub Copilot)
SaCMS includes a native Model Context Protocol (MCP) Server that lets AI assistants query your schemas and content directly, without manual copy-pasting.
Issues tool calls over Streamable HTTP or SSE to query content or inspect schemas.
Authenticates via Bearer Token, resolves tenant workspace, and executes secure database operations.
AI receives structured schema fields, single type data, or published records to build complete codebases.
The SaCMS MCP Server supports standard Streamable HTTP and Server-Sent Events (SSE) transports, compatible with all modern MCP-compliant clients.
http://localhost:3000/api/mcp• Transport: Streamable HTTP (JSON-RPC 2.0) with SSE fallback
• Protocol Version: MCP Specification 2024-11-05
• Workspace Isolation: Automatically scoped to the tenant workspace bound to the API token
All requests to the MCP server must include a valid SaCMS API Token. You can generate a Read-Only API Token in your dashboard under Dashboard → [Tenant] → Developer → API Keys.
Authorization: Bearer YOUR_API_TOKEN
/api/mcp?token=YOUR_API_TOKEN
Complete catalogue of available AI tools and callable methods
Get the complete database schema of the workspace — all Content Types, Single Types, and Components with their fields and relationships. Call this FIRST before building or scaffolding any frontend.
get_full_schema().{
"workspace": {
"id": "cmsx45pyb0015ujloxp9f4r6v",
"name": "My Workspace",
"slug": "my-workspace"
},
"contentTypes": [
{
"id": "ct_articles",
"name": "Articles",
"slug": "articles",
"description": "Blog posts and news articles",
"fields": [
{
"name": "Title",
"slug": "title",
"type": "text",
"required": true,
"unique": false,
"localizable": true
},
{
"name": "Content",
"slug": "content",
"type": "richText",
"required": true,
"unique": false,
"localizable": true
},
{
"name": "Author",
"slug": "author",
"type": "relation",
"required": false,
"unique": false,
"localizable": false,
"relationSlug": "authors"
}
]
}
],
"singleTypes": [
{
"id": "st_homepage",
"name": "Homepage Config",
"slug": "homepage-config",
"description": "Hero banner and featured layout config",
"hasData": true,
"data": {
"siteTitle": "My Awesome Website",
"heroHeading": "Welcome"
},
"fields": [
{
"name": "Site Title",
"slug": "siteTitle",
"type": "text",
"required": true,
"unique": false,
"localizable": true
}
]
}
],
"components": [
{
"id": "comp_seo",
"name": "SEO Metadata",
"slug": "seo-metadata",
"category": "SEO",
"fields": [
{
"name": "Meta Title",
"slug": "metaTitle",
"type": "text",
"required": true,
"unique": false,
"localizable": true
}
]
}
]
}Fetch published or draft content entries from a Content Type collection with pagination, search, status, locale filtering, and sort order.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| contentTypeSlug | string | Yes | — | Slug of the Content Type (e.g. 'articles', 'products') |
| limit | number | No | 10 | Number of items to return (max 100) |
| page | number | No | 1 | Page number (1-indexed) |
| status | string | No | PUBLISHED | PUBLISHED | DRAFT | IN_REVIEW | ARCHIVED | ALL |
| search | string | No | — | Search term |
| locale | string | No | — | Filter by locale code (e.g. 'id', 'en') |
| sortOrder | string | No | desc | asc | desc, sorted by createdAt |
{
"contentType": "articles",
"pagination": {
"page": 1,
"limit": 10,
"total": 15,
"totalPages": 2
},
"data": [
{
"_id": "cmt191h9s000nujikfe9o533b",
"_status": "PUBLISHED",
"_locale": "id",
"_createdAt": "2026-08-20T08:19:09.615Z",
"_publishedAt": "2026-08-20T08:20:00.000Z",
"title": "Building Modern Web Apps with Next.js 16 and SaCMS"
}
]
}Step-by-step configuration files and connection instructions for every platform
{
"mcpServers": {
"sacms": {
"url": "http://localhost:3000/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Connecting cloud AI assistants (v0, Claude Web, etc.) to your local machine
Antigravity and VS Code running on your local machine can directly connect to http://localhost:3000/api/mcp. Remote/cloud-hosted IDE instances cannot reach your private localhost directly without a secure public tunnel.
cloudflared tunnel --url http://localhost:3000Copy the generated https://*.trycloudflare.com/api/mcp URL into your AI agent.
ngrok http 3000Copy the resulting forwarding HTTPS address + /api/mcp.
Ready-to-use prompt templates to supercharge your development in Antigravity & VS Code
"Please call the SaCMS MCP tool `get_full_schema`. Based on the returned Content Types, Single Types, and Components, generate strongly-typed TypeScript interfaces with JSDoc comments for my frontend application."
"Use the SaCMS MCP server to inspect the `articles` content type schema and query 5 recent published articles. Then, build a Next.js 16 Server Component with responsive Tailwind CSS styling, ISR caching (`revalidate: 60`), and proper SEO metadata."
"Call the `get_single_type_content` tool with `singleTypeSlug: 'homepage'`. Using the returned hero title, subtitles, and CTA buttons, build a modern, high-converting React landing page component."
"Use `query_content` with `contentTypeSlug: 'products'` to fetch product items. Create a Client Component featuring instant keyword search, category filtering, and price sorting wired to the SaCMS REST API."
"Execute `get_api_info` from the SaCMS MCP server. Write a reusable API client utility module (`lib/cms.ts`) with custom error handling, pagination helpers, and TypeScript return types."
"Query all content types and components using `get_full_schema`. Analyze the schema fields and recommend missing SEO, OpenGraph, or accessibility metadata fields for each collection."
A public REST API for fetching your managed content, with filtering, deep population, and full-text search.
Base URL: http://localhost:3000/api/public/[tenant-slug]All public REST API requests must include your API key in the headers, generated from Developer Settings → API Keys.
x-api-key: your_api_key_here\n# Or Authorization header:\nAuthorization: Bearer your_api_key_hereA fluent query builder with built-in rate-limit retries and strongly-typed content models.
npm install @sacms/sdk\n# or with Bun:\nbun add @sacms/sdkIntrospects your workspace's real schema over the network and generates one interface per Content Type / Single Type — no local database access needed:
npx @sacms/sdk generate --url http://localhost:3000 --tenant my-workspace --token YOUR_API_KEY --out src/types/sacms.tsPass the generated registry as a type argument for full per-slug intellisense — or skip it and call collection(slug) untyped, returning Record<string, unknown>:
import { SaCMS } from '@sacms/sdk'
import type { SaCMSRegistry } from './types/sacms' // from step 2, optional
// Initialize client (lib/sacms.ts)
export const sacms = new SaCMS<SaCMSRegistry>({
baseUrl: process.env.NEXT_PUBLIC_SACMS_API_URL || 'http://localhost:3000',
tenant: process.env.NEXT_PUBLIC_SACMS_TENANT || 'my-workspace',
token: process.env.SACMS_API_KEY || 'YOUR_API_KEY'
})
// app/articles/page.tsx (Server Component)
export default async function ArticlesPage() {
const { data: articles } = await sacms.collection('articles').findMany({
pagination: { page: 1, pageSize: 10 },
sort: 'createdAt:desc',
})
return (
<main className="max-w-4xl mx-auto py-12">
<h1 className="text-3xl font-bold mb-6">Latest Articles</h1>
<div className="grid gap-4">
{articles.map((article) => (
<article key={article.id} className="p-4 border rounded-xl">
<h2 className="text-xl font-bold">{article.title}</h2>
<p className="text-sm text-muted-foreground mt-1">{new Date(article.createdAt).toLocaleDateString()}</p>
</article>
))}
</div>
</main>
)
}For apps where visitors sign in themselves — separate from the service token above, which authenticates your backend, not an individual user:
// Sign up or sign in
const session = await sacms.auth.login(email, password)
// session.user, session.accessToken, session.refreshToken, session.expiresIn
// Authenticated calls use that member's own accessToken, not your service token
const { user } = await sacms.auth.me(session.accessToken)
await sacms.auth.updateMe(session.accessToken, { name: 'New Name' })
// Refresh when the access token expires, and sign out when done
const refreshed = await sacms.auth.refresh(session.refreshToken)
await sacms.auth.logout(session.refreshToken)Fetch multiple entries of a specific Content Type. Supports pagination, full-text search, field selection, and multi-relational population.
/api/public/[tenant]/content/[contentTypeSlug]fetch('http://localhost:3000/api/public/my-tenant/content/articles?filters[title][$contains]=Next.js&limit=10', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
})SaCMS uses Strapi-compatible filtering syntax: ?filters[field][$operator]=value.
Fetch singleton data structures such as Global Navigation, Homepage Hero, or Site Settings.
/api/public/[tenant]/single/[singleTypeSlug]fetch('http://localhost:3000/api/public/my-tenant/single/homepage-settings', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
})Execute dynamic GraphQL queries and mutations with full field selection, pagination, and relational populate.
/api/public/[tenant]/graphqlquery GetArticles {
articles(limit: 5, sort: "createdAt:desc") {
data {
id
title
slug
publishedAt
}
meta {
pagination {
total
page
pageSize
}
}
}
}Setiap workspace SaCMS berjalan di infrastruktur PostgreSQL terkelola milik SaCMS dengan isolasi logis per workspace. Untuk kebutuhan isolasi yang lebih tinggi, pemegang Lisensi Enterprise mendapatkan satu database PostgreSQL khusus (dedicated) yang dibuat otomatis saat lisensi diaktifkan — menampung seluruh workspace yang dimiliki akun tersebut. Tidak perlu menyambungkan server atau database eksternal sendiri; semuanya tetap dikelola di infrastruktur SaCMS.
Arahkan domain atau subdomain kustom Anda (misal: cms.perusahaan.com) ke SaCMS Cloud untuk white-labeling dashboard dan API endpoint.
cms) dan arahkan target ke sacms.cloud.