tmphost.io ephemeral static file hosting for ai agents

MCP tools

The MCP server at https://mcp.tmphost.io/mcp has one tool per operation: uploadFile, downloadFile, listFiles, getUrl, extendFolder and addPinToFolder. Each takes the folder as folderId.

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 and is stateless: it offers the tools below and the tmphost skill, and sends no notifications. 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.

Opened in a browser, https://mcp.tmphost.io/mcp shows a setup page with the URL and the tools. Its manifest, the MCP Registry server.json named io.github.tmphost/tmphost, is at https://mcp.tmphost.io/.well-known/mcp.json and https://tmphost.io/.well-known/mcp.json.

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

Tools

Each tool takes only its own arguments and returns its own fields as structured content, described by an output schema; empty fields are left out. The read-only tools are annotated as such, so clients can run them without asking.

ToolWhat it doesKind
uploadFileStores a file in a new folder, or in an existing one with folderId, and returns its URL.Writes, spends credits
downloadFileReads a file back as base64Content or textContent, free of credits.Read-only
listFilesLists a folder's files with their URLs, and the folder's URL and expiry.Read-only
getUrlBuilds the URL of a folder, directory or file without uploading; with pin, a link that carries the PIN.Read-only
extendFolderMakes a folder expire later.Writes, spends credits
addPinToFolderGives a folder a new 6 digit PIN that visitors must enter.Writes

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

uploadFile

Stores one file and returns its public URL. Without folderId it creates a new folder; with it, the file goes into that folder, and a file already at the same path is replaced in place.

ArgumentDescription
folderIdFolder to add the file to or replace it in. Leave out to create a new folder.
fileNameRequired. File 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.
textContentUTF-8 text content, as is, with format: "textContent".
base64ContentBase64 content, with format: "base64Content" or no format.
ttlNew folder only: its lifetime in whole minutes, such as 30m or 2h (default 30m).
pinNew folder only: true gives it a 6 digit PIN visitors must enter (folder PIN).
Result fieldDescription
folderIdThe folder id, new or as passed in. Pass it to add more files or to the other tools.
urlPublic URL of the file, working until the folder expires. Give it to the user.
fileName, path, sizeThe file's name, directory and size in bytes.
creditsSpentCredits the upload cost: 1 per started MB of the file per started 30 minutes of the folder's remaining lifetime.
expiresAtOnly when this call created the folder: when it is deleted, RFC 3339 in UTC. For an existing folder, listFiles or getUrl return it.
pinModeOnly when this call created the folder and a PIN guards it: folder for its own PIN, static or totp for the owner's account PIN.
pinThe folder's own PIN, only from the call that made it. Give it to the user with the URL: it can't be read back later.

Upload an HTML page as text, in a new folder

Call uploadFile
{
  "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
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/index.html",
  "fileName": "index.html",
  "path": "",
  "size": 98,
  "creditsSpent": 4,
  "expiresAt": "2026-10-25T23:08:00Z"
}

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 uploadFile
{
  "folderId": "k7q2m9xa",
  "path": "css",
  "fileName": "style.css",
  "format": "textContent",
  "textContent": "body{font:16px/1.5 system-ui;margin:40px}"
}
Result
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/css/style.css",
  "fileName": "style.css",
  "path": "css",
  "size": 41,
  "creditsSpent": 4
}

With folderId, leave out ttl and pin: the folder keeps its expiry, and the cost counts its remaining lifetime. Use extendFolder or addPinToFolder to change them.

Upload an image as base64

Call uploadFile
{
  "folderId": "k7q2m9xa",
  "path": "img",
  "fileName": "logo.png",
  "base64Content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
}
Result
{
  "folderId": "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 folderId, path and fileName again. The URL stays https://k7q2m9xa.file.tmphost.io/index.html, so a link already shared shows the new version.

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

downloadFile

Reads back a file in one of your folders, such as to check an upload or to edit a page and upload it again. It costs no credits and changes nothing. To share a file, give its url instead.

ArgumentDescription
folderIdRequired. The folder id, as uploadFile returned it, such as k7q2m9xa.
fileNameRequired. File name, without directories, as listFiles returns it.
pathDirectory inside the folder that holds the file, as listFiles returns it. Leave out for the folder root.
formatWhich field gets the content: base64Content (default) or textContent.

The result has folderId, fileName, path, size in bytes and the content in the field format named (an empty string for an empty file).

Call downloadFile
{ "folderId": "k7q2m9xa", "path": "css", "fileName": "style.css", "format": "textContent" }
Result
{
  "folderId": "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.

listFiles

Lists the files in one of your folders. It takes only folderId, and returns the folder's url, expiresAt, pinMode when a PIN guards it, and files, sorted by full path (an empty array for an empty folder): each with fileName, path, size, url and agent, what last wrote it (the OAuth client's name, or Web for the web app). Pass a file's fileName and path to downloadFile or getUrl.

Call listFiles
{ "folderId": "k7q2m9xa" }
Result
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/",
  "expiresAt": "2026-10-25T23:08:00Z",
  "files": [
    { "fileName": "style.css", "path": "css", "size": 41, "url": "https://k7q2m9xa.file.tmphost.io/css/style.css", "agent": "Claude Code" },
    { "fileName": "logo.png", "path": "img", "size": 70, "url": "https://k7q2m9xa.file.tmphost.io/img/logo.png", "agent": "Claude Code" },
    { "fileName": "index.html", "path": "", "size": 106, "url": "https://k7q2m9xa.file.tmphost.io/index.html", "agent": "Claude Code" }
  ]
}

getUrl

Builds the URL of a folder (folderId), a directory (folderId, path, ending with /) or a file (folderId, fileName, optional path) without uploading anything. It doesn't check that the directory or file exists: use listFiles for that.

ArgumentDescription
folderIdRequired. The folder id, as uploadFile returned it.
pathDirectory inside the folder to link to, or that holds fileName. Leave out for the folder root.
fileNameFile name. Leave out for the URL of the folder or of path.
pinThe folder's PIN, as uploadFile or addPinToFolder returned it. The URL then carries it as ?pin=, so visitors skip the PIN page. Only for pinMode folder or static.

The result has folderId, url (a folder or directory URL ends with /), expiresAt, when the link stops working, fileName and path when set, and pinMode when a PIN guards the folder.

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

The server keeps only a hash of a PIN, so it can't add one to a URL by itself, and it doesn't check the pin you pass: pass the right one to get a link that opens without asking. It works for a folder PIN or a static account PIN, not for authenticator codes, which expire within a minute.

Call getUrl
{ "folderId": "k7q2m9xa", "pin": "590274" }
Result
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/?pin=590274",
  "expiresAt": "2026-10-25T23:08:00Z",
  "pinMode": "folder"
}

extendFolder

Makes a folder expire later. folderId and extendBy, the time to add in whole minutes such as 1h or 90m, are both required. The remaining lifetime can't go past the max TTL. It costs, for each file in the folder, 1 credit per started MB per started 30 minutes of the added time; an empty folder is free. Without enough credits it fails and adds no time.

The result has folderId, the folder's url (unchanged), its new expiresAt and creditsSpent (0 for an empty folder).

Call extendFolder
{ "folderId": "k7q2m9xa", "extendBy": "1h" }
Result
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/",
  "expiresAt": "2026-10-26T00:08:00Z",
  "creditsSpent": 6
}

Three files under 1 MB for one more hour cost 3 × 1 × 2 = 6 credits. Keep the 30 minute default on upload and extend while the folder is still in use: an expired folder can't be brought back.

addPinToFolder

Gives a folder a new random 6 digit PIN that visitors must enter, and replaces its old one: any older PIN stops working. It takes only folderId. The result has folderId, url (unchanged), expiresAt (unchanged), pinMode (always folder) and pin, shown only this once: give it to the user, or pass it to getUrl. It fails while the owner's account PIN guards every folder. See folder PIN.

Call addPinToFolder
{ "folderId": "k7q2m9xa" }
Result
{
  "folderId": "k7q2m9xa",
  "url": "https://k7q2m9xa.file.tmphost.io/",
  "expiresAt": "2026-10-25T23:08:00Z",
  "pinMode": "folder",
  "pin": "590274"
}

The tmphost skill

The server also serves the tmphost Agent Skill: best practices for these tools, such as what not to upload, text versus base64, sharing a site or several files, updating files in place, PINs, Markdown as a page, what to reply and credits. Clients that support the MCP Skills extension (io.modelcontextprotocol/skills) find it with skills/list; any client can read it as a resource.

RequestWhat it returns
skills/list, skills/getThe skill's URI, its frontmatter (name, description) and its files with their size and SHA-256 digest.
resources/readskill://tmphost/SKILL.md, the skill itself, as Markdown.
resources/directory/readThe files in a skill directory, such as skill://tmphost (no trailing slash).

The server's instructions tell agents to load it before a multi-file site, a PIN-guarded folder or an update to shared files. The plugins ship the same skill.

Errors

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

MessageFix
textContent needs format textContentAdd "format": "textContent", or send base64Content.
base64Content needs format base64ContentLeave out "format": "textContent", or send the text as textContent.
base64Content must be base64Send standard base64, or the text itself as textContent.
ttl and pin only apply to a new folder: leave out folderId, or use extendFolder or addPinToFolderA folder's expiry and PIN are set when it is created; change them with the other tools.
ttl must be whole minutes, such as 30m or 2hUse a duration like 45m or 6h. The same goes for extendBy.
extendBy is required: the time to add, such as 1hPass extendBy to extendFolder.
folderId must be a folder idPass the folderId from an earlier result, such as k7q2m9xa.
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.
no PIN guards the folder: leave out pingetUrl only takes pin for a PIN-guarded folder.
an authenticator code expires within a minute: leave out pin and let visitors enter a current codeUnder an authenticator (totp) account PIN, share the plain URL.
the account pin guards this folderaddPinToFolder doesn't apply while the account PIN is on: the folder is already guarded.