@cyanheads/filesystem-mcp-server
Version:
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search and replace, and directory tree traversal
26 lines (25 loc) • 592 B
JavaScript
// Type definitions for the MCP (Message Control Protocol) protocol
// Helper functions
export const createToolResponse = (text, isError) => ({
content: [{
type: "text",
text
}],
isError
});
export const createResourceResponse = (uri, text, mimeType) => ({
contents: [{
uri,
text,
mimeType
}]
});
export const createPromptResponse = (text, role = "assistant") => ({
messages: [{
role,
content: {
type: "text",
text
}
}]
});