Skip to main content
Glama
Marketing Automation MCP Server

Marketing Automation MCP Server

营销自动化 MCP 服务器

marketing-automation-mcp 是一个 Python MCP 服务器,用于确定性活动报告、提供商支持的预算优化、文案生成以及仅供演示的受众细分。

本仓库现在更倾向于可重复性,而非临时设置:

  • 支持的 Python 版本:3.12 和 3.13

  • 本地引导:uv

  • 主要 MCP 传输方式:stdio

  • 本地 Python 3.14.x 被视为兼容性工作,而非支持的基准

当前范围

本仓库中的公共 MCP 契约有意保持狭窄:

  • generate_campaign_report

  • optimize_campaign_budget

  • create_campaign_copy

  • analyze_audience_segments

目前只有这四个工具属于受支持的服务器接口。src/tools/ 下的其他模块作为内部或预期的代码路径存在,不应被视为生产环境的 MCP 功能。

Related MCP server: AdKit

执行模式

  • DEMO_MODE=true 为演示和契约测试返回确定性的样本数据。

  • DEMO_MODE=false 使用真实的平台凭据和选定的 AI 提供商。 缺失的实时依赖项将返回结构化的 blocked 响应,而不是虚构的输出。

清洁机器设置

uv sync --python 3.13 --extra dev
cp .env.example .env
uv run python -m compileall src tests dashboard
uv run pytest

如果您需要 pip 回退方案:

python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

运行服务器

以其支持的传输模式启动 MCP 服务器:

uv run python -m src.server

服务器目前仅记录并支持 stdio 传输。

Claude Desktop 配置:

{
  "mcpServers": {
    "marketing-automation": {
      "command": "uv",
      "args": ["run", "python", "-m", "src.server"],
      "cwd": "/absolute/path/to/Marketing-Automation-MCP-Server"
    }
  }
}

配置

cp .env.example .env

最低有用配置:

  • 仅演示模式:

    • DEMO_MODE=true

  • 实时报告和优化:

    • DEMO_MODE=false

    • 一组或多组平台凭据

  • 实时文案生成:

    • DEMO_MODE=false

    • AI_PROVIDER=openai

    • OPENAI_API_KEY=...

    • AI_OPENAI_MODEL=gpt-5.4

可选的提供商环境变量:

  • ANTHROPIC_API_KEY, ANTHROPIC_MODEL

  • GEMINI_API_KEY, GEMINI_MODEL

为了获得稳定的实时行为,请设置:

  • SECRET_KEY

  • ENCRYPTION_KEY

如果缺少 ENCRYPTION_KEY,该进程的 API 密钥加密将被禁用,服务器会记录一条警告。

工具契约

每个工具响应都包含以下顶级字段:

{
  "status": "ok | blocked",
  "mode": "demo | live",
  "blocked_reason": "optional string",
  "warnings": []
}

请参阅 docs/api/README.md 中的完整契约。

内部写入副作用

实时报告和优化流程可能会将内部审计记录持久化到配置的数据库中:

  • 报告流程可以持久化标准化的活动快照

  • 优化流程可以持久化 AI 决策历史

这些写入是用于可观测性和重放安全性的内部副作用。它们不属于公共 MCP 响应契约的一部分。

验证命令

uv run python -m compileall src tests dashboard
uv run pytest
uv run python -c "import src.server, src.cli, src.ai_engine, src.performance; print('imports ok')"
docker build -t marketing-automation-mcp:latest .

文档

Available Tools

4 tools
analyze_audience_segmentsC

Analyze audience segments in deterministic demo mode or return a structured live-mode block.

Inputs: contact_list_id (required), criteria (required), min_segment_size, max_segments, +2 more. Returns: Output schema for analyze_audience_segments.

create_campaign_copyB

Generate campaign copy variants through the configured AI provider or deterministic demo mode.

Inputs: product_name (required), product_description (required), target_audience (required), tone (required), +5 more. Returns: Output schema for create_campaign_copy.

generate_campaign_reportB

Generate campaign performance reports using live platform data or deterministic demo mode.

Inputs: campaign_ids (required), date_range (required), metrics (required), format, +2 more. Returns: Output schema for generate_campaign_report.

optimize_campaign_budgetC

Reallocate campaign budget using live platform metrics and provider-backed optimization logic.

Inputs: campaign_ids (required), total_budget (required), optimization_goal, constraints, +2 more. Returns: Output schema for optimize_campaign_budget.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct marketing function: audience analysis, copy creation, reporting, and budget optimization. There is no overlap in purpose.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (analyze_*, create_*, generate_*, optimize_*), making them predictable and easy to distinguish.

    Tool Count4/5

    With 4 tools, the set is slightly lean but covers core marketing automation tasks. It does not feel overly sparse or bloated for a focused server.

    Completeness3/5

    The tools cover analysis, copy, reporting, and optimization, but lack common features like campaign lifecycle management (create, schedule, pause) or list/segment management, leaving notable gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      Enables AI-powered analysis, management, and optimization of Meta advertising campaigns across Facebook and Instagram, including performance insights, budget optimization, and creative testing.
      33
      Business Source 1.1
    • A
      license
      A
      quality
      B
      maintenance
      Manage ad campaigns across Meta, Google, and TikTok, create campaigns, analyze performance, spy on competitors, and generate AI creatives.
      5
      20
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to create, analyze, and optimize ad campaigns across Google Ads, Meta Ads, TikTok Ads, LinkedIn Ads, Amazon Ads, and ChatGPT Ads through natural language using 400+ tools.
      108
      MIT