MCPcopy Create free account
hub / github.com/modelcontextprotocol/ext-apps / isLocalPath

Function isLocalPath

examples/pdf-server/server.ts:574–578  ·  view source on GitHub ↗

* Check if `url` looks like an absolute local file path (not a URL scheme). * Handles Unix paths (/...), home-relative (~), and Windows drive letters (C:\...).

(url: string)

Source from the content-addressed store, hash-verified

572 * Handles Unix paths (/...), home-relative (~), and Windows drive letters (C:\...).
573 */
574function isLocalPath(url: string): boolean {
575 return (
576 url.startsWith("/") || url.startsWith("~") || /^[A-Za-z]:[/\\]/.test(url)
577 );
578}
579
580export function validateUrl(url: string): {
581 valid: boolean;

Callers 4

validateUrlFunction · 0.85
readPdfRangeFunction · 0.85
createServerFunction · 0.85
processInteractCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…