{"record":{"id":"4a411666289068b6","repo":"serverless/serverless","slug":"mcp-api-gateway-plugin-not-found","errorCode":"MCP_API_GATEWAY_PLUGIN_NOT_FOUND","errorMessage":"MCP servers are exposed through an API Gateway REST API, but the API Gateway compiler plugin was not found. This is an internal error - please report it at https://github.com/serverless/serverless/issues.","messagePattern":"MCP servers are exposed through an API Gateway REST API, but the API Gateway compiler plugin was not found\\. This is an internal error - please report it at https://github\\.com/serverless/serverless/issues\\.","errorType":"exception","errorClass":"ServerlessError","httpStatus":null,"severity":"error","filePath":"packages/serverless/lib/plugins/aws/mcp/index.js","lineNumber":133,"sourceCode":"        this.warnDeployFunctionSkipsEnvironment()\n        await this.repointFunctions(this.options.function)\n      },\n      // The staged file outlives the artifact it went into, so it is cleaned up\n      // per command run rather than per packaging event: `finalize` is the last\n      // thing a successful run does and `error` the last thing a failed one does\n      // (`../../../classes/plugin-manager.js`), which together cover `package`,\n      // `deploy` and `deploy function` without one hook per command. A hard\n      // crash still bypasses both - hence the deterministic staged name, which\n      // the next run overwrites.\n      finalize: () => this.unstageEntry(),\n      error: () => this.unstageEntry(),\n      'before:package:compileEvents': async () => {\n        if (!this.validated) return\n        const apiGatewayPlugin = this.serverless.pluginManager.plugins.find(\n          (plugin) => typeof plugin.registerExternalHttpEvents === 'function',\n        )\n        if (!apiGatewayPlugin) {\n          throw new ServerlessError(\n            'MCP servers are exposed through an API Gateway REST API, but the API Gateway compiler plugin was not found. This is an internal error - please report it at https://github.com/serverless/serverless/issues.',\n            'MCP_API_GATEWAY_PLUGIN_NOT_FOUND',\n            { stack: false },\n          )\n        }\n        // Built before anything is registered: this is the step that can\n        // refuse a configuration (a value Velocity would rewrite), and a\n        // refusal must not leave half a service's routes contributed.\n        const { descriptors, sources } = buildDiscoveryDescriptors({\n          servers: this.validated.servers,\n          provider: this.serverless.service.provider,\n          // The stage the REST API is deployed to, which is not the config\n          // stage when `provider.apiGateway.stage` renames it. The deployment's\n          // own `ServiceEndpoint` output is built from this same resolution\n          // (`../package/compile/events/api-gateway/lib/deployment.js`), so a\n          // document built from `getStage()` would advertise a URL that answers\n          // nothing while the summary printed the one that works.\n          stage: this.provider.getApiGatewayStage(),","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/packages/serverless/lib/plugins/aws/mcp/index.js#L115-L151","documentation":"Error \"MCP servers are exposed through an API Gateway REST API, but the API Gateway compiler plugin was not found. This is an internal error - please report it at https://github.com/serverless/serverless/issues.\" thrown in serverless/serverless.","triggerScenarios":"Thrown at packages/serverless/lib/plugins/aws/mcp/index.js:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report the issue at https://github.com/serverless/serverless/issues as this indicates a missing internal plugin.","Reinstall or upgrade the Serverless Framework in case the installation is corrupted."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}