KosmoKrator

newsletter

Beehiiv MCP Integration for Claude Agent SDK

Connect Beehiiv to Claude Agent SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

10 functions 6 read 4 write API key auth

Connect Beehiiv to Claude Agent SDK

Give Claude Agent SDK workflows access to KosmoKrator integrations through a local MCP server.

Add a KosmoKrator stdio MCP server to the Claude Agent SDK options. The gateway is local, scoped to this integration, and starts with --write=deny so Claude Agent SDK can inspect read-capable tools without receiving write access by default.

Beehiiv MCP Config for Claude Agent SDK

Use a narrow integration list so the agent does not load unrelated tools.

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

Run the Gateway Manually

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

Why Use KosmoKrator Here

Scoped tools

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

Beehiiv Tools Visible to Claude Agent SDK

Claude Agent SDK sees stable MCP tool names generated from the Beehiiv integration catalog.

MCP toolSource functionTypeDescription
integration__beehiiv__beehiiv_list_posts beehiiv.beehiiv_list_posts Read List posts from your Beehiiv publication. Filter by status (draft, confirmed, etc.) and paginate with limit/page.
integration__beehiiv__beehiiv_get_post beehiiv.beehiiv_get_post Read Get a single post from your Beehiiv publication by its post ID.
integration__beehiiv__beehiiv_create_post beehiiv.beehiiv_create_post Write Create a new post in your Beehiiv publication. Requires title and content. Set status to "draft" to save without publishing, or "confirmed" to publish.
integration__beehiiv__beehiiv_update_post beehiiv.beehiiv_update_post Write Update an existing post in your Beehiiv publication. Provide the post ID and the fields you want to change.
integration__beehiiv__beehiiv_delete_post beehiiv.beehiiv_delete_post Write Delete a post from your Beehiiv publication. This action is irreversible.
integration__beehiiv__beehiiv_list_subscribers beehiiv.beehiiv_list_subscribers Read List subscribers for your Beehiiv publication. Filter by status (active, inactive, etc.) and paginate with limit/page.
integration__beehiiv__beehiiv_get_subscriber beehiiv.beehiiv_get_subscriber Read Get a single subscriber from your Beehiiv publication by their subscription ID.
integration__beehiiv__beehiiv_create_subscriber beehiiv.beehiiv_create_subscriber Write Add a new subscriber to your Beehiiv publication by email address.
integration__beehiiv__beehiiv_get_stats beehiiv.beehiiv_get_stats Read Get analytics and stats for your Beehiiv publication. Use the "intent" parameter to specify the type of stats (overview, traffic, growth, subscribers).
integration__beehiiv__beehiiv_get_current_user beehiiv.beehiiv_get_current_user Read Verify your Beehiiv API key and list all publications you have access to. Use this to confirm the integration is working and to find your publication ID.

Related Beehiiv Pages