Replies: 3 comments 1 reply
-
This is the mcp_config.json that I have: { But I am getting the error as Error: failed to initialize server: <truncated 10 bytes> ing automatically selected callback port: 12644 [45916] Using custom headers: {"x-api-key":"","Content-Type":" application/json"} [45916] [45916] Connecting to remote server: https://{api-id}.execute-api.{region}.amazonaws.com/{stage}/mcp [45916] Using transport strategy: http-first [45916] Connection error: Error: Error POSTing to endpoint (HTTP 403): {"message":"Missing Authentication Token"} at StreamableHTTPClientTransport.send (file:///Users/ngkokteng/.nvm/versions/node/v18.20.8/lib/node_modules/mcp-remote/dist/chunk-OUCHRS4S.js:6558:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [45916] Fatal error: Error: Error POSTing to endpoint (HTTP 403): {"message":"Missing Authentication Token"} at StreamableHTTPClientTransport.send (file:///Users/ngkokteng/.nvm/versions/node/v18.20.8/lib/node_modules/mcp-remote/dist/chunk-OUCHRS4S.js:6558:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5): server terminated. Click here to change your configuration. Do I define something wrong in my config? @shahar4499 would you mind sharing your opinion? It will be really helpful for me, thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
the "Missing Authentication Token" error from API Gateway means your AWS Lambda + API Gateway endpoint isn’t matching the path you’re hitting from your MCP config. When you deploy FastAPI to Lambda via API Gateway, API Gateway expects:
If any of those are wrong, API Gateway returns 403 Missing Authentication Token. From your config: "https://{api-id}.execute-api.{region}.amazonaws.com/{stage}/mcp" That means your Lambda handler must be behind a route /mcp in API Gateway. If your API Gateway doesn’t have /mcp configured (or it’s just /), this request will 403. |
Beta Was this translation helpful? Give feedback.
-
The error message This error specifically in AWS API Gateway can also indicate:
Something else I am seeing that maybe is causing it is in your error logs I see the following:
Notice that there is a space here when there should not be.. Looking at this stackoverflow post, it seems like this issue has caused other users API access errors due to accidental space addition in their code (PHP in the stackoverflow post). This might also be worth a shot to look into. Last thing I can add is to first troubleshoot; make sure the API endpoint is working as intended:
Please let me know if any of these helped you as I am curious if i was able to pinpoint your problem.. @KokTeng00 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, can I ask is it possible to deploy the fastapi_mcp in the aws lambda and access the endpoint through my IDE with the defined mcp_config.json?
Beta Was this translation helpful? Give feedback.
All reactions