跳转到内容

Markifact MCP 工具(用于 ADK)

在 ADK 中得到支持。PythonTypeScript

The Markifact MCP Server 将您的 ADK 代理连接到…… Markifact这是一个基于人工智能的营销自动化平台,支持在 20 多个平台上执行 300 多种营销操作,这些平台包括 Google Ads、Meta Ads、GA4、TikTok Ads 和 Shopify。通过这次集成,您的营销人员将能够管理营销活动、分析营销效果,并利用自然语言处理技术自动化营销工作流程;同时,所有操作都会在执行前显示审批提示。

使用场景

  • “Spend hygiene” 可以理解为“在个人卫生用品(如肥皂、洗手液等)上的支出”。这个短语强调人们应该重视个人卫生,并愿意为购买这些用品投入金钱。:分析在 Google Ads、Meta、TikTok 和 LinkedIn 上浪费的预算,并提出具体的暂停使用这些平台及重新分配预算的建议。
  • 统一报告系统:一个提示(prompt)可以生成关于所有连接渠道以及 GA4 的综合支出数据(blended spend)、投资回报率(ROAS)、客户获取成本(CAC)以及转化率变化(conversion deltas)的详细信息。
  • 用于实时营销活动的简报(Briefs to live campaigns)从一条简短的文字说明开始,逐步制定出完整的搜索策略(Search Strategy);同时准备好用于 Performance Max、Meta Advantage+、TikTok 或 LinkedIn 广告活动的广告方案,以便提交给相关人员审批。
  • “Lead handoff”(领导权交接)是指在某个项目、团队或任务中,现任负责人将领导权或管理职责正式移交给下一任负责人的过程。这个过程通常包括以下步骤: 1. **准备工作**:现任负责人需要与下一任负责人进行充分的沟通,确保后者了解项目的现状、目标、挑战以及相关的工作流程。 2. **交接清单**:现任负责人会准备一份详细的交接清单,列出所有需要移交的重要文件、资料、责任和任务。 3. **培训与指导**:现任负责人会为新任负责人提供必要的培训和支持,帮助他们更快地适应新的工作角色。 4. **后续跟进**:交接完成后,现任负责人仍需要与新任负责人保持联系,确保新任负责人能够顺利完成任务,并在需要时提供帮助。 “Lead handoff”对于确保项目的顺利进行和团队的稳定发展至关重要。:收集 Meta 和 LinkedIn 上的潜在客户信息(即“lead forms”),在 HubSpot 或 Klaviyo 中对这些信息进行进一步处理,然后触发 WhatsApp 或 Slack 的跟进通知。

先决条件

  • A Markifact 账户(提供免费 tier)
  • 至少有一个平台通过 Markifact 仪表板进行了连接(例如:Google Ads、Meta、GA4、Shopify 等)。
  • 请参阅…… Markifact 文档 用于连接设置

与代理程序(agent)一起使用。

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters

root_agent = Agent(
    model="gemini-flash-latest",
    name="marketing_agent",
    instruction=(
        "You are a performance marketing agent that helps users manage "
        "ad campaigns, run analytics, sync e-commerce data, and "
        "execute marketing workflows across Google Ads, Meta Ads, GA4, "
        "TikTok Ads, LinkedIn Ads, Shopify, HubSpot, and more. "
        "Always confirm with the user before any write operation."
    ),
    tools=[
        McpToolset(
            connection_params=StdioConnectionParams(
                server_params=StdioServerParameters(
                    command="npx",
                    args=[
                        "-y",
                        "mcp-remote",
                        "https://api.markifact.com/mcp",
                    ],
                ),
                timeout=30,
            ),
        )
    ],
)

注意:

当你第一次运行这个代理程序时,会自动打开一个浏览器窗口,该窗口会通过 OAuth 请求访问权限。请在浏览器中批准该请求,以允许该代理程序访问你已连接的账户。

from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset, StreamableHTTPConnectionParams

MARKIFACT_ACCESS_TOKEN = "YOUR_MARKIFACT_ACCESS_TOKEN"

root_agent = Agent(
    model="gemini-flash-latest",
    name="marketing_agent",
    instruction=(
        "You are a performance marketing agent that helps users manage "
        "ad campaigns, run analytics, sync e-commerce data, and "
        "execute marketing workflows across Google Ads, Meta Ads, GA4, "
        "TikTok Ads, LinkedIn Ads, Shopify, HubSpot, and more. "
        "Always confirm with the user before any write operation."
    ),
    tools=[
        McpToolset(
            connection_params=StreamableHTTPConnectionParams(
                url="https://api.markifact.com/mcp",
                headers={
                    "Authorization": f"Bearer {MARKIFACT_ACCESS_TOKEN}",
                },
            ),
        )
    ],
)

注意:

如果您已经拥有 Markifact 的访问令牌,可以直接使用 Streamable 的 HTTP 协议进行连接,而无需经过 OAuth 浏览器认证流程。

import { LlmAgent, MCPToolset } from "@google/adk";

const rootAgent = new LlmAgent({
    model: "gemini-flash-latest",
    name: "marketing_agent",
    instruction:
        "You are a performance marketing agent that helps users manage " +
        "ad campaigns, run analytics, sync e-commerce data, and " +
        "execute marketing workflows across Google Ads, Meta Ads, GA4, " +
        "TikTok Ads, LinkedIn Ads, Shopify, HubSpot, and more. " +
        "Always confirm with the user before any write operation.",
    tools: [
        new MCPToolset({
            type: "StdioConnectionParams",
            serverParams: {
                command: "npx",
                args: [
                    "-y",
                    "mcp-remote",
                    "https://api.markifact.com/mcp",
                ],
            },
        }),
    ],
});

export { rootAgent };

注意:

当你第一次运行这个代理程序时,会自动打开一个浏览器窗口,该窗口会通过 OAuth 请求访问权限。请在浏览器中批准该请求,以允许该代理程序访问你已连接的账户。

import { LlmAgent, MCPToolset } from "@google/adk";

const MARKIFACT_ACCESS_TOKEN = "YOUR_MARKIFACT_ACCESS_TOKEN";

const rootAgent = new LlmAgent({
    model: "gemini-flash-latest",
    name: "marketing_agent",
    instruction:
        "You are a performance marketing agent that helps users manage " +
        "ad campaigns, run analytics, sync e-commerce data, and " +
        "execute marketing workflows across Google Ads, Meta Ads, GA4, " +
        "TikTok Ads, LinkedIn Ads, Shopify, HubSpot, and more. " +
        "Always confirm with the user before any write operation.",
    tools: [
        new MCPToolset({
            type: "StreamableHTTPConnectionParams",
            url: "https://api.markifact.com/mcp",
            transportOptions: {
                requestInit: {
                    headers: {
                        Authorization: `Bearer ${MARKIFACT_ACCESS_TOKEN}`,
                    },
                },
            },
        }),
    ],
});

export { rootAgent };

注意:

如果您已经拥有 Markifact 的访问令牌,可以直接使用 Streamable 的 HTTP 协议进行连接,而无需经过 OAuth 浏览器认证流程。

可用的工具

工具 描述
find_operations 基于操作注册表的语义搜索功能,搜索范围受平台及用户意图的限制。
get_operation_inputs 返回特定操作输入数据的 JSON 架构(JSON Schema)。
run_operation 执行读取操作
run_write_operation 在经过审批流程后,执行写入操作。
list_connections 列出工作空间中的 OAuth 连接信息
get_file_url 获取报告和导出文件的 URL 地址
read_file 读取文件内容
upload_media 上传媒体文件(如图片、视频等)

功能(或能力)

能力(或功能) 描述
Discovery 基于 300 多种操作的语义搜索功能,支持数据的读取/写入以及分类处理。
需要经过审批才能进行的写入操作(即只有获得批准后才能执行写入操作) 围绕该主题制定的四步协议: run_write_operation 对于任何形式的支出或具有破坏性的变更行为……
活动管理(Campaign Management) 在所有付费渠道中创建、编辑、暂停或恢复广告活动(campaigns)、广告组(ad sets)以及单个广告(ads)。
报告与归因(Reporting & Attribution) 跨平台消费数据、投资回报率(ROAS)与转化率的数据分析;同时还包括 Google Analytics 4(GA4)提供的路径与渠道分析功能。
目标受众(Audiences) 根据不同的平台,可以设置自定义受众群体、相似用户群体、需要排除的用户群体,以及基于用户行为的定向广告投放策略。
Creative 资产上传、变体轮换、疲劳度检测(用于识别用户使用频率过高的内容),以及需要审批后才能发布的功能。
商业与客户关系管理(Commerce & CRM) Shopify、HubSpot 和 Klaviyo 与付费广告平台(paid media platforms)实现数据同步,从而支持闭环报告(closed-loop reporting)功能。
消息传递( Messaging) 通过 WhatsApp 和 Slack 发送通知,用于传达审批结果、提醒信息以及任务交接情况。
文件输入/输出(File I/O) 通过以下方式生成报告、进行数据导出及上传操作: get_file_url, read_file, upload_media

支持的平台

类别 平台(Platforms)
付费媒体(Paid Media) Google Ads、Meta Ads、TikTok Ads、LinkedIn Ads、Microsoft Ads、Reddit Ads、Pinterest Ads、Snapchat Ads、Amazon Ads、DV360
Analytics GA4、BigQuery、Google Search Console、Google Merchant Center
电子商务(E-commerce)、客户关系管理(CRM)以及消息传递(Messaging) Shopify、HubSpot、Klaviyo、WhatsApp、Slack
“Organic & Social”可以翻译为“有机的(或自然的)与社会相关的(内容/活动)”。 Facebook、Instagram、LinkedIn、Google Business Profile

其他资源