# Fastify MCP server

> A Fastify plugin that implements the Model Context Protocol to expose tools, resources, and prompts to AI clients via HTTP/SSE or stdio.

- Repository: https://github.com/platformatic/mcp
- Page: https://hostedmcp.org/servers/platformatic/mcp
- Transport: stdio
- Stars: 66
- License: Apache-2.0

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @platformatic/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@platformatic/mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@platformatic/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@platformatic/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@platformatic/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp -- npx -y @platformatic/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@platformatic/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @platformatic/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@platformatic/mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MCP_SECRET_KEY` | no | no |  |
| `REDIS_PASSWORD` | no | no |  |

## Tools (6)

- `app`
- `options`
- `debug`
- `input`
- `output`
- `error`

## FAQ

### How are sessions managed and expired?

Sessions expire after a configurable amount of time (defaulting to one hour) of inactivity. The Redis store uses key TTL, while the memory store uses a timer to sweep expired sessions.
