Skip to content

MCP Resources

A colorful 2D illustration in an 8-bit retro style, depicting a stylized server setup with abstract data nodes linked by lines. The design uses five corporate colors, forming a geometric pattern that symbolizes data and resource exchange. The interconnected nodes illustrate a protocol for interaction, creating an iconic and corporate atmosphere without any people or text.
Generated by 🤖 AI

In a previous post, we announced how every script can be a MCP tool.

To follow up on this idea, we added support for publishing MCP resources as part of the script execution.

Resources are a core primitive in the Model Context Protocol (MCP) that allow servers to expose data and content that can be read by clients and used as context for LLM interactions.

MCP handles discovery and resolution of resources, so once your script publishes a resource, the MCP client (IDE) is made “aware” of it and it can decide to read it.

The publishResource method allows you to publish a resource with a unique identifier and a file/string/buffer. The rest of the MCP resource publishing process is handled by the GenAIScript framework.

const uri = await host.publishResource("unique-id", file)

Are you ready to build your own MCP tools and resources?