File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import {
2222 allowedLocalFiles ,
2323 DEFAULT_PDF ,
2424 allowedLocalDirs ,
25- type CreateServerOptions ,
2625} from "./server.js" ;
2726
2827/**
@@ -152,19 +151,12 @@ async function main() {
152151
153152 console . error ( `[pdf-server] Ready (${ urls . length } URL(s) configured)` ) ;
154153
155- // For stdio the client is typically local (e.g. Claude Desktop on the
156- // same machine), so honouring client roots is safe by default.
157- // For HTTP the client is remote — roots would expose the server's
158- // filesystem. Only honour them with an explicit opt-in.
159- const effectiveUseClientRoots = useClientRoots || stdio ;
160- const serverOpts : CreateServerOptions = {
161- useClientRoots : effectiveUseClientRoots ,
162- } ;
163-
164154 if ( stdio ) {
165- await startStdioServer ( ( ) => createServer ( serverOpts ) ) ;
155+ // stdio → client is local (e.g. Claude Desktop), roots are safe
156+ await startStdioServer ( ( ) => createServer ( { useClientRoots : true } ) ) ;
166157 } else {
167- await startStreamableHTTPServer ( ( ) => createServer ( serverOpts ) ) ;
158+ // HTTP → client is remote, only honour roots with explicit opt-in
159+ await startStreamableHTTPServer ( ( ) => createServer ( { useClientRoots } ) ) ;
168160 }
169161}
170162
You can’t perform that action at this time.
0 commit comments