Skip to content

Commit 4423bcd

Browse files
Fix misleading log
1 parent 0c4f9da commit 4423bcd

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

examples/webmcp/src/client.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,22 @@ function App() {
136136
});
137137

138138
handleRef.current = h;
139-
setMcpStatus("connected");
140139

141-
if (h.tools.length > 0) {
140+
if (!hasWebMcp) {
141+
setMcpStatus("disconnected");
142+
addLog(
143+
"MCP adapter running in no-op mode (navigator.modelContext unavailable).",
144+
"warn"
145+
);
146+
} else if (h.tools.length > 0) {
147+
setMcpStatus("connected");
142148
addLog(
143149
`WebMCP active — ${h.tools.length} tool(s) registered with navigator.modelContext`
144150
);
145151
} else {
152+
setMcpStatus("connected");
146153
addLog(
147-
"MCP connection established. Tools discovered but not registered (navigator.modelContext unavailable).",
154+
"MCP connection established but no tools were returned by the server.",
148155
"warn"
149156
);
150157
}

0 commit comments

Comments
 (0)