Getting HTTP/2 401 error
Dhruv Tiwari
I am running the following command to test the gateway server and betting 401 error, tried multiple times but still failing, help me how to fix this?
curl -i -X POST https://stormmcp.ai/gateway/62721f47-0b9a-4525-a4ce-97a94bf46031/mcp \
-H "Authorization: Bearer ag_Kq0e/cqtT0Wau3A06AbYYIPIN7F5V76UqkYMZ2JJzUk=" \
-H "Content-Type: application/json" \
-d '{"app": "DateTime", "action": "now", "params": {}}'
Thor
Hey Dhruv! :)
There's one small change you need to make, the header of "Authorization: Bearer..." would be for an OAuth token.
If you're using the API key approach, use the header of "X-API-Key: {{API Key}}
## If you're looking to just test the connection:
```bash
curl -i -X POST https://stormmcp.ai/gateway/62721f47-0b9a-4525-a4ce-97a94bf46031/mcp \
-H "X-API-Key: ag_Kq0e/cqtT0Wau3A06AbYYIPIN7F5V76UqkYMZ2JJzUk=" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"id": "1",
"params": {
"protocolVersion": "0.1.0",
"clientInfo": {
"name": "curl-client",
"version": "1.0.0"
}
}
}'
## The 3 changes you need to make:
- Change header from:"Authorization: Bearer"to:"X-API-Key:"
- Add:"Accept: application/json"header
- Change the JSON payloadto the JSON-RPC format shown above
If you get a successful response (should return server info with a 200 status), then the connection works. The response should look something like:
```json
{"result":{"protocolVersion":"2025-06-18","capabilities":{"logging":{},"tools":{}},"serverInfo":{"name":"Airia MCP Gateway","version":"1.0.0"}},"id":"1","jsonrpc":"2.0"}
```