# Gemini CLI extension

> The `tmphost` extension connects Gemini CLI to the tmphost.io MCP server and loads instructions into every session, so Gemini can host files at temporary public URLs when you ask it to share something.

HTML version: https://tmphost.io/docs/plugins/gemini/ · All plugins: https://tmphost.io/docs/plugins.md

## Install

```sh
gemini extensions install https://github.com/tmphost/tmphost
```

Gemini CLI installs extensions straight from a git URL. The manifest is `gemini-extension.json` at the root of the public repository https://github.com/tmphost/tmphost.

## What it adds

- **MCP server `tmphost`:** HTTP server at `https://mcp.tmphost.io/mcp` with the `file` tool: `upload`, `download`, `get`, `url`, `extend`, `pin` (https://tmphost.io/docs/mcp.md).
- **`GEMINI.md`:** context loaded into every session: when to use tmphost.io, each action, `textContent` for text files, multi-file sites, folder PINs, Markdown as a page and credits.

## Sign in

The server answers an unauthenticated request with `401`; Gemini CLI discovers the OAuth endpoints of https://app.tmphost.io from it and opens the browser. Sign in or sign up. To start the sign-in by hand:

```
/mcp auth tmphost
```

## Allow the tools

Gemini CLI asks before each tool call. To allow the tmphost.io tools without asking, add a policy file such as `~/.gemini/policies/tmphost.toml`:

```toml
[[rule]]
mcpName = "tmphost"
decision = "allow"
priority = 100
```

Uploads and extends spend credits, so allow them only if you are happy for Gemini to spend them unprompted.

## Try it

```
Host this HTML report and give me a link that works for an hour.
```

Gemini uploads the file into a new folder with `format: "textContent"` and answers with its URL, such as `https://k7q2m9xa.file.tmphost.io/report.html`, and when it expires. The id and URL here are examples.

For large or binary files, Gemini does better with the `tmphost` CLI (https://tmphost.io/docs/cli.md) in its shell: it uploads from disk without passing the bytes through the conversation. See https://tmphost.io/docs/plugins.md

## Self-hosted tmphost

Define a server named `tmphost` in `~/.gemini/settings.json` that points at your server's MCP URL. A server defined there takes precedence over the extension's:

```json
{
  "mcpServers": {
    "tmphost": { "type": "http", "url": "https://mcp.example.com/mcp" }
  }
}
```
