KosmoKrator

ai

OpenAI MCP Integration for Vercel AI SDK

Connect OpenAI to Vercel AI SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

15 functions 5 read 10 write API key auth

Connect OpenAI to Vercel AI SDK

Use KosmoKrator as a local integration gateway for Vercel AI SDK agents and scripts.

Create an MCP client that starts or connects to the KosmoKrator gateway for the selected integration. The gateway is local, scoped to this integration, and starts with --write=deny so Vercel AI SDK can inspect read-capable tools without receiving write access by default.

OpenAI MCP Config for Vercel AI SDK

Prefer CLI JSON calls when a workflow only needs one deterministic integration operation.

{
  "mcpServers": {
    "kosmokrator-openai": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=openai",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=openai --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only OpenAI instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

OpenAI Tools Visible to Vercel AI SDK

Vercel AI SDK sees stable MCP tool names generated from the OpenAI integration catalog.

MCP toolSource functionTypeDescription
integration__openai__openai_chat_completion openai.openai_chat_completion Write Generate a chat completion using OpenAI GPT models. Send a conversation as an array of messages with role and content.
integration__openai__openai_create_embedding openai.openai_create_embedding Write Generate an embedding vector for text input using OpenAI embedding models.
integration__openai__openai_create_image openai.openai_create_image Write Generate an image from a text prompt using DALL·E.
integration__openai__openai_transcribe_audio openai.openai_transcribe_audio Write Transcribe audio into text using OpenAI Whisper. Supports MP3, MP4, WAV, M4A, and WEBM audio files.
integration__openai__openai_text_to_speech openai.openai_text_to_speech Write Generate speech audio from text using OpenAI TTS. Returns base64-encoded audio content.
integration__openai__openai_create_assistant openai.openai_create_assistant Write Create an OpenAI assistant with a model, name, instructions, and optional tools.
integration__openai__openai_list_assistants openai.openai_list_assistants Read List all OpenAI assistants available to the authenticated user.
integration__openai__openai_create_thread openai.openai_create_thread Write Create a conversation thread for the OpenAI Assistants API. Optionally include initial messages.
integration__openai__openai_add_message_to_thread openai.openai_add_message_to_thread Write Add a message to an existing conversation thread.
integration__openai__openai_list_thread_messages openai.openai_list_thread_messages Read List messages in an OpenAI conversation thread.
integration__openai__openai_create_run openai.openai_create_run Write Start an assistant run on a thread. Returns the run with its initial status.
integration__openai__openai_get_run openai.openai_get_run Read Get the status and details of an assistant run on a thread.
integration__openai__openai_upload_file openai.openai_upload_file Write Upload a file to OpenAI for use with Assistants, Fine-tuning, or Batch API.
integration__openai__openai_list_files openai.openai_list_files Read List files uploaded to OpenAI, optionally filtered by purpose.
integration__openai__openai_list_models openai.openai_list_models Read List all models available from OpenAI, including GPT, DALL·E, Whisper, and embedding models.

Related OpenAI Pages