MCP Resource

The MCP Resource node allows you to expose read-only data that AI assistants can access for context. Resources are designed to provide information without performing actions or causing side effects. Resources allow servers to share data that provides context to language models, such as files, database schemas, or application-specific information

Flow Requirements

MCP Resource nodes must be connected to a flow that ends with an MCP Response node to send the resource content back to the MCP client.

Configuration

Name

string - Optional

Optional display name for this node in the flow. This helps you identify the node in your Node-RED editor but is not visible to MCP clients.

Server

mcp-server - Required

The MCP server configuration this resource will be registered with. Select from your configured MCP server instances.

ID

string - Required

Unique identifier for the resource used by MCP clients to access this resource. Should be written in snake_case.

Examples:

  • user_database
  • config_files
  • api_documentation
  • product_catalog

URI

string - Required

URI of the resource. This should be unique for each resource you expose. The URI follows a scheme-based format similar to file paths or URLs.

Static Resource Examples:

  • file://config.json
  • db://schema/users
  • local://documentation/api
  • app://settings/theme

Dynamic Resource Template Examples:

  • github://repos/{owner}/{repo}
  • local://books/{genre}
  • db://users/{user_id}/orders
  • file://logs/{date}/{level}

Title

string - Required

Human-readable name shown to users in MCP clients. This is what users see when browsing available resources.

MIME Type

string - Required

MIME type of the resource content. This tells the MCP client how to interpret the data you return.

Common MIME Types:

  • application/json - JSON data
  • text/plain - Plain text
  • text/markdown - Markdown formatted text
  • text/html - HTML content
  • application/xml - XML data
  • text/csv - CSV files
  • application/pdf - PDF documents

Description

string - Required

Detailed description of what this resource provides and when to use it.

URI Types

Static Resources

Static resources have a fixed URI and return the same data each time they're accessed. These are ideal for configuration files, schemas, documentation, and other unchanging reference materials.

Example URI: file://path/to/config.json

Your flow would always return the content of that specific file.

Use Cases:

  • Application configuration files
  • Database schemas
  • API documentation
  • System specifications
  • Reference data

Resource Templates

Resource templates have URIs with dynamic components based on user-defined input. Variables in the URI are enclosed in curly braces {}.

Example URI: github://repos/{owner}/{repo}

When an MCP client requests this resource with specific values (e.g., github://repos/flowfuse/node-red), the variables are passed to your flow in msg.payload, You can then use these variables to fetch and return the appropriate content.

More Examples:

Single Variable:

local://books/{genre}
→ msg.payload.genre = "science-fiction"

Multiple Variables:

db://users/{user_id}/orders/{order_id}
→ msg.payload.user_id = "12345"
→ msg.payload.order_id = "67890"

Date-based Resources:

file://logs/{date}/{level}
→ msg.payload.date = "2024-01-15"
→ msg.payload.level = "error"

Output

Static Resources

For static resources, your flow simply returns the content in msg.payload. The MCP Response node will send it to the client.

msg.payload = {
database: "users",
tables: ["users", "profiles", "settings"]
};

Dynamic Resource Templates

For resource templates, the input msg.payload contains the variables from the URI. You use these to fetch the appropriate content.

Example:

URI: local://books/{genre}

Input received:

msg.payload = {
genre: "horror"
}

Your flow processes this and returns:

msg.payload = {
genre: "horror",
books: [
{ title: "Dracula", author: "Bram Stoker" },
{ title: "Frankenstein", author: "Mary Shelley" }
]
};

Example Flow