Skip to content

feat(plugin-mcp): add support for server instructions#15858

Merged
paulpopus merged 5 commits intopayloadcms:mainfrom
jhb-dev:feat/mcp-server-instructions
Apr 16, 2026
Merged

feat(plugin-mcp): add support for server instructions#15858
paulpopus merged 5 commits intopayloadcms:mainfrom
jhb-dev:feat/mcp-server-instructions

Conversation

@jhb-dev
Copy link
Copy Markdown
Contributor

@jhb-dev jhb-dev commented Mar 5, 2026

What?

Adds an instructions option to the MCP plugin's MCPServerOptions type.

Why?

The MCP protocol supports an instructions field that is sent to clients during initialization. The Payload MCP plugin currently doesn't expose this option, so users have no way to provide instructions describing how to use the server and its features.

How?

  • Added instructions field to MCPServerOptions in types.ts
  • Pass instructions through to the MCP SDK via createMcpHandler in getMcpHandler.ts
mcpPlugin({
  collections: { ... },
  mcp: {
    serverOptions: {
      instructions: 'This server manages blog posts and pages.',
    },
  },
})

@kendelljoseph
Copy link
Copy Markdown
Contributor

Cool! Makes sense to me!

@paulpopus paulpopus merged commit c852d85 into payloadcms:main Apr 16, 2026
166 checks passed
milamer pushed a commit to milamer/payload that referenced this pull request Apr 20, 2026
### What?

Adds an `instructions` option to the MCP plugin's `MCPServerOptions`
type.

### Why?

The MCP protocol supports an `instructions` field that is sent to
clients during initialization. The Payload MCP plugin currently doesn't
expose this option, so users have no way to provide instructions
describing how to use the server and its features.

### How?

- Added `instructions` field to `MCPServerOptions` in `types.ts`
- Pass `instructions` through to the MCP SDK via `createMcpHandler` in
`getMcpHandler.ts`

```ts
mcpPlugin({
  collections: { ... },
  mcp: {
    serverOptions: {
      instructions: 'This server manages blog posts and pages.',
    },
  },
})
```

---------

Co-authored-by: Paul Popus <paul@payloadcms.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.84.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants