KosmoKrator

ai

Hugging Face MCP Integration for Vercel AI SDK

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

7 functions 7 read 0 write Bearer token auth

Connect Hugging Face 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.

Hugging Face MCP Config for Vercel AI SDK

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

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

Run the Gateway Manually

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

Why Use KosmoKrator Here

Scoped tools

Expose only Hugging Face 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.

Hugging Face Tools Visible to Vercel AI SDK

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

MCP toolSource functionTypeDescription
integration__huggingface__huggingface_list_models huggingface.huggingface_list_models Read Search and list AI models on the Hugging Face Hub. Filter by text search, author, task (e.g. "text-generation", "image-classification"), tags, and sort by downloads, likes, or recent activity.
integration__huggingface__huggingface_get_model huggingface.huggingface_get_model Read Get detailed information about a specific Hugging Face model, including its card, tags, pipeline tag, library, downloads, likes, and file listing.
integration__huggingface__huggingface_list_datasets huggingface.huggingface_list_datasets Read Search and list datasets on the Hugging Face Hub. Filter by text search, author, tags, and sort by downloads, likes, or recent activity.
integration__huggingface__huggingface_get_dataset huggingface.huggingface_get_dataset Read Get detailed information about a specific Hugging Face dataset, including its card, tags, downloads, likes, and file listing.
integration__huggingface__huggingface_list_spaces huggingface.huggingface_list_spaces Read Search and list Spaces on the Hugging Face Hub. Filter by text search, author, tags, SDK, and sort by downloads, likes, or recent activity.
integration__huggingface__huggingface_get_space huggingface.huggingface_get_space Read Get detailed information about a specific Hugging Face Space, including its SDK, hardware, runtime status, and settings.
integration__huggingface__huggingface_get_current_user huggingface.huggingface_get_current_user Read Get the authenticated Hugging Face user's profile information, including name, username, type (user/org), and avatar.

Related Hugging Face Pages