# MCP Server LLM model variables

**URL:** <https://community.dremio.com/t/mcp-server-llm-model-variables/13256>\
**Category:** Uncategorized\
**Created:** [November 11, 2025, 8:09pm UTC](https://community.dremio.com/t/mcp-server-llm-model-variables/13256 "2025-11-11T20:09:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vahide](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vahide](https://community.dremio.com/u/Vahide)\
**Post date:** [November 11, 2025, 8:09pm UTC](https://community.dremio.com/t/mcp-server-llm-model-variables/13256/1 "2025-11-11T20:09:22Z")

</div>

Hello,

We try to implement MCP server on our Dremio on-prem, we try to using Azure Open AI model gpt-4o .

According to documentation we first tried following parameters. but we received error message

```auto
OPENAI_API_KEY=your-openai-api-key
LLM_MODEL=openai:gpt-4.1
DETAILED_OUTPUT=false

Error:

Error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: 31mT4nEh ************************************************************************ ZGgp. You can 
find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Afterwords we tried following variables, ıt didn't work as well

AZURE_OPENAI_API_VERSION=2024-11-20
AZURE_OPENAI_ENDPOINT=https://vanopenaimcp.openai.azure.com
AZURE_OPENAI_API_KEY=XXXXX
LLM_MODEL=azure:gpt-4o
MODEL_PROVIDER=azure

Error :

  File "/home/dell/.local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 340, in _init_chat_model_helper
    model, model_provider = _parse_model(model, model_provider)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dell/.local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 524, in _parse_model
    raise ValueError(
ValueError: Unable to infer model provider for model='azure:gpt-4o', please specify model_provider directly.

This ticket includes a secure attachment. Use this link to access the attached files:
Package ID# CGCW-FD9J

```

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 17, 2025, 2:27am UTC](https://community.dremio.com/t/mcp-server-llm-model-variables/13256/2 "2025-11-17T02:27:09Z")

</div>

I can see the issues with both attempts. Let me help you configure Azure OpenAI correctly for the Dremio MCP server.

## Problem Analysis

**First attempt** : You used OpenAI configuration with an Azure API key, which won’t work because Azure OpenAI has a different endpoint structure.

**Second attempt** : The MCP server’s LangChain integration doesn’t properly parse `azure:gpt-4o` format.

## Correct Configuration for Azure OpenAI

Based on the Dremio MCP server implementation, here’s the proper configuration:

### Option 1: Using Azure-specific Environment Variables

bash

```auto
export AZURE_OPENAI_API_KEY="your-actual-azure-key"
export AZURE_OPENAI_ENDPOINT="https://vanopenaimcp.openai.azure.com"
export AZURE_OPENAI_API_VERSION="2024-11-20"
export AZURE_OPENAI_DEPLOYMENT="your-deployment-name" # IMPORTANT!
export LLM_MODEL="azure_chat_openai" # Use LangChain's Azure model identifier
export DETAILED_OUTPUT="false"

```

### Option 2: Alternative Format

bash

```auto
export AZURE_OPENAI_API_KEY="your-actual-azure-key"
export AZURE_OPENAI_ENDPOINT="https://vanopenaimcp.openai.azure.com"
export AZURE_OPENAI_API_VERSION="2024-11-20"
export AZURE_OPENAI_DEPLOYMENT="your-deployment-name"
export MODEL_PROVIDER="azure_openai"
export LLM_MODEL="gpt-4o" # Just the model name, not prefixed
export DETAILED_OUTPUT="false"

```

## Critical Points

1. **AZURE\_OPENAI\_DEPLOYMENT** : This is the **deployment name** you created in Azure Portal, NOT just “gpt-4o”. Go to Azure OpenAI Studio → Deployments to find your actual deployment name (e.g., “my-gpt4o-deployment”).

2. **LLM\_MODEL** : Should be either:

3. **Endpoint Format** : Should NOT include `/openai/deployments/...` - just the base endpoint.

## Find Your Azure Deployment Name

In Azure Portal:

1. Go to your Azure OpenAI resource

2. Click “Model deployments” or go to Azure OpenAI Studio

3. Look for your gpt-4o deployment - copy that exact name

## Test Configuration

Try this complete example:

bash

```auto
export AZURE_OPENAI_API_KEY="31mT4nEh...ZGgp"
export AZURE_OPENAI_ENDPOINT="https://vanopenaimcp.openai.azure.com"
export AZURE_OPENAI_API_VERSION="2024-11-20"
export AZURE_OPENAI_DEPLOYMENT="gpt-4o-deployment" # Replace with YOUR deployment name
export LLM_MODEL="azure_chat_openai"
export DETAILED_OUTPUT="false"

# Then start your MCP server
python -m dremio_mcp_server

```

**What’s your actual deployment name in Azure OpenAI Studio?** That’s likely the missing piece. Let me know if you’re still getting errors after adding the deployment name!

---

<div class="post-metadata">

**Author:** ![Vahide](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vahide](https://community.dremio.com/u/Vahide)\
**Post date:** [November 18, 2025, 8:51am UTC](https://community.dremio.com/t/mcp-server-llm-model-variables/13256/3 "2025-11-18T08:51:44Z")

</div>

Thank you very much for your reply, it helped al lot , issue has been solved.

I received another error, I will open a new case for the new error message.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 19, 2025, 5:02pm UTC](https://community.dremio.com/t/mcp-server-llm-model-variables/13256/4 "2025-11-19T17:02:08Z")

</div>

Thanks, will respond on the other thread!
