deploy_html
Publish HTML content and obtain a public URL using the EdgeOne Pages MCP. Simplify content deployment by uploading markup and accessing it instantly via a generated link.
Instructions
Deploy HTML content to EdgeOne Pages, return the public URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | Provide the full HTML markup you wish to publish. After deployment, the system will generate and return a public URL where your content can be accessed. |
Implementation Reference
- index.ts:35-60 (registration)Registers the 'deploy_html' MCP tool, including description, input schema for HTML 'value', and thin wrapper handler that calls deployHtmlToEdgeOne and formats response.server.tool( 'deploy_html', 'Deploy HTML content to EdgeOne Pages, return the public URL', { value: z.string().describe( `Provide the full HTML markup you wish to publish. After deployment, the system will generate and return a public URL where your content can be accessed.` ), }, async ({ value }) => { try { const result = await deployHtmlToEdgeOne(value); return { content: [ { type: 'text' as const, text: result, }, ], }; } catch (e) { return handleUncaughtError(e); } } );
- index.ts:38-43 (schema)Zod input schema for the tool: 'value' parameter as string containing full HTML markup.{ value: z.string().describe( `Provide the full HTML markup you wish to publish. After deployment, the system will generate and return a public URL where your content can be accessed.` ), },
- tools/deploy_html.ts:71-80 (handler)Primary exported handler function for deploying HTML: retrieves base URL, invokes core deployHtml function, returns the public deployment URL.export const deployHtmlToEdgeOne = async (html: string): Promise<string> => { try { const baseUrl = await getBaseUrl(); const url = await deployHtml(html, baseUrl); return url; } catch (e) { console.error('Error deploying HTML:', e); throw e; } };
- tools/deploy_html.ts:50-66 (handler)Core HTTP POST handler: sends HTML payload to EdgeOne Pages API endpoint with installation ID, extracts and returns the generated URL.async function deployHtml(value: string, baseUrl: string): Promise<string> { const res = await fetch(baseUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Installation-ID': installationId, }, body: JSON.stringify({ value }), }); if (!res.ok) { throw new Error(`[deployHtml] HTTP error: ${res.status} ${res.statusText}`); } const { url } = await res.json(); return url; }
- tools/deploy_html.ts:38-45 (helper)Helper function to fetch the current EdgeOne Pages deployment base URL from configuration endpoint.async function getBaseUrl(): Promise<string> { const res = await fetch('https://mcp.edgeone.site/get_base_url'); if (!res.ok) { throw new Error(`[getBaseUrl] HTTP error: ${res.status} ${res.statusText}`); } const data = await res.json(); return data.baseUrl; }