Skip to content

Commit 9d239b7

Browse files
committed
fix: throw APIError instead of AuthenticationError
1 parent 175a65e commit 9d239b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/plugin-mcp/src/endpoint

packages/plugin-mcp/src/endpoint/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/server'
2-
import { AuthenticationError, type PayloadHandler } from 'payload'
2+
import { APIError, type PayloadHandler } from 'payload'
33

44
import { buildMcpServer } from '../mcp/buildMcpServer.js'
55
import { getPluginConfig } from '../utils/getPluginConfig.js'
66
import { getAuthorizedMCP } from './access.js'
77

88
export const mcpEndpoint: PayloadHandler = async (req) => {
99
if (!req.url) {
10-
throw new AuthenticationError()
10+
throw new APIError('Missing request URL', 400)
1111
}
1212

1313
req.payloadAPI = 'MCP' as const

0 commit comments

Comments
 (0)