EdgeOne Pages MCP Server for Static HTML Deployment
Deploy static HTML with the MCP server to EdgeOne Pages and obtain a public URL for fast, secure content delivery.
npx -y @TencentEdgeOne/edgeone-pages-mcpOverview
EdgeOne Pages MCP Server is a lightweight utility that helps you deploy static HTML content to EdgeOne Pages using the Model Context Protocol (MCP). It runs locally or in CI, accepts a site directory or zip payload, pushes the content to the EdgeOne Pages backend, and returns a public URL so your static site can be served on EdgeOne’s global edge network. This approach is useful when you want a simple, scriptable way to publish static builds without a full CI/CD setup.
The server is designed for developers who need quick previews, temporary public links, or automated deployment in pipelines. It supports region/location selection so you can control where the site is hosted, and it exposes a minimal HTTP API that can be used by curl, local tools, or CI workflows.
Features
- Deploy static HTML (directory or zip) to EdgeOne Pages with a single HTTP request
- Returns a public URL for immediate content delivery
- Support for selecting deployment location/region
- Runs locally or inside containerized CI jobs
- Simple HTTP API compatible with curl and automated scripts
- Health and status endpoints for integration and monitoring
- Configurable via environment variables or CLI flags
Installation / Configuration
Clone the repository and run the server locally, or use Docker. The following examples assume the MCP server binary or container exposes an HTTP API on port 8080 by default.
Clone and build (example using Go; adjust to the repo’s build instructions):
# build step — replace with actual build steps in the repository
Run with environment variables:
# optional: controls hosting location/region
Docker:
# example Dockerfile (replace with repo-provided Dockerfile if available)
FROM golang:1.20-alpine AS build
WORKDIR /src
COPY . .
RUN go build -o /edgeone-mcp ./cmd/server
FROM alpine:3.18
COPY --from=build /edgeone-mcp /edgeone-mcp
EXPOSE 8080
ENTRYPOINT ["/edgeone-mcp"]
Run the image:
Environment variables / config (common):
- EDGEONE_TOKEN — API token or credentials to authenticate with EdgeOne Pages.
- EDGEONE_PROJECT — target Pages project or site identifier.
- LOCATION — desired hosting location/region (optional).
- MCP_PORT / PORT — port the local MCP server listens on.
- LOG_LEVEL — verbosity for diagnostics.
API Endpoints (typical)
The server exposes a few straightforward endpoints. Adjust host/port to your setup.
| Endpoint | Method | Description |
|---|---|---|
| /upload | POST | Upload static site (multipart/form-data or zip) and deploy to EdgeOne Pages. Returns JSON with a public URL. |
| /status | GET | Returns the current deployment status or last deployed metadata. |
| /health | GET | Health check for readiness and liveness. |
Example of a curl upload (directory zipped on the fly):
# Create a zip from the current directory and POST it
# response.json typically contains: { "id": "...", "url": "https://xyz.edgeone.pages/..." }
Available Tools / Resources
- GitHub repository: https://github.com/TencentEdgeOne/edgeone-pages-mcp — source, example configs, and Dockerfile.
- Example CI snippets: use the curl upload step in GitHub Actions, GitLab CI, or Jenkins to publish builds.
- Local debugging: health and status endpoints enable quick checks before integrating into pipelines.
- Logging and verbose modes: configure LOG_LEVEL for more insight into deployment steps and errors.
Use Cases
Quick previews during development
- Generate a production build (e.g., Hugo, Jekyll, Next export), zip it, and POST to the MCP server to obtain a short-lived or permanent public URL for sharing with teammates or QA.
Automated deployment in CI
- Add a job to your CI workflow that builds the static site, sends the artifacts to the MCP server, and records the returned URL in a pull request comment or deployment dashboard. Example (GitHub Actions step):
- name: Deploy to EdgeOne Pages via MCP run: | zip -r site.zip public curl -X POST "http://mcp.example.com/upload" \ -H "Authorization: Bearer ${{ secrets.EDGEONE_TOKEN }}" \ -F "project=prod-site" \ -F "[email protected]" \ -o response.json cat response.jsonTemporary share links for clients or stakeholders
- Create ephemeral deployments for marketing previews or client review without changing production DNS or CI pipelines.
Multi-region testing and compliance
- Use the LOCATION parameter when uploading to test content delivery from specific edge regions or to meet locality requirements.
Tips and Best Practices
- Keep API tokens secure: use CI secrets and environment variables rather than embedding tokens in code.
- Use zipping to ensure predictable uploads and faster transfer for many small files.
- Monitor the /health endpoint in orchestration platforms (Kubernetes, Docker Compose) to ensure the server is ready before sending builds.
- Add retries in CI steps for