KosmoKrator

print

Lob MCP Integration for OpenAI Agents SDK

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

7 functions 5 read 2 write API key auth

Connect Lob to OpenAI Agents SDK

Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.

Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with --write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.

Lob MCP Config for OpenAI Agents SDK

Use headless JSON commands for CI-style execution and MCP for agent tool discovery.

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

Run the Gateway Manually

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

Why Use KosmoKrator Here

Scoped tools

Expose only Lob 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.

Lob Tools Visible to OpenAI Agents

OpenAI Agents sees stable MCP tool names generated from the Lob integration catalog.

MCP toolSource functionTypeDescription
integration__lob__lob_list_letters lob.lob_list_letters Read List letters with pagination. Returns a page of letter objects sorted by creation date (newest first).
integration__lob__lob_get_letter lob.lob_get_letter Read Retrieve details of a specific letter by its Lob ID, including delivery status, tracking info, and the letter URL.
integration__lob__lob_create_letter lob.lob_create_letter Write Create and send a letter via Lob. Provide recipient and sender addresses (as address IDs or inline address objects), plus an HTML file or template ID for the letter content.
integration__lob__lob_list_postcards lob.lob_list_postcards Read List postcards with pagination. Returns a page of postcard objects sorted by creation date (newest first).
integration__lob__lob_get_postcard lob.lob_get_postcard Read Retrieve details of a specific postcard by its Lob ID, including delivery status, tracking info, and thumbnails.
integration__lob__lob_create_postcard lob.lob_create_postcard Write Create and send a postcard via Lob. Provide recipient and sender addresses (as address IDs or inline address objects), plus HTML or template IDs for the front and back.
integration__lob__lob_get_current_user lob.lob_get_current_user Read List saved addresses in the Lob account. Returns all verified addresses that can be used as sender or recipient for letters and postcards.

Related Lob Pages