asanamcp
    
Asana API的MCP服务器。
快速开始
- 获取Asana个人访问令牌https://app.asana.com/0/my-apps
- 安装:
# Homebrew
brew install adlio/tap/asanamcp
# From crates.io
cargo install asanamcp
# From GitHub
cargo install --git https://github.com/adlio/asanamcp- 添加到Claude桌面配置(
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"asana": {
"command": "asanamcp",
"env": {
"ASANA_TOKEN": "your-personal-access-token",
"ASANA_DEFAULT_WORKSPACE": "your-workspace-gid"
}
}
}
}这 ASANA_DEFAULT_WORKSPACE 是可选的,但如果您主要在一个工作区工作,建议使用。设置后,基于工作区的操作(搜索、列出项目、列出用户等)将使用此默认值,从而减少在每个请求中指定工作区GID的需要。
测试服务器
# Dump tool schemas (useful for debugging)
asanamcp --schema
# Dump a specific tool's schema
asanamcp --schema get
# Launch the MCP Inspector (interactive web UI)
make inspect工具
| 工具 | 说明 |
|---|---|
asana_workspaces | 列出所有工作区 |
asana_get | 获取任何资源(项目、任务、投资组合等) |
asana_create | 创建资源(任务、评论、项目等) |
asana_update | 更新现有资源 |
asana_delete | 永久删除资源(不可逆) |
asana_link | 管理关系(任务↔项目、依赖关系等) |
asana_task_search | 使用丰富的过滤器(受让人、截止日期等)搜索任务 |
asana_resource_search | 按名称搜索资源(项目、模板、用户、团队等) |
asana_get
使用递归遍历支持获取任何Asana资源。
{"resource_type": "portfolio", "gid": "123", "depth": -1}| resource_type | gid | 选项 |
|---|---|---|
project | GID项目 | |
portfolio | 投资组合GID | depth:遍历深度 |
task | 任务GID | include_subtasks, include_dependencies, include_comments |
my_tasks | 工作区GID\* | 分配给当前用户的任务 |
workspace_favorites | 工作空间GID\* | depth 用于投资组合遍历 |
workspace_projects | 工作区GID\* | 工作区中的所有项目 |
workspace_templates | 团队GID(可选) | 空=所有可访问的模板 |
workspace_tags | 工作区GID\* | |
workspace_users | 工作区GID\* | |
workspace_teams | 工作区GID\* | |
project_tasks | 项目/组合GID | subtask_depth |
task_subtasks | 任务GID | |
task_comments | 任务GID | |
status_update | 状态更新GID | 按GID进行单个状态更新 |
status_updates | 父GID | 列出项目/项目组合的状态更新 |
all_workspaces | (忽略) | 所有可访问的工作区 |
workspace | 工作区GID | |
project_template | 模板GID | |
project_sections | GID项目 | |
section | GID部分 | |
tag | 标签GID | |
me | (忽略) | 当前已通过身份验证的用户 |
user | 用户GID | |
team | GID团队 | |
team_users | GID团队 | |
project_custom_fields | GID项目 | |
project_brief | 简报GID | 项目简报(概述选项卡上的关键资源,而不是注释选项卡上的) |
project_project_brief | 项目GID | 通过项目GID获取项目简报 |
\*用途 ASANA_DEFAULT_WORKSPACE 如果gid为空。
深度: -1 =无限制, 0 =无, N =N个级别。
asan_create
{"resource_type": "task", "project_gid": "123", "name": "New task", "assignee": "me"}| resource_type | 必填字段 | |
|---|---|---|
task | project_gid 或 workspace_gid*, name | |
subtask | task_gid, name | |
project | workspace_gid 或 team_gid, name | |
project_from_template | template_gid, name | |
portfolio | workspace_gid*, name | |
section | project_gid, name | |
comment | task_gid, text | |
status_update | parent_gid, status_type, text | |
tag | workspace_gid\*, name | |
project_duplicate | source_gid, name | |
task_duplicate | source_gid, name | |
project_brief | project_gid, html_text (与 `` 标签) | 概述选项卡上的关键资源(不是注释选项卡) |
\*用途 ASANA_DEFAULT_WORKSPACE 如果没有提供。
体式更新
{"resource_type": "task", "gid": "123", "completed": true}支持: task, project, portfolio, section, tag, comment, status_update, project_brief (“概述”选项卡上的“关键资源”,而不是“注释”选项卡上)。
asana_delete
永久删除Asana资源。此操作是 不可逆的.
{"resource_type": "task", "gid": "123"}支持: task, project, portfolio, section, tag, comment, status_update, project_brief.
asan_link
{"action": "add", "relationship": "task_project", "target_gid": "task123", "item_gid": "proj456"}| 关系 | 目标 | 项目 |
|---|---|---|
task_project | 任务GID | 项目GID |
task_tag | 任务GID | 标签GID |
task_parent | 任务GID | 父任务GID |
task_dependency | 任务GID | 阻塞任务GID |
task_dependent | 任务GID | 依赖任务GID |
task_follower | 任务GID | 用户GID |
portfolio_item | 项目组合GID | |
portfolio_member | 投资组合GID | 用户GID |
project_member | 项目GID | 用户GID |
project_follower | 项目GID | 用户GID |
使用 item_gid 对于单个项目或 item_gids 用于批量操作。
体式任务搜索
搜索具有丰富过滤选项的任务。
{"workspace_gid": "123", "text": "bug", "completed": false, "assignee": "me"}| 筛选器 | 描述 |
|---|---|
workspace_gid | 要搜索的工作区(如果未提供,则使用默认值) |
text | 在任务名称和注释中搜索 |
assignee | 用户GID, me,或 null 未分配 |
projects | 按项目GID筛选 |
tags | 按标签GID筛选 |
sections | 按GID部分筛选 |
completed | true 或 false |
due_on, due_on_before, due_on_after | 日期过滤器(YYYY-MM-DD) |
sort_by | due_date, created_at, completed_at, likes, modified_at |
sort_ascending | true 或 false |
体式资源搜索
使用typeahead按名称搜索任何Asana资源。使用此功能查找项目、模板、用户、团队等。
{"query": "CloudSmith", "resource_type": "project_template"}| 参数 | 说明 |
|---|---|
query | 搜索文本(必填) |
resource_type | project, project_template, portfolio, user, team, tag,或 goal |
workspace_gid | 要搜索的工作区(如果未提供,则使用默认值) |
count | 最大结果(默认20,最大100) |
图书馆使用情况
use asanamcp::{AsanaClient, Resource};
#[tokio::main]
async fn main() -> Result {
let client = AsanaClient::from_env()?;
let workspaces: Vec = client
.get_all("/workspaces", &[("opt_fields", "gid,name")])
.await?;
for ws in workspaces {
println!("{}: {:?}", ws.gid, ws.fields.get("name"));
}
Ok(())
}发展
make ci # Run all checks (fmt, lint, build, docs, test)
make test # Run tests
make coverage # Coverage report
make fmt # Format code
make lint # Run clippy
make inspect # Open MCP Inspector web UI
make schema # Dump tool schemas to stdout许可证
麻省理工学院
