{"record":{"id":"014b87b351834fab","repo":"gethomepage/homepage","slug":"unsupported-resource-uri-use-homepage-config-f","errorCode":null,"errorMessage":"Unsupported resource URI. Use homepage://config/<filename>.","messagePattern":"Unsupported resource URI\\. Use homepage://config/<filename>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/utils/mcp/homepage-mcp.js","lineNumber":280,"sourceCode":"    writable: writeEnabled(),\n    description: FILE_DESCRIPTIONS[file],\n    docs: DOC_LINKS[file],\n  }));\n}\n\nfunction configResource(file) {\n  return {\n    uri: `homepage://config/${file}`,\n    name: file,\n    description: FILE_DESCRIPTIONS[file],\n    mimeType: file.endsWith(\".yaml\") ? \"application/yaml\" : \"text/plain\",\n  };\n}\n\nfunction parseConfigResourceUri(uri) {\n  const prefix = \"homepage://config/\";\n  if (!uri?.startsWith(prefix)) {\n    throw new Error(\"Unsupported resource URI. Use homepage://config/<filename>.\");\n  }\n  const file = uri.slice(prefix.length);\n  assertKnownConfigFile(file);\n  return file;\n}\n\nfunction toolDefinitions() {\n  return [\n    {\n      name: \"list_config_files\",\n      description:\n        \"List Homepage config files this server understands, whether they currently exist, and where their docs live.\",\n      inputSchema: {\n        type: \"object\",\n        properties: {},\n      },\n    },\n    {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/gethomepage/homepage/blob/b6dca1ae033e613d8e692f9a161a3cc53a5a2857/src/utils/mcp/homepage-mcp.js#L262-L298","documentation":"Thrown by parseConfigResourceUri when an MCP resources/read request supplies a URI that doesn't start with the expected `homepage://config/` prefix. Homepage's MCP server only exposes config files under that URI scheme.","triggerScenarios":"resources/read with message.params.uri that doesn't `startsWith('homepage://config/')`. Examples: 'homepage://services.yaml', 'file:///settings.yaml', 'homepage://config' (no trailing slash+name), or an empty/null uri (optional chaining makes undefined fail the startsWith).","commonSituations":"MCP client builds URIs from a template that omits the `config/` segment; client uses a plain path or file:// URI; caller guesses the scheme; URI was passed as a non-string.","solutions":["Use the exact URI form homepage://config/<filename>, e.g. homepage://config/services.yaml.","Call resources/list first — it returns the exact URIs the server accepts.","Pass only filenames from CONFIG_FILES after the prefix.","If extending the server, register new resources via configResource() so they advertise the same scheme."],"exampleFix":"// before\n{ \"uri\": \"homepage://services.yaml\" }\n\n// after\n{ \"uri\": \"homepage://config/services.yaml\" }","handlingStrategy":"validation","validationCode":"function buildConfigUri(file) {\n  const prefix = 'homepage://config/';\n  if (typeof file !== 'string' || !file.startsWith(prefix)) {\n    throw new Error(`URI must start with ${prefix}`);\n  }\n  return file;\n}","typeGuard":"function isConfigResourceUri(uri) {\n  return typeof uri === 'string' && uri.startsWith('homepage://config/');\n}","tryCatchPattern":null,"preventionTips":["Always obtain URIs from resources/list rather than constructing them by hand.","Centralize the homepage://config/ prefix as a constant in client code.","Validate the scheme before sending resources/read.","Never substitute file paths directly into URIs."],"tags":["mcp","resources","uri","validation"],"backgroundTag":null,"analyzedSha":"b6dca1ae033e613d8e692f9a161a3cc53a5a2857","analyzedAt":"2026-08-13T04:48:44.121Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}