Commit 431c8ae
fix(dashboard): add defensive null checks for MCP host compatibility
Add null/undefined checks throughout the MCP client and dashboard code
to handle hosts that may pass null values in callbacks. This improves
compatibility with different MCP Apps hosts.
Changes:
- Add null checks in ontoolresult, ontoolinput, onhostcontextchanged handlers
- Wrap supportsServerTools() in try/catch with null check
- Add null check for callServerTool result
- Add defensive checks in handleToolResult and handleToolInput
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent a9fc3f0 commit 431c8ae
2 files changed
+51
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
160 | 166 | | |
| 167 | + | |
161 | 168 | | |
162 | 169 | | |
163 | | - | |
164 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
| |||
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
270 | 283 | | |
271 | 284 | | |
272 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
97 | 112 | | |
98 | 113 | | |
99 | 114 | | |
| |||
117 | 132 | | |
118 | 133 | | |
119 | 134 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
123 | 148 | | |
124 | 149 | | |
125 | 150 | | |
| |||
166 | 191 | | |
167 | 192 | | |
168 | 193 | | |
169 | | - | |
| 194 | + | |
170 | 195 | | |
171 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
172 | 203 | | |
173 | 204 | | |
174 | 205 | | |
| |||
177 | 208 | | |
178 | 209 | | |
179 | 210 | | |
| 211 | + | |
180 | 212 | | |
181 | 213 | | |
182 | 214 | | |
| |||
0 commit comments