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_reportoptimize_campaign_budgetcreate_campaign_copyanalyze_audience_segments
現在、サポートされているサーバーインターフェースの一部であるツールはこれら4つのみです。src/tools/配下のその他のモジュールは、内部用または将来的なコードパスとして存在しており、本番環境のMCP機能として扱うべきではありません。
Related MCP server: Google Ads MCP Server
実行モード
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 pytestpipによるフォールバックが必要な場合:
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=false1つ以上のプラットフォーム認証情報セット
ライブコピー生成:
DEMO_MODE=falseAI_PROVIDER=openaiOPENAI_API_KEY=...AI_OPENAI_MODEL=gpt-5.4
オプションのプロバイダー環境変数:
ANTHROPIC_API_KEY,ANTHROPIC_MODELGEMINI_API_KEY,GEMINI_MODEL
安定したライブ動作のために、以下を設定してください:
SECRET_KEYENCRYPTION_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 toolsanalyze_audience_segmentsC
Analyze audience segments in deterministic demo mode or return a structured live-mode block.
| Name | Required | Description | Default |
|---|---|---|---|
| contact_list_id | Yes | ||
| criteria | Yes | ||
| min_segment_size | No | ||
| max_segments | No | ||
| include_recommendations | No | ||
| analyze_overlap | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| status | No | |
| mode | No | |
| blocked_reason | No | |
| warnings | No | |
| analysis_id | Yes | |
| total_contacts | Yes | |
| segments | Yes | |
| uncategorized_count | Yes | |
| overlaps | No | |
| recommendations | Yes | |
| insights | Yes | |
| created_at | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description fails to disclose behavioral traits such as read/write nature, side effects, or mode implications. 'Deterministic demo mode' hints at reproducibility but is not explained.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, but it is under-specified rather than concise. It omits critical details that would justify its brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 6 parameters, no annotations, and no explanation of the output schema, the description is insufficient for an agent to correctly invoke the tool. The live-mode vs. demo distinction is mentioned but not fleshed out.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage for its 6 parameters, and the description does not mention or clarify any parameters. It adds no value beyond the schema's field names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool analyzes audience segments and mentions two modes (deterministic demo vs. live), which distinguishes it from sibling tools like create_campaign_copy or generate_campaign_report. However, it lacks specificity on what the analysis produces.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives; no prerequisites or context for the modes. The description only states the action without any conditional advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_campaign_copyB
Generate campaign copy variants through the configured AI provider or deterministic demo mode.
| Name | Required | Description | Default |
|---|---|---|---|
| product_name | Yes | ||
| product_description | Yes | ||
| target_audience | Yes | ||
| tone | Yes | ||
| copy_type | Yes | ||
| variants_count | No | ||
| keywords | No | ||
| max_length | No | ||
| call_to_action | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| status | No | |
| mode | No | |
| blocked_reason | No | |
| warnings | No | |
| copy_generation_id | Yes | |
| copy_type | Yes | |
| variants | Yes | |
| tone | Yes | |
| target_audience | Yes | |
| keywords_used | Yes | |
| best_variant_id | Yes | |
| generation_metadata | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. It mentions two modes (AI provider and deterministic demo) but fails to disclose potential side effects, failure modes, authentication requirements, rate limits, or any constraints. This is a significant gap for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that efficiently communicates the core purpose and key behavioral distinction (two modes). There is no fluff; every word earns its place. The structure effectively front-loads the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (9 parameters, 5 required) and the lack of schema descriptions and annotations, the description should provide more contextual guidance. Although an output schema exists (so return values need no explanation), the lack of parameter semantics and behavioral detail makes the description incomplete for an agent to use the tool confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, meaning no parameter documentation exists in the schema. The tool description does not provide any additional meaning for the 9 parameters (e.g., expected formats, examples, or relationships). The only hint comes from parameter titles, which is insufficient for correct invocation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('generate'), the resource ('campaign copy variants'), and the two operational modes (AI provider or deterministic demo mode). It distinguishes well from sibling tools like analyze_audience_segments, generate_campaign_report, and optimize_campaign_budget, which serve different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for generating copy, but it does not explicitly state when to use it versus alternatives. There is no guidance on prerequisites, exclusions, or conditions that would help an agent decide between this tool and others. The context suggests usage, but explicit guidelines are missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_campaign_reportB
Generate campaign performance reports using live platform data or deterministic demo mode.
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_ids | Yes | ||
| date_range | Yes | ||
| metrics | Yes | ||
| format | No | json | |
| include_charts | No | ||
| group_by | No | campaign |
Output Schema
| Name | Required | Description |
|---|---|---|
| status | No | |
| mode | No | |
| blocked_reason | No | |
| warnings | No | |
| report_id | Yes | |
| generated_at | Yes | |
| date_range | Yes | |
| campaigns | Yes | |
| summary | Yes | |
| charts | No | |
| format | Yes | |
| download_url | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that the tool can use live data or a deterministic demo mode, which is a behavioral trait. However, with no annotations, it fails to disclose other important aspects like permissions, side effects, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that efficiently conveys the core action. It is concise, though it could briefly describe parameters without losing brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (6 parameters, nested objects, enums), the description is too sparse. It does not explain demo mode, report formats, or group_by behavior. Output schema exists but does not justify the lack of parameter context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage and the tool description provides no explanations for any of the 6 parameters, including required ones like campaign_ids, date_range, and metrics. This forces the agent to infer meaning from schemas alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates campaign performance reports and distinguishes it from siblings by specifying data sources (live vs demo mode). The verb 'generate' and resource 'campaign performance reports' are specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool vs alternatives like analyze_audience_segments. There is no mention of prerequisites or exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
optimize_campaign_budgetC
Reallocate campaign budget using live platform metrics and provider-backed optimization logic.
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_ids | Yes | ||
| total_budget | Yes | ||
| optimization_goal | No | maximize_roi | |
| constraints | No | ||
| historical_days | No | ||
| include_projections | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| status | No | |
| mode | No | |
| blocked_reason | No | |
| warnings | No | |
| optimization_id | Yes | |
| total_budget | Yes | |
| optimization_goal | Yes | |
| allocations | Yes | |
| projected_improvement | Yes | |
| confidence_score | Yes | |
| recommendations | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It only states the high-level purpose but omits details like budget modification being destructive, required permissions, or impact of reallocation. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single 10-word sentence, concise but too brief for a tool with 6 parameters. It front-loads the action but lacks essential context, making it minimally adequate.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, no schema descriptions, no annotations, and an output schema not explained, the description is severely incomplete. An agent cannot infer inputs, outputs, or behavioral effects from this alone.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It does not mention any parameters (campaign_ids, total_budget, etc.) nor explain their meaning. Only the optimization_goal enum is partially documented in the schema itself.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (reallocate campaign budget) and the method (live platform metrics, optimization logic). It distinguishes from siblings like analyze_audience_segments or create_campaign_copy, which are unrelated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., when to manually adjust budgets). No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.1.0- First observed
analyze_audience_segments - First observed
create_campaign_copy - First observed
generate_campaign_report - First observed
optimize_campaign_budget
TDQS
Scored across 4 tools
Each tool targets a distinct marketing function: audience analysis, copy creation, reporting, and budget optimization. There is no overlap in purpose.
All tool names follow a consistent verb_noun pattern (analyze_*, create_*, generate_*, optimize_*), making them predictable and easy to distinguish.
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.
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
Related MCP Connectors
AI marketing agent for Google Ads, Meta, GA4, TikTok, LinkedIn, Shopify, HubSpot and more.
AI that makes and runs your Google and Facebook ads from your own account, with a CRM behind it.
Google & Meta Ads management with 100+ tools. Audit, create, and optimize campaigns.
Run ads on Google, Meta, LinkedIn, TikTok and more from AI. 610+ tools across 14 platforms.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI-powered analysis, management, and optimization of Meta advertising campaigns across Facebook and Instagram, including performance insights, budget optimization, and creative testing.33Business Source 1.1
- AlicenseBqualityDmaintenanceEnables programmatic management of Google Ads campaigns, allowing users to monitor performance metrics, update budgets, and toggle campaign statuses. It supports real-time analytics, top performer analysis, and reporting in CSV or JSON formats.1132 npm2MIT
- AlicenseNot gradedqualityAmaintenanceManage ad campaigns across Meta, Google, and TikTok, create campaigns, analyze performance, spy on competitors, and generate AI creatives.14MIT
- FlicenseNot gradedqualityDmaintenanceAutomates marketing workflows across Google Ads, Meta Ads, and GA4, enabling content generation, scheduling, and analytics via a multi-agent pipeline.-