Model Context Protocol

MCP Server Reference

Manage your Drupal spaces, import content, and monitor usage directly from AI tools like Claude Desktop, Cursor, and Claude Code.

What is MCP?

The Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools and data sources. Decoupled.io provides an MCP server that gives AI tools direct access to your Drupal platform.

Instead of switching between your AI assistant and the dashboard, you can manage everything through natural language:

“Create a new Drupal site called My Blog”
“Import a product catalog with 10 sample items”
“Show me usage stats for all my spaces”
“Clone my production site for staging”

Setup

Prerequisites

You need a Personal Access Token (PAT) to authenticate with the MCP server. Get one from your dashboard:

  1. Go to dashboard.decoupled.io
  2. Navigate to Settings → API Tokens
  3. Create a new token and copy it (format: dc_tok_...)

Claude Code (CLI)

Terminal
claude mcp add --transport http decoupled-io \
  https://mcp.decoupled.io \
  --header "Authorization: Bearer dc_tok_YOUR_TOKEN"

Or use the CLI: npx decoupled-cli@latest mcp configure --ide claude-code

For project-level config (Claude Code web): npx decoupled-cli@latest mcp configure --project

Claude Desktop

Add the following to your Claude Desktop configuration file:

claude_desktop_config.json
{
  "mcpServers": {
    "decoupled-io": {
      "url": "https://mcp.decoupled.io/sse",
      "headers": {
        "Authorization": "Bearer dc_tok_YOUR_TOKEN"
      }
    }
  }
}

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

Add to your Cursor MCP settings (Settings → MCP):

.cursor/mcp.json
{
  "mcpServers": {
    "decoupled-io": {
      "url": "https://mcp.decoupled.io/sse",
      "headers": {
        "Authorization": "Bearer dc_tok_YOUR_TOKEN"
      }
    }
  }
}

Or use the CLI: npx decoupled-cli@latest mcp configure --ide cursor

Space Management Tools

list_spaces

List all Drupal spaces in your organization with status, URLs, and hosting tier.

Parameters

archivedboolean (default: false) — Include archived spaces

Try it: “Show me all my Drupal spaces”

get_space

Get detailed information about a specific space including status, URLs, admin credentials, and resource usage.

Parameters

idnumber or string (required) — Space ID or machine name

Try it: “What's the status of space 42?”

create_space

Create a new Drupal space. Takes 90-100 seconds to provision and become active.

Parameters

namestring (required) — Name for the new space
typestarter | growth (default: starter) — Hosting tier

Try it: “Create a new Drupal site called My Portfolio”

clone_space

Clone an existing space to create a duplicate with all content and configuration.

Parameters

idnumber (required) — Source space ID to clone
namestring (required) — Name for the cloned space

Try it: “Clone space 42 as Staging Environment”

delete_space

Permanently delete a Drupal space. This action cannot be undone.

Parameters

idnumber (required) — Space ID to delete

Content Tools

import_content

Import content models and data into a Drupal space. Supports content types, fields, and sample content.

Parameters

spaceIdnumber (required) — Target space ID
contentobject (required) — Content import data with model and content arrays
previewboolean (default: false) — Preview changes without applying
Example content structure
{
  "model": [{
    "bundle": "blog_post",
    "label": "Blog Post",
    "body": true,
    "fields": [
      { "id": "category", "label": "Category", "type": "string" },
      { "id": "featured", "label": "Featured", "type": "bool" }
    ]
  }],
  "content": [{
    "id": "post1",
    "type": "node.blog_post",
    "path": "/blog/first-post",
    "values": {
      "title": "Getting Started with Headless Drupal",
      "body": "<p>Your first headless CMS project...</p>",
      "category": "Tutorial",
      "featured": true
    }
  }]
}

Try it: “Import a blog content model with 5 sample posts into space 42”

get_import_example

Get the complete content import JSON example showing all supported field types and the correct structure.

Parameters

None

Try it: “Show me the content import format”

Organization & Usage Tools

get_organization

Get current organization details including name, subscription plan, and limits.

Parameters

None

get_usage

Get organization-wide usage statistics including storage, bandwidth, and API requests across all spaces.

Parameters

None

get_space_usage

Get detailed usage statistics for a specific space.

Parameters

idnumber (required) — Space ID

Utility Tools

get_login_link

Generate a one-time login link that logs you directly into the Drupal admin panel. Expires in 24 hours.

Parameters

spaceIdnumber (required) — Space ID

Try it: “Give me a login link for space 42”

get_oauth_credentials

Get OAuth credentials for a space, ready to paste into your Next.js .env.local file. Returns client_id, client_secret, and revalidate_secret.

Parameters

spaceIdnumber (required) — Space ID

Try it: “Get the OAuth credentials for space 42 so I can set up my Next.js frontend”

Example Workflows

Build a blog from scratch

Ask your AI assistant:

"Create a new Drupal space called 'Tech Blog', then import
a blog content model with categories and 5 sample posts
about web development. Give me the login link when done."

The AI will call create_space, wait for provisioning, call import_content with generated content, then get_login_link.

Set up a Next.js frontend

Ask your AI assistant:

"Get the OAuth credentials for space 42 and help me
set up a Next.js project to fetch content from it."

The AI will call get_oauth_credentials and get_space to get the GraphQL endpoint, then help scaffold your frontend.

Clone for staging

Ask your AI assistant:

"Clone my production space (ID 42) to create a staging
environment, then show me the usage for both spaces."

Troubleshooting

Token not working

Ensure your token starts with dc_tok_ and hasn't been revoked. Generate a new one at Settings → API Tokens.

Space still provisioning

New spaces take 90-100 seconds to provision. Use get_space to check the status. The AI assistant will typically wait and poll automatically.

MCP server not connecting

Verify the server URL is https://mcp.decoupled.io (HTTP transport) or https://mcp.decoupled.io/sse (SSE transport). Check that your Authorization header includes Bearer before the token.

Test the server directly

Terminal
curl -s https://mcp.decoupled.io \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer dc_tok_YOUR_TOKEN" \
  -d '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":1}' \
  | jq -r '.result.tools[].name'