Skip to content

Commit b0c2676

Browse files
Document async MCP disconnect API usage
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 27295d3 commit b0c2676

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ console.log(response);
366366
await agent.closeAgent();
367367
```
368368

369+
You can dynamically disconnect MCP servers later:
370+
371+
```typescript
372+
// Fire-and-forget disconnect
373+
agent.disconnectFromMCPServer("server-id");
374+
375+
// Awaited disconnect with success/failure result
376+
const didDisconnect = await agent.disconnectFromMCPServerAsync("server-id");
377+
console.log({ didDisconnect });
378+
```
379+
369380
### Custom Actions
370381

371382
HyperAgent's capabilities can be extended with custom actions. Custom actions require 3 things:

0 commit comments

Comments
 (0)