-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Pre-submission Checklist
- I have checked that this question would not be more appropriate as an issue in a specific repository
- I have searched existing discussions and documentation for answers
Question Category
- Protocol Specification
- SDK Usage
- Server Implementation
- General Implementation
- Documentation
- Other
Your Question
Hi, just dipping my toes into this and have a couple of initial questions.
I'm trying to build a standalone MCP client (no Spring boot support). Here's my code so far:
HttpClientSseClientTransport transport = HttpClientSseClientTransport.builder(mcpFileLocation.getURI()).build();
McpSyncClient client = McpClient.sync(transport)
.requestTimeout(Duration.ofSeconds(30))
.capabilities(ClientCapabilities.builder()
.roots(true)
.sampling()
.build())
.build();
try {
client.initialize();
ListToolsResult tools = client.listTools();
ListPromptsResult prompts = client.listPrompts();
ListResourcesResult resources = client.listResources();
} catch (McpError e) {
SwingUtils.showError("Unable to contact server", e, this);
// this seems to get thrown if the URL is valid but times out,
// other errors seem to get swallowed in a separate thread.
}It seems that most low-level exceptions get logged and swallowed in separate threads, so what's the best way to catch them and feed them back to the UI?
Many thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels