Drupal is a registered trademark of Dries Buytaert
Entity Reference Display 2.0.6 Minor update available for module entity_reference_display (2.0.6). SmartDuo Breadcrumb 2.1.0 Minor update available for module sd_breadcrumb (2.1.0). SmartDuo Breadcrumb 1.1.9 Minor update available for module sd_breadcrumb (1.1.9). Date Point 1.6.2 Minor update available for module date_point (1.6.2). CKEditor 5 Spoiler 1.2.0 Minor update available for module ckeditor5_spoiler (1.2.0). SDC Components 1.0.9 Minor update available for module sdc_components (1.0.9). REST Entity Display 2.0.2 Minor update available for module rest_entity_display (2.0.2). SDC Components 1.0.8 Minor update available for module sdc_components (1.0.8). Purge Module purge crossed 1,000 active installs. Entity Events 2.1.0 Module entity_events updated after 13 months of inactivity (2.1.0).

Overview

Adds an MCP Resource display type to Views. Build a view, add the display, pick fields and aliases, and the display's rows become a read-only MCP resource served by MCP Server. No code, no routes — the Views UI is the whole authoring surface.

Requires MCP Server 2.x and MCP Server UI (for the admin forms to enable resource providers).

Key Capabilities

Dedicated display type

Resources are first-class Views displays, not metadata on a page. The row plugin, pager, and access plugin are purpose-built for MCP.

No code, no routes

Field aliases, raw output, the MCP resource limit, and filters are all configured in the Views UI. The MCP URI is auto-derived.

Resource templates

Contextual or exposed filters become URI segments. The MCP SDK advertises them as templates and offers completion on finite option lists.

From a Views UI to an AI-readable resource in four steps

The authoring surface:

pick fields, configure aliases, set the MCP resource limit. No PHP, no routing.

What MCP clients see:

resources/list enumerates each display; resources/read returns JSON with rows, total, has_more, and next_offset.

In the Claude Desktop connector menu, every MCP Resource display shows up as a callable resource.

The AI reads the resource, evaluates rows against the user's prompt, and answers in natural language. No custom tool was written for this use case.

How it works

  1. Create (or edit) a view and add a display of type MCP Resource.
  2. Pick fields, filters, sorts, and the MCP resource limit in the Views UI.
  3. Under Row, configure field aliases (and optional raw output) for each included field. Aliases are the JSON keys the AI will read.
  4. Save the view. Parameterless displays are auto-enumerated at views://<view_id>/<display_id> with the wire name <view_id>__<display_id>. Displays with contextual or exposed filters are advertised as resource templates at views://<view_id>/<display_id>/{param1}/{param2}/…, where each placeholder is named after the Views handler ID.
  5. Enable the providers in MCP Server UI at Configuration » Web services » MCP Server » Resources and Resource Templates. Until both are enabled, MCP Resource displays are not advertised or readable.
  6. A resources/read of a concrete URI executes the view in the requesting account's context and returns JSON.

An example payload:

{
  "view": "content",
  "display": "mcp_resource_1",
  "label": "Content",
  "description": "Recently updated articles.",
  "fields": {"field_ingredients": "ingredients", "user.name": "username"},
  "limit": 10,
  "offset": 0,
  "total": 25,
  "returned": 10,
  "has_more": true,
  "next_offset": 10,
  "rows": [
    {"title": "Hello world", "changed": "2026-07-20"},
    {"title": "Another post", "tags": ["News", "Updates"]}
  ]
}

Rendered field values honour each field's configured formatter, then strip HTML wrappers and decode entities so the values read as plain text. Fields marked "exclude from display" are omitted. Multi-value fields emit an array for that key. Enable Raw output on a field to emit stored values instead of rendered markup.

Resource templates

When an MCP Resource display defines contextual filters or exposed filters, it is listed under resources/templates/list instead of resources/list. Each filter becomes a URI segment named after its handler ID — for example views://recipes/list/{status}.

Supply every segment on resources/read. Use - for an empty optional segment (the MCP SDK requires a non-empty path segment). An empty value leaves the view default in place — contextual filters with Provide default value: Ignore, or non-required exposed filters.

Template descriptions include a short parameter reference; structured metadata is available under _meta.arguments (id, title, description, required, source). When Views exposes a finite option list for a filter, MCP completion can suggest values for that segment.

Access control

  • The display's own Views access settings are the access model, evaluated against the MCP request's authenticated account. A display the account cannot access is omitted from resources/list and denied on resources/read.
  • The provider never elevates privileges. Over the STDIO transport the view runs as the anonymous user.
  • Reaching the MCP endpoint at all additionally requires MCP Server's access mcp server permission.

Pager and payload size

MCP Resource displays use the MCP resource limit pager only — not the HTML pagers (full, mini, none, some). Configure items per resource read (minimum 1) and an optional static offset. Each read returns at most that many rows; total, has_more, and next_offset in the JSON payload come from a count query so clients know how much data remains.

Parameterized offset/limit through the resource URI is on the roadmap. Until then the configured offset is the starting point for every read.

Requirements

  • MCP Server ^2.0 — the MCP runtime and resource plugin system.
  • MCP Server UI — recommended; provides the admin forms to enable resource providers.
  • drupal/views (Drupal core).

Installation

Install with Composer and enable the module:

composer require drupal/mcp_server_views
drush en mcp_server_views
drush cr

Then enable the providers in MCP Server UI:

  • Administration » Configuration » Web services » MCP Server » Resources
  • Administration » Configuration » Web services » MCP Server » Resource Templates
Until both providers are enabled, MCP Resource displays are not advertised or readable.

Architecture

The module is split into small, single-purpose plugins around the MCP Server resource contract:

  • Views display plugin (mcp_resource): site builders configure fields, filters, sorts, the MCP limit pager, and per-field aliases in the Views UI. Row output is locked to the MCP Fields row plugin.
  • Pager plugin (mcp_limit): JSON-oriented limit/offset with a count query; no HTML pager markup.
  • Row plugin (mcp_field): serializes included fields to JSON row maps; multi-value fields emit arrays; optional raw output per field.
  • Resource provider: enumerates parameterless MCP Resource displays at views://<view_id>/<display_id> and serves JSON on resources/read.
  • Resource template provider: enumerates displays with contextual or exposed filters as templates and serves concrete URIs on resources/read.
  • Parameter helper: derives template variables, builds URI templates, parses concrete URIs, and applies values via setArguments() / setExposedInput().
  • Runner: executes views, builds the metadata + rows payload, and honours each display's pager and access plugin.

Enablement is handled by MCP Server UI; this module does not write MCP Server config.

Related Projects

  • MCP Server — the MCP runtime and resource plugin system this module plugs into.
  • MCP Server UI — admin forms to enable resource providers.
  • MCP Server Examples — example resource template and completion provider plugins.

Resources

Credits

Maintained by the MCP Server contributors. Architectural inspiration from the existing Views ecosystem and the Model Context Protocol reference SDKs.

Activity

Total releases
2
First release
Jul 2026
Latest release
3 hours ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Jul 22, 2026
1.x-dev Dev Jul 22, 2026