跳转到内容

Asana MCP 工具(用于 ADK)

在 ADK 中得到支持。PythonTypeScript

The Asana MCP Server 将您的 ADK 代理连接到…… 阿萨纳(Asana) 工作管理平台:通过这次集成,您的代理可以使用自然语言来管理项目、任务、目标以及团队协作。

使用场景

  • 跟踪项目进度获取项目进度的实时更新,查看状态报告,并检索有关里程碑和截止日期的信息。

  • 管理任务:使用自然语言来创建、更新和整理任务。 让您的智能助手负责处理任务分配、任务状态变更以及优先级的调整。

  • 监控目标(Monitor Goals):可以访问和更新“Asana”中的目标设置,以便跟踪团队目标以及整个组织的关键成果。

先决条件

与代理程序(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="asana_agent",
    instruction="Help users manage projects, tasks, and goals in Asana",
    tools=[
        McpToolset(
            connection_params=StdioConnectionParams(
                server_params=StdioServerParameters(
                    command="npx",
                    args=[
                        "-y",
                        "mcp-remote",
                        "https://mcp.asana.com/sse",
                    ]
                ),
                timeout=30,
            ),
        )
    ],
)
import { LlmAgent, MCPToolset } from "@google/adk";

const rootAgent = new LlmAgent({
    model: "gemini-flash-latest",
    name: "asana_agent",
    instruction: "Help users manage projects, tasks, and goals in Asana",
    tools: [
        new MCPToolset({
            type: "StdioConnectionParams",
            serverParams: {
                command: "npx",
                args: [
                    "-y",
                    "mcp-remote",
                    "https://mcp.asana.com/sse",
                ],
            },
        }),
    ],
});

export { rootAgent };

注意:

当你第一次运行这个代理程序时,系统会自动打开一个浏览器窗口,通过 OAuth 协议请求访问权限。或者,你也可以使用控制台中显示的授权 URL 来完成授权操作。你必须批准这个请求,才能允许该代理程序访问你的 Asana 数据。

可用的工具

Asana 的 MCP 服务器包含了 30 多种按类别分类的工具。当您的代理(agent)连接到服务器时,这些工具会自动被识别并可供使用。 ADK Web UI 在运行您的代理程序后,您可以通过该工具查看跟踪图(trace graph)中可用的工具。

类别 描述
项目跟踪 获取项目状态更新和报告
任务管理 创建、更新和整理任务
用户信息 访问用户详细信息及分配的任务
目标 跟踪并更新阿萨纳(Asana)练习目标
团队组织结构 管理团队架构和成员信息
对象搜索 在 Asana 的各个对象中实现快速自动完成功能(即输入关键词后系统能自动提示相关内容)。

其他资源