MCP Resources

MCP Resources
Section titled “MCP Resources”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.
publishResource
Section titled “publishResource”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)
Next steps
Section titled “Next steps”Are you ready to build your own MCP tools and resources?