Unlike Tools (which do things), Resources expose data for the AI to inspect. Think of them as files, database rows, or standard operating procedures.
server.resource(
"company-handbook", // Name
"file:///docs/handbook.md", // URI
{ description: "HR Policies" }, // Metadata
async (uri) => {
return {
contents: [{
uri: uri.href,
text: "Handbook contents go here..."
}]
};
}
);
All Resources are identified by a URI. The client can fetch the exact content of the resource via string paths.