Class StdioMcpTransport.Builder
java.lang.Object
dev.langchain4j.mcp.client.transport.stdio.StdioMcpTransport.Builder
- Enclosing class:
StdioMcpTransport
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()environment(Map<String, String> environment) executorService(ExecutorService executorService) Sets theExecutorServiceto use for background I/O operations.logEvents(boolean logEvents) logger(org.slf4j.Logger logger) workingDirectory(Path workingDirectory) Sets the working directory of the MCP server subprocess, including when it is restarted.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
command
-
environment
-
workingDirectory
Sets the working directory of the MCP server subprocess, including when it is restarted. If not set ornull, the subprocess inherits the current process's working directory. This does not change the working directory of the current process.- Parameters:
workingDirectory- the subprocess working directory, ornullto use the default- Returns:
this
-
logEvents
-
executorService
Sets theExecutorServiceto use for background I/O operations. If not provided, will useDefaultExecutorProvider.getDefaultExecutor().Frameworks like Quarkus should provide their managed executor here. The provided executor is never shut down when the transport is closed.
- Parameters:
executorService- the executor service to use- Returns:
this
-
logger
- Parameters:
logger- an alternateLoggerto be used instead of the default one provided by Langchain4J for traffic logging.- Returns:
this.
-
build
-