tmphost.io ephemeral static file hosting for ai agents

MCP tools

The MCP server at https://mcp.tmphost.io/mcp has one tool, file, with four actions: upload, download, get and url.

When to use MCP

Every byte of a file passes through the model's context as a tool argument or result. If the agent can run shell commands, the CLI uploads from disk instead and keeps large files out of the context. Use MCP when there is no shell, or for small files the agent has just written.

For text files (.html, .css, .js, .md, .json, .svg, .txt) set format to textContent and send the text as is. It is a third smaller than base64 and stays readable. Use base64Content only for binary files.

Connect

The server speaks streamable HTTP. Add it to any MCP client; clients that support OAuth open the browser to sign in through app.tmphost.io the first time they connect.

MCP client config (JSON)
{
  "mcpServers": {
    "tmphost": {
      "type": "http",
      "url": "https://mcp.tmphost.io/mcp"
    }
  }
}
Claude Code
$ claude mcp add --transport http tmphost https://mcp.tmphost.io/mcp

Arguments

ArgumentDescription
actionRequired. upload, download, get or url.
idFolder id. upload without it creates a new folder; with it, adds or replaces files in that folder. Required by the other actions.
ttlLifetime of a new folder in whole minutes, such as 30m or 2h (default 30m). upload only, and only without id.
fileNameFile name, without directories, such as index.html.
pathDirectory inside the folder, such as site/css, at most 5 levels. Empty for the folder root.
formatWhich field carries the content: base64Content (default) or textContent. upload and download only.
textContentUTF-8 text content, as is. upload with format: "textContent".
base64ContentBase64 content. upload with format: "base64Content".

Result fields

Each action fills its part; empty fields are left out.

FieldDescription
idThe folder id. Keep it to add files later.
urlPublic URL of the file (upload), the folder (get) or what url asked for.
expiresAtWhen the folder is deleted, RFC 3339 in UTC. upload returns it only for a new folder.
fileName, path, sizeThe file's name, directory and size in bytes.
creditsSpentCredits the upload cost.
textContent, base64ContentThe downloaded file, in the field format named.
filesget: every file as fileName, path, size, url.

Examples

The ids, times and URLs below are examples; take the real ones from each result.

Upload an HTML page as text, in a new folder

Call file
{
  "action": "upload",
  "ttl": "2h",
  "fileName": "index.html",
  "format": "textContent",
  "textContent": "<!doctype html><title>Report</title><link rel=\"stylesheet\" href=\"css/style.css\"><h1>Q3 report</h1>"
}
Result
{
  "id": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/index.html",
  "expiresAt": "2026-10-19T23:08:00Z",
  "fileName": "index.html",
  "size": 98,
  "creditsSpent": 4
}

A file under 1 MB in a 2 hour folder costs 1 × 4 = 4 credits. Because index.html is at the root, the folder URL https://k7q2m9xa.file.tmphost.io/ serves the page too.

Add a stylesheet to the same folder, in a directory

Call file
{
  "action": "upload",
  "id": "k7q2m9xa",
  "path": "css",
  "fileName": "style.css",
  "format": "textContent",
  "textContent": "body{font:16px/1.5 system-ui;margin:40px}"
}
Result
{
  "id": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/css/style.css",
  "fileName": "style.css",
  "path": "css",
  "size": 41,
  "creditsSpent": 4
}

With id, leave out ttl: the folder keeps its expiry, and the cost counts its remaining lifetime.

Upload an image as base64

Call file
{
  "action": "upload",
  "id": "k7q2m9xa",
  "path": "img",
  "fileName": "logo.png",
  "base64Content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
}
Result
{
  "id": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/img/logo.png",
  "fileName": "logo.png",
  "path": "img",
  "size": 70,
  "creditsSpent": 4
}

format defaults to base64Content, so it can be left out here.

Replace a file in place

Upload to the same id, path and fileName again. The URL stays https://k7q2m9xa.file.tmphost.io/index.html, so a link already shared shows the new version.

Call file
{
  "action": "upload",
  "id": "k7q2m9xa",
  "fileName": "index.html",
  "format": "textContent",
  "textContent": "<!doctype html><title>Report</title><link rel=\"stylesheet\" href=\"css/style.css\"><h1>Q3 report (final)</h1>"
}

List a folder's files

Call file
{ "action": "get", "id": "k7q2m9xa" }
Result
{
  "id": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/",
  "expiresAt": "2026-10-19T23:08:00Z",
  "files": [
    { "fileName": "style.css", "path": "css", "size": 41, "url": "https://k7q2m9xa.file.tmphost.io/css/style.css" },
    { "fileName": "logo.png", "path": "img", "size": 70, "url": "https://k7q2m9xa.file.tmphost.io/img/logo.png" },
    { "fileName": "index.html", "path": "", "size": 106, "url": "https://k7q2m9xa.file.tmphost.io/index.html" }
  ]
}

Get a URL

The URL of a folder (id), a directory (id, path, ending with /) or a file (id, fileName, optional path). The file does not have to exist yet.

Call file
{ "action": "url", "id": "k7q2m9xa", "path": "img", "fileName": "logo.png" }
Result
{
  "id": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/img/logo.png",
  "expiresAt": "2026-10-19T23:08:00Z",
  "fileName": "logo.png",
  "path": "img"
}

Download a text file

Call file
{ "action": "download", "id": "k7q2m9xa", "path": "css", "fileName": "style.css", "format": "textContent" }
Result
{
  "id": "k7q2m9xa",
  "fileName": "style.css",
  "path": "css",
  "size": 41,
  "textContent": "body{font:16px/1.5 system-ui;margin:40px}"
}

A download as textContent fails for a file that is not UTF-8 text; download it with format: "base64Content" instead.

Errors

A failed call returns an error message that says what to change:

MessageFix
textContent needs format textContentAdd "format": "textContent", or send base64Content.
base64Content must be base64Send standard base64, or the text itself as textContent.
ttl only applies to a new folder: leave out id or ttlA folder's expiry is set when it is created.
ttl must be whole minutes, such as 30m or 2hUse a duration like 45m or 6h.
fileName is required and must not contain /Put directories in path.
the file is not UTF-8 text: download it with format base64ContentUse base64Content for binary files.