backstage / backstage/community-plugins
๐ mcp-chat: Azure OpenAI Models Not Working
- Dominant language
- TypeScript
- Stars
- 422
- Forks
- 697
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 286
Description
### Workspace
mcp-chat
### ๐ Description
However, when making requests against an Azure OpenAI deployment, the plugin fails with:
```
mcp-chat error [openai] Request failed (404) after 180ms responseData="{\"error\":{\"code\":\"404\",\"message\": \"Resource not found\"}}"
```
**Root cause:**
My Azure OpenAI `/chat/completions` endpoint requires a [mandatory `api-version` query parameter](https://learn.microsoft.com/en-us/azure/foundry/openai/reference#chat-completions). Currently, the plugin always calls:
- [`/chat/completions`](https://github.com/backstage/community-plugins/blob/main/workspaces/mcp-chat/plugins/mcp-chat-backend/src/providers/openai-provider.ts#L30)
without any way to include `api-version`, which causes the 404 error.
**Proposed solution:**
Allow specifying query parameters when calling the `/chat/completions` endpoint. For example:
```yaml
mcpChat:
providers:
- id: openai
baseUrl: 'https://xxx.openai.azure.com/openai/deployments/yyy/'
chatCompletionsQueryParameter: 'api-version=2024-10-21'
token: 'zzz'
model: gpt-4o-mini
```
Alternatively, if we only want to pass api-version:
```yaml
mcpChat:
providers:
- id: openai
baseUrl: 'https://xxx.openai.azure.com/openai/deployments/yyy/'
apiVersion: '2024-10-21'
token: 'zzz'
model: gpt-4o-mini
```
This would make the plugin compatible with older Azure OpenAI deployments.
### ๐ Expected behavior
I would expect Azure OpenAI to work when using the plugin
### ๐ Actual Behavior with Screenshots
```
mcp-chat error [openai] Request failed (404) after 180ms responseData="{\"error\":{\"code\":\"404\",\"message\": \"Resource not found\"}}"
```
### ๐ Reproduction steps
1. Configure the plugin with:
```yaml
mcpChat:
providers:
- id: openai
baseUrl: 'https://xxx.openai.azure.com/openai/deployments/yyy/'
token: 'zzz'
model: gpt-4o-mini
```
2. Send a message in the chat
### ๐ Provide the context for the Bug.
_No response_
### ๐ Have you spent some time to check if this bug has been raised before?
- [x] I checked and didn't find similar issue
### ๐ข Have you read the Code of Conduct?
- [x] I have read the [Code of Conduct](https://github.com/backstage/community-plugins/blob/main/CODE_OF_CONDUCT.md)
### Are you willing to submit PR?
Yes I am willing to submit a PR!
Contributor guide
Assessment
This issue has not been assessed yet.