@alnlabs/contentstack-mcp
v1.2.0
Published
MCP server for interacting with the Contentstack Management API, including deep schema resolution
Maintainers
Readme
Contentstack MCP Server (@alnlabs/contentstack-mcp)
This Model Context Protocol (MCP) server integrates with Contentstack's Content Management API, enabling AI assistants like Claude and Cursor to interact with your Contentstack CMS through a standardized protocol.
Fork notice: Maintained by ALN Labs. Based on the original open-source project by Darek Rossman (
darekrossman/contentstack-mcp/@drossman/contentstack-mcp). See Credits and What's improved.
Table of Contents
- What's improved vs upstream
- Features
- Installation
- Development
- Configuration
- Integration with AI Assistants
- Roadmap
- Publishing
- Credits
- License
What's improved vs upstream
Compared with the original @drossman/contentstack-mcp, this fork keeps the same stdio MCP transport and existing tool names, and adds production-oriented schema understanding for agents.
| Area | Upstream (@drossman/...) | This fork (@alnlabs/...) |
|---|---|---|
| Raw content type fetch | get_content_type / get_all_content_types return CMA JSON (often prose-wrapped) | Same tools kept for compatibility |
| Deep schema understanding | Not available — callers must interpret nested CMA schema themselves | get_resolved_content_type recursively expands Groups, Modular Blocks, References, and Global Fields |
| Nested Groups / Blocks | Present in raw CMA payload only | Preserved as a typed nested tree (parent/child relationships kept) |
| Reference fields | reference_to UIDs in raw schema | Resolves target content type schemas (not entry UIDs), with multi-target + multiple-value support |
| Global Fields | List/create/update tools; no deep expand | Fetches GF-by-UID when not embedded; supports nested GFs |
| Cycles / depth | N/A | Path-based cycle detection + configurable max_depth with explicit circular / depth_limit statuses |
| Caching / dedupe | Per-request axios calls in the server | Shared API client with TTL cache + concurrent request dedupe for CT/GF fetches |
| Errors | Text error strings | Structured tool errors (not_found, unauthorized, upstream, timeout, …) without leaking credentials |
| Tests | Placeholder (No test specified) | Vitest suite for resolution, caching, errors, and tool handler output |
| CI / release | Basic release workflow | Test + typecheck + build on PR/main; semantic-release publish to npm |
New read-only tool: get_resolved_content_type
Input
uid(required) — content type UIDmax_depth(optional, default5) — max expansion depth for References / Global Fieldsresolve_references/resolve_global_fields(optional booleans, defaulttrue)
Output (JSON)
- Root content type UID/title
- Nested fields with original CMA metadata preserved
reference_targets[]andglobal_fieldresolution status- Statuses:
resolved|unresolved|circular|depth_limit|api_error|not_found - Aggregated
resolution_warnings
This tool is read-only. It does not create, update, delete, or publish Contentstack content.
Features
Available Resources
content-types: List all content types (URI:contentstack://content-types)content-type: Get content type by UID (URI:contentstack://content-type/{uid})entries: Get entries by content type (URI:contentstack://entries/{content_type_uid})entry: Get specific entry (URI:contentstack://entry/{content_type_uid}/{entry_uid})assets: List all assets (URI:contentstack://assets)
Content Type Management
- Create, update, and delete content types
- Define schemas, options, field rules, and taxonomies
- Manage global fields
Entry Management
- Create, update, and delete entries
- Publish and unpublish entries across environments
- Query entries with filtering, pagination, and sorting options
Global Field Management
- Create and update global fields for reuse across content types
- Retrieve global fields with pagination options
Content Workflows
- Guided content creation workflows
- Content analysis and insights
- Migration planning assistance
Installation
Prerequisites
- Node.js (v16.0.0 or higher)
- A Contentstack account
- API credentials (API Key and Management Token)
NPM Installation
The easiest way to use this MCP server is via NPM:
# Install globally
npm install -g @alnlabs/contentstack-mcp
# Or use directly via npx
npx @alnlabs/contentstack-mcpManual Installation
Clone the repository:
git clone https://github.com/alnlabs/contentstack-mcp.git cd contentstack-mcpInstall dependencies:
npm installSet up environment variables:
cp .env.example .envEdit the
.envfile with your Contentstack credentials:CONTENTSTACK_API_KEY=your_api_key_here CONTENTSTACK_MANAGEMENT_TOKEN=your_management_token_here # Optional: Specify branch if using branches CONTENTSTACK_BRANCH=your_branch_nameBuild and start the server:
npm run build npm start
Installation via Smithery CLI
You can also install this MCP server using the Smithery CLI:
npx @smithery/cli install contentstack-mcp --client claudeSee the Smithery CLI documentation for more details and advanced usage.
Development
Setup for Development
For development, you can use:
npm run devThis starts the server using ts-node for a faster development cycle.
Code Quality
This project uses Biome.js for linting and formatting. It provides a consistent code style and helps catch potential issues early.
Available Commands
Lint Code:
npm run lintLint and Fix:
npm run lint:fixFormat Code:
npm run formatFormat and Fix:
npm run format:fix
Configuration
Authentication
This server requires authentication with Contentstack's API:
Management Token (Required):
- Stack-level token with predefined permissions
- Set via
CONTENTSTACK_MANAGEMENT_TOKENenvironment variable - Generate from Contentstack dashboard: Settings > Tokens > Management Tokens
API Key (Required):
- Stack API key for authentication
- Set via
CONTENTSTACK_API_KEYenvironment variable
Branch Support
If your Contentstack account uses branches, you can specify a branch:
CONTENTSTACK_BRANCH=developIntegration with AI Assistants
Claude for Desktop
To use this server with Claude for Desktop:
Edit your Claude for Desktop configuration file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Mac:
Add this server to the
mcpServerssection:{ "mcpServers": { "contentstack": { "command": "npx", "args": ["-y", "@alnlabs/contentstack-mcp"], "env": { "CONTENTSTACK_API_KEY": "your_api_key_here", "CONTENTSTACK_MANAGEMENT_TOKEN": "your_management_token_here" } } } }Restart Claude for Desktop
Cursor
To use this server with Cursor, add the Contentstack MCP server configuration:
{
"mcpServers": {
"contentstack": {
"command": "npx",
"args": ["-y", "@alnlabs/contentstack-mcp"],
"env": {
"CONTENTSTACK_API_KEY": "your_api_key_here",
"CONTENTSTACK_MANAGEMENT_TOKEN": "your_management_token_here",
}
}
}
}Install with Smithery
You can also install this MCP server using the Smithery CLI using your client of choice:
npx -y @smithery/cli install @alnlabs/contentstack-mcp --client claudeAvailable clients include:
- claude
- cline
- windsurf
- roocode
- witsy
- enconvo
- cursor
- vscode
- vscode-insiders
- boltai
- amazon-bedrock
- amazonq
See the Smithery CLI documentation for more details and advanced usage.
Roadmap
Done in this fork
- [x] Deep recursive schema resolution (
get_resolved_content_type) - [x] Shared CMA client with cache + request dedupe
- [x] Unit tests for nested schemas, refs, GFs, cycles, depth limits
- [x] CI test/typecheck/build + semantic-release npm publish
Planned
- [ ] Migrate remaining CRUD tools onto the shared API client
- [ ] Dedicated
get_global_fieldread tool (by UID) - [ ] Structured MCP content blocks where the SDK supports them
- [ ] Enhanced querying & filtering for entries
- [ ] Bulk operations support
- [ ] Extensibility for custom tools
Publishing
Releases are automated from main via GitHub Actions + semantic-release.
One-time setup
- Create an npm Automation token (or Granular Access Token with publish permission for
@alnlabs/contentstack-mcp). - In the GitHub repo → Settings → Secrets and variables → Actions, add:
NPM_TOKEN= that npm token
- Optional (recommended): on npmjs.com → package (after first publish) or org → Trusted Publisher → link this GitHub repo and the
Releaseworkflow for OIDC publishing. - Ensure Actions are enabled for the repo.
How a release is triggered
Push conventional commits to main:
| Commit prefix | Release |
|---|---|
| fix: ... | patch (1.2.0 → 1.2.1) |
| feat: ... | minor (1.2.0 → 1.3.0) |
| feat!: ... / BREAKING CHANGE: | major (1.2.0 → 2.0.0) |
The Release workflow runs tests/typecheck/build, then publishes to npm and creates a GitHub Release.
Manual first publish (optional):
npm run build && npm test && npm run typecheck
npm publish --access publicCredits
This package is a fork of the original Contentstack MCP Server created by Darek Rossman:
- Upstream repository: darekrossman/contentstack-mcp
- Original npm package:
@drossman/contentstack-mcp
ALN Labs maintains this fork (@alnlabs/contentstack-mcp) and has added deep schema resolution (get_resolved_content_type) and related tooling. The original copyright and MIT license terms are preserved.
Shoutout
Special thanks to Ivo Toby. The original project and its author were heavily inspired by his work in this space.
License
MIT — see LICENSE.
Copyright (c) 2025 Darek Rossman
Copyright (c) 2026 ALN Labs
Disclaimer: This project is not affiliated with, endorsed by, or supported by Contentstack. It is an independent open-source project designed to work with the Contentstack API.
