페이로드 v4: MCP 플러그인은 컬렉션을 LLM에 노출하고 옵트아웃됩니다

작성자

카테고리:

← 피드로
DEV Community · Kacper Zawojski · 2026-06-26 개발(SW)

Kacper Zawojski

@payloadcms/plugin-mcp turns your Payload CMS into an MCP server, exposing your collections as tools for LLMs.

Heads up for v4: after a refactor, every collection is now exposed with full CRUD by default. It’s opt-out — you disable individual tools rather than enabling them:

mcpPlugin({
  collections: {
    // posts is exposed automatically — no entry needed
    users: { tools: { create: false, update: false, delete: false } }, // find only
  },
})

Enter fullscreen mode Exit fullscreen mode

Custom tools are defined with the defineTool builder, taking input via zod v4:

tools: {
  getPostScores: defineTool({
    description: 'Score recent posts',
    input: z.object({ since: z.string() }),
  }).handler(async ({ input, req }) => ({ content: [/* ... */] })),
}

Enter fullscreen mode Exit fullscreen mode

⚠️ The thing to actually do after upgrading: collections you never listed are suddenly reachable through MCP. Review them and disable anything sensitive — an exposed users collection with delete is not a great default to inherit by accident.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다