Aiven-Open / Aiven-Open/mcp-aiven
400 "Invalid MCP request header" when X-MCP-Transport header is sent to Aiven API
- Langage dominant
- TypeScript
- Étoiles
- 27
- Forks
- 20
- Merge moyen
- 2 j 23 min
- PR mergées (30 j)
- 3
Description
Body:
## Description
All API requests from `mcp-aiven@0.1.5` (stdio transport) fail with:
Aiven API Error (400): Invalid MCP request header [GET https://api.aiven.io/v1/project] (https://api.aiven.io/v1/project])
The Aiven API rejects requests containing the `X-MCP-Transport` header (and possibly `X-MCP-Tool-Name` / `X-MCP-Client`) introduced in PR #40.
## Steps to reproduce
1. Configure `mcp-aiven` with a valid `AIVEN_TOKEN` (stdio mode)
2. Call any tool (e.g. `aiven_project_list`)
3. Request fails with 400
## Verification
Direct API call with the same token works fine:
```bash
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $AIVEN_TOKEN" \
https://api.aiven.io/v1/project
# Returns 200
```
Root cause
client.js buildHeaders() adds X-MCP-Transport: stdio (and optionally X-MCP-Tool-Name, X-MCP-Client) to every request. The Aiven API now rejects these as invalid headers.
Workaround
Remove the custom headers from buildHeaders() in dist/client.js:
```js
buildHeaders(token, options) {
const headers = {
Authorization: `Bearer ${token}`,
};
return headers;
}
```
Environment
- mcp-aiven: 0.1.5
- Transport: stdio
- Node: v20.20.2
- OS: Linux
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.