Skip to content

Commit 9664da9

Browse files
committed
Allow additional properties and log 5xx errors
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
1 parent b7fd636 commit 9664da9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

apps/mesh/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@decocms/mesh",
3-
"version": "1.0.0-alpha.44",
3+
"version": "1.0.0-alpha.45",
44
"description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
55
"license": "MIT",
66
"author": "Deco team",

apps/mesh/src/api/app.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ export function createApp(options: CreateAppOptions = {}) {
130130
// Request logging
131131
app.use("*", logger());
132132

133+
// Log response body for 5xx errors
134+
app.use("*", async (c, next) => {
135+
await next();
136+
if (c.res.status >= 500) {
137+
const clonedRes = c.res.clone();
138+
const body = await clonedRes.text();
139+
console.error(
140+
`[5xx Response] ${c.req.method} ${c.req.path} - ${c.res.status}:`,
141+
body,
142+
);
143+
}
144+
});
145+
133146
// ============================================================================
134147
// Health Check & Metrics
135148
// ============================================================================

apps/mesh/src/tools/connection/fetch-tools.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ export async function fetchToolsFromMCP(
6969
name: tool.name,
7070
description: tool.description ?? undefined,
7171
inputSchema: tool.inputSchema ?? {},
72-
outputSchema: tool.outputSchema ?? undefined,
72+
outputSchema: tool.outputSchema
73+
? // We strive to have lenient output schemas, so allow additional properties
74+
{ ...tool.outputSchema, additionalProperties: true }
75+
: undefined,
7376
}));
7477
} catch (error) {
7578
console.error(

0 commit comments

Comments
 (0)