in genai-function-calling/spring-ai/src/main/java/example/Main.java [36:51]
public static void main(String[] args) {
// We use a common entrypoint so that we can launch with the same args
// regardless of if this is a client or server. If we didn't, we would
// need to search through the args and replace McpClientAgent with
// McpServer.
if (Arrays.asList(args).contains("--mcp-server")) {
McpServer.main(args);
} else if (Arrays.asList(args).contains("--mcp")) {
McpClientAgent.main(args);
} else {
run(Main.class, args,
"spring.ai.mcp.client.enabled=false",
"spring.ai.mcp.server.enabled=false"
);
}
}