Skip to main content
Glama

图像

Beehiiv MCP 服务器

一个模型上下文协议 (MCP) 服务器,提供与 Beehiiv API v2 交互的工具。该服务器支持大型语言模型 (LLM) 通过标准化工具与 Beehiiv 出版物和帖子进行交互。

先决条件

  • Python 3.10 或更高版本

  • uv包管理器

  • 具有 API 访问权限的 Beehiiv 帐户

  • Claude Desktop(或其他兼容 MCP 的客户端)

Related MCP server: MCP Python Server — API Wrapper

安装

  1. 如果尚未安装uv ,请安装:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 如果从头开始重建,请创建并设置您的项目:

# Create a new directory and navigate into it
mkdir beehiiv-mcp-server
cd beehiiv-mcp-server

# Create virtual environment and activate it
uv venv
source .venv/bin/activate

# Install dependencies
uv add "mcp[cli]" httpx python-dotenv
  1. 在项目根目录中创建一个.env文件:

BEEHIIV_API_KEY=your_api_key_here
BEEHIIV_PUBLICATION_ID=your_publication_id_here

Claude桌面配置

将以下内容添加到您的 Claude Desktop 配置文件( ~/Library/Application Support/Claude/claude_desktop_config.json ):

{
  "mcpServers": {
    "beehiiv-mcp-server": {
      "command": "<ABSOLUTE_UV_PATH>",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "<ABSOLUTE_SERVER_PATH>"
      ]
    }
  }
}

代替:

  • <ABSOLUTE_UV_PATH>为你的uv可执行文件的路径

  • <ABSOLUTE_SERVER_PATH>为beehiiv_server.py文件的绝对路径

可用工具

该 MCP 服务器目前公开以下工具(将会添加更多工具):

列表出版物

列出可使用您的 API 密钥访问的所有出版物。

列表帖子

列出特定出版物最近确认的 5 篇帖子。

list_posts(publication_id: str)

获取帖子

检索有关特定帖子的详细信息。

get_post(publication_id: str, post_id: str)

获取帖子内容

检索帖子的完整 HTML 内容

创建新帖子

在 beehiiv 平台上创建新帖子(仅限企业)

工作原理

当您通过 Claude Desktop 与此服务器交互时:

  1. 客户将您的问题发送给 Claude

  2. Claude 分析可用的 Beehiiv 工具并决定使用哪一个

  3. 客户端通过此 MCP 服务器执行所选工具

  4. 结果被发回给克劳德

  5. 克劳德制定了自然语言回应

  6. 响应将显示给您

(视频即将发布)

故障排除

Claude 中未显示服务器

  1. 检查你的claude_desktop_config.json文件语法

  2. 确保所有路径都是绝对路径,而不是相对路径

  3. 重启Claude桌面

查看日志

检查 Claude 的日志中是否存在与 MCP 相关的问题:

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

日志存储在:

  • ~/Library/Logs/Claude/mcp.log用于常规 MCP 连接

  • ~/Library/Logs/Claude/mcp-server-beehiiv-mcp-server.log用于服务器特定的日志

安全

  • 永远不要将.env文件提交到版本控制

  • 确保您的 Beehiiv API 密钥安全

  • 考虑对 API 调用实施速率限制

贡献

X 上的 hmu ( https://x.com/reymerekar7 )

Available Tools

5 tools
create_new_postC
Create a new post using provided HTML content.

Args:
    publication_id: ID of the publication
    title: Title of the new post
    subtitle: Subtitle of the new post
    html_content: HTML content for the post

Inputs: html_content (required), publication_id (required), subtitle (required), title (required).

get_postC
Retrieve a single post by ID.

Args:
    publication_id: ID of the publication
    post_id:        ID of the post

Inputs: post_id (required), publication_id (required).

get_post_contentA
Retrieve a post's content as JSON to use as a template.

Args:
    publication_id: ID of the publication
    post_id: ID of the post

Returns:
    dict: JSON object containing post title, subtitle, and HTML content template

Inputs: post_id (required), publication_id (required).

list_postsB
List all posts for a given publication.

Args:
    publication_id: e.g. 'pub_00000000-0000-0000-0000-000000000000'

Inputs: publication_id (required).

list_publicationsB

List all publications accessible with this API key.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 5 tools

    Disambiguation3/5

    Most tools have distinct purposes, but get_post and get_post_content have overlapping functionality that could cause confusion. Both retrieve posts by ID, with get_post_content specifically extracting content as a template, but the distinction may not be clear to an agent without careful reading of descriptions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (create_new_post, get_post, get_post_content, list_posts, list_publications). The naming is predictable and readable throughout the set, with no deviations in style.

    Tool Count4/5

    With 5 tools, the count is reasonable for a Beehiiv MCP server focused on post and publication management. It covers core operations but feels slightly thin, as it lacks update or delete functionality for posts, which are common in such domains.

    Completeness3/5

    The toolset covers creation, retrieval, and listing for posts and publications, but has notable gaps. There are no tools for updating or deleting posts, which are essential for a full CRUD lifecycle, and no publication-specific management beyond listing, which could lead to agent workarounds.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers