Skip to content

🐛 mcp-chat: Azure OpenAI Models Not Working #8387

@MattiaDellOca

Description

@MattiaDellOca

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. Currently, the plugin always calls:

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:

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:

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:
mcpChat:
  providers:
    - id: openai
      baseUrl: 'https://xxx.openai.azure.com/openai/deployments/yyy/'
      token: 'zzz'
      model: gpt-4o-mini
  1. 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?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions