image-proxy-mcp 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +7 -9
  2. package/package.json +2 -3
  3. package/.env.example +0 -35
package/index.js CHANGED
@@ -46,7 +46,7 @@ const CONFIG = {
46
46
  azureOpenAI: {
47
47
  endpoint: process.env.AZURE_OPENAI_ENDPOINT || "",
48
48
  apiKey: process.env.AZURE_OPENAI_API_KEY || "",
49
- apiVersion: process.env.AZURE_OPENAI_API_VERSION || "2024-02-01",
49
+ apiVersion: process.env.AZURE_OPENAI_API_VERSION || "2025-04-01-preview",
50
50
  },
51
51
  azureAIServices: {
52
52
  endpoint: process.env.AZURE_AI_SERVICES_ENDPOINT || "",
@@ -256,19 +256,17 @@ async function generateViaAzureAIServices(model, prompt, options = {}) {
256
256
  }
257
257
 
258
258
  const endpoint = CONFIG.azureAIServices.endpoint.replace(/\/$/, "");
259
+ const apiVersion = CONFIG.azureOpenAI.apiVersion;
259
260
 
260
- // Serverless endpoints typically use /images/generations
261
- // but some models use the root endpoint. Try the standard path first.
262
- const url = `${endpoint}/images/generations`;
261
+ // Use OpenAI-compatible path with deployment name
262
+ const url = `${endpoint}/openai/deployments/${modelConfig.deployment}/images/generations?api-version=${apiVersion}`;
263
263
 
264
264
  const size = options.size || modelConfig.defaultSize;
265
- const [width, height] = size.split("x").map(Number);
266
265
 
267
266
  const body = {
268
267
  prompt: prompt,
269
- width: width,
270
- height: height,
271
- num_images: 1,
268
+ n: 1,
269
+ size: size,
272
270
  response_format: "b64_json",
273
271
  };
274
272
 
@@ -404,7 +402,7 @@ async function generateViaAzureAIServicesFallback(
404
402
  throw new Error("Could not extract image from fallback response.");
405
403
  }
406
404
 
407
- return { filePath, model, size: body.width + "x" + body.height };
405
+ return { filePath, model, size: body.size };
408
406
  }
409
407
 
410
408
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "image-proxy-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server that proxies image generation to Azure (GPT-Image, DALL-E 3, FLUX Kontext Pro), saves to local disk, and returns file paths instead of base64 to keep context windows clean.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "index.js",
12
- "README.md",
13
- ".env.example"
12
+ "README.md"
14
13
  ],
15
14
  "scripts": {
16
15
  "start": "node index.js",
package/.env.example DELETED
@@ -1,35 +0,0 @@
1
- # ============================================================
2
- # Image Proxy MCP - Environment Configuration
3
- # ============================================================
4
- # Copy this to .env and fill in your values.
5
- #
6
- # AUTHENTICATION
7
- # ==============
8
- # Two modes supported (per endpoint):
9
- # 1. Managed Identity (recommended) - leave API key blank, run az login
10
- # 2. API Key - set the key env var below
11
- #
12
- # If an API key is set, it takes priority. If blank, the server
13
- # uses DefaultAzureCredential (az login locally, system-assigned
14
- # MI on Azure). Same zero-secret approach as the main MCP server.
15
- #
16
- # Azure OpenAI (for gpt-image-1.5, dall-e-3, etc.)
17
- # ============================================================
18
- AZURE_OPENAI_ENDPOINT=https://aoai-sweden-csa.openai.azure.com/
19
- # AZURE_OPENAI_API_KEY= # Leave blank for managed identity
20
- AZURE_OPENAI_API_VERSION=2024-02-01
21
-
22
- # ============================================================
23
- # Azure AI Services Serverless (for flux-kontext-pro, etc.)
24
- # The endpoint below is the serverless model endpoint, NOT the
25
- # resource-level endpoint. Find it in Azure AI Foundry under
26
- # the deployment's "Target URI".
27
- # ============================================================
28
- AZURE_AI_SERVICES_ENDPOINT=https://aoai-sweden-csa.services.ai.azure.com/
29
- # AZURE_AI_SERVICES_KEY= # Leave blank for managed identity
30
-
31
- # ============================================================
32
- # Output directory for generated images
33
- # Default: ~/Documents/generated-images
34
- # ============================================================
35
- IMAGE_OUTPUT_DIR=~/Documents/generated-images