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

# events

# `fastmcp.cli.events`

`fastmcp experimental events`: list a server's event types and watch one as it fires.

Experimental: this command may change in any release without a deprecation period.

## Functions

### `list_events_command` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/cli/events.py#L86](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/cli/events.py#L86)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
list_events_command(server_spec: ServerSpec = None) -> None
```

List the event types a server offers.

**Examples:**

```
fastmcp experimental events list server.py
fastmcp experimental events list http://localhost:8000/mcp --json
```

### `watch_command` <sup>[https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp\_slim/fastmcp/cli/events.py#L141](https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/cli/events.py#L141)</sup>

```python theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
watch_command(server_spec: ServerSpec = None, name: Annotated[str, cyclopts.Parameter(help='Event type to subscribe to')] = '', *arguments: str) -> None
```

Subscribe to an event type and print each event as it arrives.

Arguments are key=value pairs, coerced with the event type's input
schema. The watch runs until interrupted (or `--count` events), then
prints the cursor to resume from.

**Examples:**

```
fastmcp experimental events watch server.py alert.fired
fastmcp experimental events watch server.py alert.fired severity=P1 --json
fastmcp experimental events watch http://localhost:8000/mcp alert.fired --cursor 42
```


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