Add gateway overrides and quick sandbox deploy
This commit is contained in:
@@ -61,6 +61,30 @@ export async function buildSandboxMcpBrokerHandoff(
|
||||
token,
|
||||
"```",
|
||||
"",
|
||||
"## Quick Check",
|
||||
"",
|
||||
"Run this inside the sandbox to verify that you are using the current broker token without pasting it into your shell history:",
|
||||
"",
|
||||
"```sh",
|
||||
"node - <<'NODE'",
|
||||
"const fs = require('fs')",
|
||||
`const url = ${JSON.stringify(`${brokerBaseUrl}/mcp`)}`,
|
||||
"const manifest = fs.readFileSync('/sandbox/openshell_control_mcp.md', 'utf8')",
|
||||
"const token = manifest.match(/```\\n(osmcp_[^\\n]+)\\n```/)?.[1]",
|
||||
"if (!token) throw new Error('MCP broker token not found in /sandbox/openshell_control_mcp.md')",
|
||||
"const payload = { jsonrpc: '2.0', id: 1, method: 'tools/list', params: {} }",
|
||||
"fetch(url, {",
|
||||
" method: 'POST',",
|
||||
" headers: { 'content-type': 'application/json', authorization: `Bearer ${token}` },",
|
||||
" body: JSON.stringify(payload),",
|
||||
"})",
|
||||
" .then(async (response) => {",
|
||||
" const body = await response.json()",
|
||||
" console.log(JSON.stringify({ status: response.status, tools: body.result?.tools?.map((tool) => tool.name) || [], error: body.error || null }, null, 2))",
|
||||
" })",
|
||||
"NODE",
|
||||
"```",
|
||||
"",
|
||||
"## Rules",
|
||||
"",
|
||||
"- Do not assume any MCP server exists unless the broker returns it as available.",
|
||||
|
||||
Reference in New Issue
Block a user