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

# Notifications

> Send request-scoped and subscription notifications from MCP servers.

Notifications are one-way MCP messages. In the stateless 2026 protocol, a
server can send notifications related to an active request or publish the
standard list and resource changes that clients requested through
`subscriptions/listen`.

There is no session-targeted or arbitrary post-response push channel. Keep
custom status notifications inside the tool, resource, or prompt callback that
owns the active response stream.

## Choose the notification path

| Need                                                  | Use                                 |
| ----------------------------------------------------- | ----------------------------------- |
| Send a custom notification during the current request | `ctx.sendNotification(...)`         |
| Report progress for the current request               | `ctx.reportProgress(...)`           |
| Send a request-scoped MCP log message                 | `ctx.sendLog(...)`                  |
| Tell subscribed clients that tools changed            | `server.notifyToolsChanged()`       |
| Tell subscribed clients that prompts changed          | `server.notifyPromptsChanged()`     |
| Tell subscribed clients that resources changed        | `server.notifyResourcesChanged()`   |
| Tell subscribed clients that one resource changed     | `server.notifyResourceUpdated(uri)` |

## Notify the current client

Use `ctx.sendNotification(method, params?)` inside a callback. It preserves the
v1 method-and-params signature while using the official v2 request notification
channel.

Use an application namespace for custom methods so clients can route them
without colliding with standard MCP notifications.

```typescript theme={null}
server.tool(
  {
    name: "run-import",
    description: "Run an import and report its status to the caller.",
  },
  async (_params, ctx) => {
    await ctx.sendNotification("com.example/import-status", {
      status: "started",
      startedAt: new Date().toISOString(),
    });

    await runImport();

    await ctx.sendNotification("com.example/import-status", {
      status: "completed",
    });

    return {
      content: [{ type: "text", text: "Import complete." }],
    };
  },
);
```

The notification is delivered on the originating request's response stream
before its final result. Await it before returning from the callback. It cannot
be saved and reused to notify that client after the request finishes.

The receiving client registers a handler for the same custom method:

```typescript theme={null}
import { Client } from "@modelcontextprotocol/client";
import { z } from "zod";

const client = new Client({ name: "import-client", version: "1.0.0" });

client.setNotificationHandler(
  "com.example/import-status",
  { params: z.object({ status: z.string() }) },
  (params) => {
    console.log(params.status);
  },
);
```

## Publish list and resource changes

Cross-request invalidations use the server's subscription-backed helpers. Only
clients with an active `subscriptions/listen` request for the corresponding
notification type receive them.

```typescript theme={null}
await server.notifyToolsChanged();
await server.notifyPromptsChanged();
await server.notifyResourcesChanged();
await server.notifyResourceUpdated("config://settings");
```

These helpers are for registry and resource changes, not arbitrary custom
messages.

## Report progress

Use `ctx.reportProgress` when the current request has stages the client should
see. It returns `false` without sending anything when the caller did not supply
a progress token.

```typescript theme={null}
server.tool({ name: "process-data" }, async (_params, ctx) => {
  await ctx.reportProgress(0, 100, "Starting");
  await processStageOne();
  await ctx.reportProgress(50, 100, "Halfway");
  await processStageTwo();
  await ctx.reportProgress(100, 100, "Complete");

  return { content: [{ type: "text", text: "Done." }] };
});
```

## Send an MCP log message

`ctx.sendLog(level, data, logger?)` sends the standard
`notifications/message` notification on the active request. Modern clients
must opt in with a request log level; otherwise the SDK suppresses the message.

```typescript theme={null}
await ctx.sendLog("info", { imported: 42 }, "import-worker");
```

## Next steps

<CardGroup cols={2}>
  <Card title="Tool context API reference" icon="box" href="https://mcp-use-typescript-api-reference.vercel.app/modules/mcp-use.index.html#requestcontext">
    Look up `ctx.sendNotification`, `ctx.reportProgress`, and `ctx.sendLog`.
  </Card>

  <Card title="Resource subscriptions" icon="rss" href="/v2/typescript/server/subscriptions">
    Notify clients that subscribed resource content changed.
  </Card>

  <Card title="Client notifications" icon="monitor" href="/v2/typescript/client/notifications">
    Handle standard and custom notifications in a TypeScript MCP client.
  </Card>
</CardGroup>
