> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Hosted Server

> Connect AI assistants to Pinata's hosted MCP server at mcp.pinata.cloud, with nothing to install

The hosted Pinata MCP server runs at `https://mcp.pinata.cloud`. Point your AI assistant at that URL with your Pinata API key and it can manage your files, groups, links and payment instructions, with no Node.js and nothing to install or update.

## Hosted or local?

| | Hosted (`mcp.pinata.cloud`) | Local (`pinata-mcp` on npm) |
| - | - | - |
| Install | None: add a URL | Node.js 18+, runs with `npx` |
| Updates | Always current | Update the npm package |
| Files on your disk | Through a [signed upload URL](#uploading-files-from-your-disk) the assistant uploads to | Read directly (`uploadFile`, `uploadFolder`) from the directories you allow |
| Content the assistant writes | `uploadContent`, `uploadFolderContent`, up to 2 MiB | `uploadFile` with base64 content |
| Gateway | Found from your account (`listGateways`) | `GATEWAY_URL` environment variable |
| Works in | Any client that can send an `Authorization` header to a remote MCP server | Any client that can start a local MCP server |

Choose the local server when the assistant should read large files or whole directories from your disk on its own; choose the hosted server everywhere else.

## Before you start

You need an [API key](https://docs.pinata.cloud/account-management/api-keys.md) JWT. The tools act with that key's permissions: an admin key can use every tool, and a key [scoped to some endpoints](https://docs.pinata.cloud/account-management/api-keys.md) limits what the assistant can do. For example, a key that can only read files lets the assistant search and fetch, but not upload or delete. The key needs at least permission to read files. Every tool call counts against your API rate limits like a REST call made with the same key.

> [!WARNING]
>
> Your client stores the key and sends it on every request. Use a key made for this purpose, so you can revoke it on its own, and never paste it into a prompt.

The examples below read the key from an environment variable:

```bash theme={null}
export PINATA_JWT="<your API key JWT>"
```

## Connect your assistant

Every client needs the same two things:

* **URL:** `https://mcp.pinata.cloud` (Streamable HTTP transport)
* **Header:** `Authorization: Bearer <your API key JWT>`

Optionally, choose the [gateway](#gateways) links and fetches use by default: add an `X-Pinata-Gateway: <your gateway host>` header next to `Authorization`, or, in clients that can't set headers, put it in the URL as `https://mcp.pinata.cloud/?gateway=<your gateway host>`.

### Claude Code

```bash theme={null}
claude mcp add --transport http pinata https://mcp.pinata.cloud \
  --header "Authorization: Bearer $PINATA_JWT"
```

Add `--scope user` to use it in every project.

### Codex

Codex CLI and the Codex IDE extension share `~/.codex/config.toml`. Export `PINATA_JWT` before starting Codex.

```bash theme={null}
codex mcp add pinata --url https://mcp.pinata.cloud --bearer-token-env-var PINATA_JWT
```

### Cursor

In `~/.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "pinata": {
      "url": "https://mcp.pinata.cloud",
      "headers": { "Authorization": "Bearer ${env:PINATA_JWT}" }
    }
  }
}
```

### VS Code (GitHub Copilot)

In `.vscode/mcp.json`. VS Code asks for the key once and stores it securely.

```json theme={null}
{
  "inputs": [
    { "type": "promptString", "id": "pinata-jwt", "description": "Pinata API key JWT", "password": true }
  ],
  "servers": {
    "pinata": {
      "type": "http",
      "url": "https://mcp.pinata.cloud",
      "headers": { "Authorization": "Bearer ${input:pinata-jwt}" }
    }
  }
}
```

### Gemini CLI

In `~/.gemini/settings.json`:

```json theme={null}
{
  "mcpServers": {
    "pinata": {
      "httpUrl": "https://mcp.pinata.cloud",
      "headers": { "Authorization": "Bearer $PINATA_JWT" }
    }
  }
}
```

### Windsurf

In `~/.codeium/windsurf/mcp_config.json`:

```json theme={null}
{
  "mcpServers": {
    "pinata": {
      "serverUrl": "https://mcp.pinata.cloud",
      "headers": { "Authorization": "Bearer ${env:PINATA_JWT}" }
    }
  }
}
```

### Claude Desktop and claude.ai

Remote servers are added as custom connectors (**Settings → Connectors → Add custom connector**).

* **If the dialog has a Request headers section:** enter the URL, choose no sign-in, and add a header named `authorization` with the value `Bearer <your API key JWT>`, including `Bearer `. Add the connector to your own account: on Team and Enterprise plans, a connector an Owner adds for the organization sends the same header for every member, so everyone would act as one Pinata account.
* **Otherwise, in Claude Desktop**, connect through the `mcp-remote` bridge in `claude_desktop_config.json` (requires Node.js):

```json theme={null}
{
  "mcpServers": {
    "pinata": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.pinata.cloud", "--header", "Authorization:${AUTH_HEADER}"],
      "env": { "AUTH_HEADER": "Bearer <your API key JWT>" }
    }
  }
}
```

### ChatGPT and other sign-in-only clients

Clients that connect only by signing in to the server, with no way to set a header, are not supported yet: the hosted server needs the API key header.

### MCP Inspector

To see the tools and try them by hand:

```bash theme={null}
npx @modelcontextprotocol/inspector --cli https://mcp.pinata.cloud --transport http \
  --header "Authorization: Bearer $PINATA_JWT" --method tools/list
```

## Check the connection

Ask your assistant:

```
Test my Pinata authentication and list my gateways
```

It calls `testAuthentication`, which shows the account the key belongs to, and `listGateways`.

## Working with the hosted server

### Networks

Every file and group is on public or private IPFS.

* **Uploads ask for the network every time.** There is no default: public content can be read by anyone with the CID and can stay cached on other IPFS nodes after you delete it. Say which one you want in the prompt, or the assistant asks.
* **Searches, lists, new groups and links** also need it.
* **Tools that take a file or group ID** (get, update, delete, group membership) find the item on either network when you don't say which.

### Gateways

Link and fetch tools use your default gateway unless you name another one. The default is the one you set when connecting (`X-Pinata-Gateway` header or `?gateway=` in the URL), or else your account's first [dedicated gateway](https://docs.pinata.cloud/gateways/dedicated-ipfs-gateways.md) without [access controls](https://docs.pinata.cloud/gateways/gateway-access-controls.md). `listGateways` shows them all, with their custom domains, whether they have access controls, and which one is the default. You can name any of them, including a custom domain, in a prompt:

```
Create a public link for bafkrei... on files.example.com
```

The tools only use your own gateways: a host that isn't one of them is refused.

A public link through a gateway with access controls opens only with one of its access tokens or from its allowed hosts or IPs. For such a gateway, `createLink` also returns a `temporary_url` anyone can open until it expires (10 minutes by default, at most 7 days), so you can share a file even when all your gateways have access controls. The assistant can still read your files through such a gateway.

### Uploading content the assistant writes

`uploadContent` uploads one file and `uploadFolderContent` uploads a folder with one CID (a small website, a dataset, generated files) from content the assistant has in its context: text, JSON, or small binary files as base64. They take up to 2 MiB in total and a folder up to 150 files.

```
Write a one-page HTML site about our launch and upload it to Pinata as a public folder named launch-site, then give me the link
```

### Uploading files from your disk

The hosted server can't read your disk. For local files, or content over 2 MiB, the assistant creates a signed upload URL with `createSignedUploadUrl` and uploads to it from your machine, for example with `curl`:

* one file: `curl -F "file=@./photo.jpg" "<signed URL>"`
* a folder with one CID: one `file` field per file named `<folder>/<path>`, plus a `name` field with the folder name, up to 150 files

The URL lets anyone holding it upload to your account until it expires (at most 24 hours), so the assistant asks before creating one. For folders of more than 150 files or very large files, use the [local server](https://docs.pinata.cloud/tools/mcp/overview.md#local-server) or the [SDK](https://docs.pinata.cloud/sdk/getting-started.md).

### Reading file content

`fetchFromGateway` returns a file's content to the assistant: text up to 100 KB, other content up to 50 KB. For anything larger, ask for a link (`createLink`). Private links last 10 minutes by default and at most 7 days.

### Safety

* **File content is data, not instructions.** File names, key-values, fetched content and error messages can be written by anyone who uploaded a file. The server tells assistants to treat them as data, and marks fetched content as untrusted.
* **The assistant asks before acting for you** when it uploads from your disk, makes anything public, creates links or signed upload URLs, deletes anything, or sets where x402 payments go (`pay_to`). Deleting tools are marked as destructive, so clients that support it ask for confirmation.
* **Check `pay_to` yourself.** A payment instruction sends every payment to that wallet; confirm the address you give comes from you, never from a file or another tool's output.

### Limits

| | Limit |
| - | - |
| Inline uploads (`uploadContent`, `uploadFolderContent`) | 2 MiB in total; 150 files per folder |
| Folder paths | 250 characters and 14 segments, folder name included |
| Key-values | 9 per file; keys and values up to 250 characters |
| Group and pin names | 50 characters |
| Signed upload URLs | 24 hours |
| Private download links | 7 days (default 10 minutes) |
| `fetchFromGateway` | 100 KB of text, 50 KB of other content |

## Troubleshooting

| Answer | Meaning | Fix |
| - | - | - |
| `401` | The `Authorization` header is missing, or the key is invalid or revoked | Check the header starts with `Bearer `, and that the key exists on the [API Keys page](https://app.pinata.cloud/developers/api-keys) |
| `403` naming a scope or permission | The key lacks a permission the call needs | Use a key with that permission |
| `429` | Your API rate limit is reached | Wait for the `Retry-After` seconds, then retry |
| A tool error "gateway … responded 401" or "403" | That gateway refused the content: the network is wrong, or the CID isn't in your account and the gateway has access controls or is restricted | Check the file's network, or name another gateway from `listGateways` |
| A tool error "… is not one of your gateways" | The named host isn't one of your gateways or their custom domains | Use a host `listGateways` returns |

## Next steps

See the [Tools Reference](https://docs.pinata.cloud/tools/mcp/tools.md) for every tool with its parameters and example prompts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.