Skip to content

Commit 82fc86f

Browse files
committed
fix(mcp): preserve the default for empty API endpoints
1 parent 6d44429 commit 82fc86f

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎docs/prompts/2026-09-23-mcp-file-access.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@ patch bump with explicit migration guidance; the pending SDK release is already
5252
minor. Document that `/http/import` inputs do not need tus resumption. CI passed
5353
all jobs on the first implementation commit:
5454
https://github.com/transloadit/node-sdk/actions/runs/35882240299.
55+
56+
The follow-up council retained one configuration regression: an empty endpoint
57+
must use the SDK's default API. Four targeted tests failed before the one-line
58+
fallback correction (`/tmp/mcp-empty-endpoint-red.log`). Use the same `||` fallback
59+
as the SDK constructor. The rest of the corrected implementation passed review,
60+
and its complete CI run is:
61+
https://github.com/transloadit/node-sdk/actions/runs/35883965701.

‎packages/mcp-server/src/server.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ const resolveAssemblyReference = (
500500
path,
501501
}),
502502
}
503-
const endpoint = options.endpoint ?? 'https://api2.transloadit.com'
503+
// Match the SDK's default when an environment variable supplies an empty endpoint.
504+
const endpoint = options.endpoint || 'https://api2.transloadit.com'
504505
let assemblyId = args.assembly_id
505506

506507
if (args.assembly_url !== undefined) {

‎packages/mcp-server/test/unit/file-inputs.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,32 @@ describe('MCP file inputs', () => {
308308
)
309309
})
310310

311+
it.each([
312+
'transloadit_create_assembly',
313+
'transloadit_get_assembly_status',
314+
'transloadit_wait_for_assembly',
315+
])('uses the default API for an empty endpoint in %s', async (name) => {
316+
serverOptions.endpoint = ''
317+
const result = await client.callTool({
318+
name,
319+
arguments: { assembly_url: assemblyUrl },
320+
})
321+
expect(result.structuredContent).toMatchObject({ status: 'ok' })
322+
})
323+
324+
it('uses the default API for ID-based waits with an empty endpoint', async () => {
325+
serverOptions.endpoint = ''
326+
const result = await client.callTool({
327+
name: 'transloadit_wait_for_assembly',
328+
arguments: { assembly_id: assemblyId },
329+
})
330+
expect(result.structuredContent).toMatchObject({ status: 'ok' })
331+
expect(Transloadit.prototype.awaitAssemblyCompletion).toHaveBeenCalledWith(
332+
assemblyId,
333+
expect.objectContaining({ assemblyUrl }),
334+
)
335+
})
336+
311337
it.each([
312338
'transloadit_create_assembly',
313339
'transloadit_get_assembly_status',

0 commit comments

Comments
 (0)