Skip to main content
Glama

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
NameRequiredDescriptionDefault
valueYesProvide 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); } } );
  • 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.` ), },
  • 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; } };
  • 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; }
  • 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; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TencentEdgeOne/edgeone-pages-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server