Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions scripts/production-mcp-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,21 @@ let requestSequence = 0;

async function mcp(method, params = {}) {
requestSequence += 1;
const headers = {
Accept: 'application/json, text/event-stream',
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'MCP-Protocol-Version': protocolVersion,
'Mcp-Method': method,
};
if (method === 'tools/call' && typeof params.name === 'string') {
headers['Mcp-Name'] = params.name;
}

const response = await fetch(endpoint, {
method: 'POST',
redirect: 'error',
headers: {
Accept: 'application/json, text/event-stream',
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'MCP-Protocol-Version': protocolVersion,
'Mcp-Method': method,
},
headers,
body: JSON.stringify({
jsonrpc: '2.0',
id: `production-smoke-${requestSequence}`,
Expand Down
21 changes: 12 additions & 9 deletions scripts/production-oauth-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,26 @@ async function assertMcpRead(token, label) {
const callResponse = await mcpRequest(token, 'tools/call', {
name: 'list_apps',
arguments: {},
});
}, 'list_apps');
assert.equal(callResponse.status, 200, `${label} could not call list_apps`);
const called = await callResponse.json();
assert.notEqual(called.result?.isError, true, `${label} list_apps returned a tool error`);
}

function mcpRequest(token, method, params = {}) {
function mcpRequest(token, method, params = {}, toolName) {
const headers = {
Accept: 'application/json, text/event-stream',
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
'MCP-Protocol-Version': '2026-07-28',
'Mcp-Method': method,
};
if (toolName) headers['Mcp-Name'] = toolName;

return fetch(resource, {
method: 'POST',
redirect: 'error',
headers: {
Accept: 'application/json, text/event-stream',
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
'MCP-Protocol-Version': '2026-07-28',
'Mcp-Method': method,
},
headers,
body: JSON.stringify({
jsonrpc: '2.0',
id: `oauth-smoke-${method}`,
Expand Down