A Go-based MCP (Model Context Protocol) server that shares HTML content via Google Cloud Storage. Upload HTML and get back a public URL.
An LLM can use this tool to create and share web content:
User: "Create a data visualization showing monthly sales trends and share the URL"
Assistant: "I'll create an interactive chart and upload it for you"
{
"tool": "share-html",
"arguments": {
"html_content": "<html>... chart content ...</html>",
"short_name": "sales-trends-2024"
}
}Result: https://storage.cloud.google.com/your-bucket/sales-trends-2024-a1b2c3d4.html
docker run -p 8080:8080 -p 9090:9090 \
-e GOOGLE_APPLICATION_CREDENTIALS=/creds/credentials.json \
-v /path/to/credentials.json:/creds/credentials.json \
ghcr.io/loveholidays/mcp-html-share:latest \
--bucket=your-bucket-nameDownload from releases or install via Homebrew:
brew tap loveholidays/tap
brew install mcp-html-shareRun the server:
mcp-html-share --bucket=your-bucket-name --transport=http-
Create a GCS bucket:
gcloud storage buckets create gs://your-bucket-name --location=US
-
For public URLs (default):
gcloud storage buckets add-iam-policy-binding gs://your-bucket-name \ --member=allUsers \ --role=roles/storage.objectViewer
-
Set up authentication (choose one):
- Service Account:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json - Application Default:
gcloud auth application-default login
- Service Account:
--bucket(required): GCS bucket name--transport:http(default in Docker) orstdio(for Claude Desktop)--http-port: HTTP port (default: "8080")--health-port: Health/metrics port (default: "9090")--public-url: Return public URLs (default: true) or signed URLs (false)
Upload HTML content and get a public URL.
Request:
{
"tool": "share-html",
"arguments": {
"html_content": "<html><body><h1>Hello World</h1></body></html>",
"short_name": "hello-world"
}
}Response:
{
"url": "https://storage.cloud.google.com/your-bucket/hello-world-12345678.html"
}Add to your Claude Desktop configuration:
{
"mcpServers": {
"html-share": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-mcp-html-share-server.example.com"
]
}
}
}For local development with stdio:
{
"mcpServers": {
"html-share": {
"command": "mcp-html-share",
"args": ["--bucket", "your-bucket-name", "--transport", "stdio"]
}
}
}- MCP Server:
http://localhost:8080(when using--transport=http) - Health:
GET http://localhost:9090/livez - Metrics:
GET http://localhost:9090/metrics(Prometheus format)
# Clone and build
git clone https://github.com/loveholidays/mcp-html-share
cd mcp-html-share
make build
# Run tests
make test
# Run locally
make run-http BUCKET=your-bucket-nameLGPL-3.0 - see LICENSE file.