Skip to content

Commit 3e2b8b2

Browse files
committed
docs: update api refs
1 parent f51e014 commit 3e2b8b2

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

agents/skills/mcp-web/api-reference-core.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ get connected(): boolean
140140

141141
Whether the client is currently connected to the bridge server.
142142

143+
```ts
144+
get connecting(): boolean
145+
```
146+
147+
Whether the instance is currently attempting to connect to the bridge.
148+
149+
Returns `true` during the connection/authentication handshake,
150+
before `connected` becomes `true` or the connection fails.
151+
143152
**Methods:**
144153

145154
```ts
@@ -320,6 +329,15 @@ addStateTools<T>(optionsOrCreated: {
320329
} | CreatedStateTools<T>): [ToolDefinition, ToolDefinition | ToolDefinition[], () => void]
321330
```
322331

332+
```ts
333+
onConnectionStateChange(listener: () => void): () => void
334+
```
335+
336+
Subscribe to connection state changes.
337+
338+
The listener is called whenever `connected` or `connecting` changes.
339+
Returns an unsubscribe function.
340+
323341
```ts
324342
disconnect(): void
325343
```

agents/skills/mcp-web/api-reference-integrations.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ mcpWeb: MCPWeb
1414

1515
The MCPWeb instance for registering tools and making queries.
1616

17+
```ts
18+
isConnecting: boolean
19+
```
20+
21+
Whether the MCPWeb instance is currently attempting to connect.
22+
1723
```ts
1824
isConnected: boolean
1925
```
@@ -117,6 +123,9 @@ Internal hook for managing MCPWeb connection lifecycle.
117123
Connects on mount and disconnects on unmount.
118124
Returns reactive connection state for triggering re-renders.
119125

126+
Subscribes to MCPWeb's connection state changes so that reconnection
127+
attempts (e.g. after a WebSocket drop) are reflected in React state.
128+
120129
Handles React StrictMode's double-mount behavior by using a ref to track
121130
whether we should actually disconnect on cleanup.
122131

docs/api/core.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ get connected(): boolean
140140

141141
Whether the client is currently connected to the bridge server.
142142

143+
```ts
144+
get connecting(): boolean
145+
```
146+
147+
Whether the instance is currently attempting to connect to the bridge.
148+
149+
Returns `true` during the connection/authentication handshake,
150+
before `connected` becomes `true` or the connection fails.
151+
143152
**Methods:**
144153

145154
```ts
@@ -320,6 +329,15 @@ addStateTools<T>(optionsOrCreated: {
320329
} | CreatedStateTools<T>): [ToolDefinition, ToolDefinition | ToolDefinition[], () => void]
321330
```
322331

332+
```ts
333+
onConnectionStateChange(listener: () => void): () => void
334+
```
335+
336+
Subscribe to connection state changes.
337+
338+
The listener is called whenever `connected` or `connecting` changes.
339+
Returns an unsubscribe function.
340+
323341
```ts
324342
disconnect(): void
325343
```

docs/api/integrations.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ mcpWeb: MCPWeb
1414

1515
The MCPWeb instance for registering tools and making queries.
1616

17+
```ts
18+
isConnecting: boolean
19+
```
20+
21+
Whether the MCPWeb instance is currently attempting to connect.
22+
1723
```ts
1824
isConnected: boolean
1925
```
@@ -117,6 +123,9 @@ Internal hook for managing MCPWeb connection lifecycle.
117123
Connects on mount and disconnects on unmount.
118124
Returns reactive connection state for triggering re-renders.
119125

126+
Subscribes to MCPWeb's connection state changes so that reconnection
127+
attempts (e.g. after a WebSocket drop) are reflected in React state.
128+
120129
Handles React StrictMode's double-mount behavior by using a ref to track
121130
whether we should actually disconnect on cleanup.
122131

0 commit comments

Comments
 (0)