Mcp 伺服器用於 Asana
概覽
MCP Server Asana 是什麼?
MCP Server Asana 是一個公共儲存庫,旨在與 Asana 整合,Asana 是一個流行的專案管理工具。這個儲存庫提供了一個伺服器端實現,允許用戶在 Asana 生態系統中無縫管理任務、專案和工作流程。通過使用 MCP Server Asana,開發人員可以自動化流程、提高生產力並簡化專案管理任務。
MCP Server Asana 的特點
- 與 Asana 整合:直接連接 Asana 的 API,有效管理任務和專案。
- 任務自動化:自動化重複性任務,減少手動工作,提高生產力。
- 友好的介面:設計直觀的介面,簡化導航和使用。
- 實時更新:提供與 Asana 的實時同步,確保所有更改立即反映。
- 開源:作為公共儲存庫,允許開發人員根據需要貢獻、修改和增強功能。
如何使用 MCP Server Asana
-
克隆儲存庫:首先從 GitHub 克隆 MCP Server Asana 儲存庫到本地機器。
git clone https://github.com/roychri/mcp-server-asana.git
-
安裝依賴:導航到專案目錄並安裝必要的依賴。
cd mcp-server-asana npm install
-
配置 API 金鑰:在配置文件中設置您的 Asana API 金鑰以啟用整合。
-
啟動伺服器:使用以下命令啟動伺服器:
npm start
-
訪問介面:打開您的網頁瀏覽器,導航到本地伺服器 URL 開始管理您的 Asana 任務。
常見問題
問題 1:MCP Server Asana 是免費使用的嗎?
是的,MCP Server Asana 是一個開源專案,免費使用和修改。
問題 2:我可以為 MCP Server Asana 專案貢獻嗎?
當然可以!歡迎貢獻。您可以分叉儲存庫,進行更改並提交拉取請求。
問題 3:MCP Server Asana 使用了哪些程式語言?
該專案主要使用 JavaScript 和 Node.js 構建,利用 Asana 的 API 進行整合。
問題 4:我該如何報告問題或錯誤?
您可以通過在 GitHub 儲存庫的「問題」標籤下創建新問題來報告問題。
問題 5:我可以在哪裡找到 MCP Server Asana 的文檔?
文檔可在儲存庫的 README 文件中找到,更多詳細信息可以在 GitHub 頁面的 Wiki 部分找到。
詳細
MCP Server for Asana
This Model Context Protocol server implementation of Asana allows you to talk to Asana API from MCP Client such as Anthropic's Claude Desktop Application, and many more.
More details on MCP here:
- https://www.anthropic.com/news/model-context-protocol
- https://modelcontextprotocol.io/introduction
- https://github.com/modelcontextprotocol
<a href="https://glama.ai/mcp/servers/ln1qzdhwmc"><img width="380" height="200" src="https://glama.ai/mcp/servers/ln1qzdhwmc/badge" alt="mcp-server-asana MCP server" /></a>
Environment Variables
ASANA_ACCESS_TOKEN
: (Required) Your Asana access tokenREAD_ONLY_MODE
: (Optional) Set to 'true' to disable all write operations. In this mode:- Tools that modify Asana data (create, update, delete) will be disabled
- The
create-task
prompt will be disabled - Only read operations will be available This is useful for testing or when you want to ensure no changes can be made to your Asana workspace.
Usage
In the AI tool of your choice (ex: Claude Desktop) ask something about asana tasks, projects, workspaces, and/or comments. Mentioning the word "asana" will increase the chance of having the LLM pick the right tool.
Example:
How many unfinished asana tasks do we have in our Sprint 30 project?
Another example:
Tools
asana_list_workspaces
- List all available workspaces in Asana
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of workspaces
asana_search_projects
- Search for projects in Asana using name pattern matching
- Required input:
- workspace (string): The workspace to search in
- name_pattern (string): Regular expression pattern to match project names
- Optional input:
- archived (boolean): Only return archived projects (default: false)
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of matching projects
asana_search_tasks
- Search tasks in a workspace with advanced filtering options
- Required input:
- workspace (string): The workspace to search in
- Optional input:
- text (string): Text to search for in task names and descriptions
- resource_subtype (string): Filter by task subtype (e.g. milestone)
- completed (boolean): Filter for completed tasks
- is_subtask (boolean): Filter for subtasks
- has_attachment (boolean): Filter for tasks with attachments
- is_blocked (boolean): Filter for tasks with incomplete dependencies
- is_blocking (boolean): Filter for incomplete tasks with dependents
- assignee, projects, sections, tags, teams, and many other advanced filters
- sort_by (string): Sort by due_date, created_at, completed_at, likes, modified_at (default: modified_at)
- sort_ascending (boolean): Sort in ascending order (default: false)
- opt_fields (string): Comma-separated list of optional fields to include
- custom_fields (object): Object containing custom field filters
- Returns: List of matching tasks
asana_get_task
- Get detailed information about a specific task
- Required input:
- task_id (string): The task ID to retrieve
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Detailed task information
asana_create_task
- Create a new task in a project
- Required input:
- project_id (string): The project to create the task in
- name (string): Name of the task
- Optional input:
- notes (string): Description of the task
- html_notes (string): HTML-like formatted description of the task
- due_on (string): Due date in YYYY-MM-DD format
- assignee (string): Assignee (can be 'me' or a user ID)
- followers (array of strings): Array of user IDs to add as followers
- parent (string): The parent task ID to set this task under
- projects (array of strings): Array of project IDs to add this task to
- resource_subtype (string): The type of the task (default_task or milestone)
- custom_fields (object): Object mapping custom field GID strings to their values
- Returns: Created task information
asana_get_task_stories
- Get comments and stories for a specific task
- Required input:
- task_id (string): The task ID to get stories for
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of task stories/comments
asana_update_task
- Update an existing task's details
- Required input:
- task_id (string): The task ID to update
- Optional input:
- name (string): New name for the task
- notes (string): New description for the task
- due_on (string): New due date in YYYY-MM-DD format
- assignee (string): New assignee (can be 'me' or a user ID)
- completed (boolean): Mark task as completed or not
- resource_subtype (string): The type of the task (default_task or milestone)
- custom_fields (object): Object mapping custom field GID strings to their values
- Returns: Updated task information
asana_get_project
- Get detailed information about a specific project
- Required input:
- project_id (string): The project ID to retrieve
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Detailed project information
asana_get_project_task_counts
- Get the number of tasks in a project
- Required input:
- project_id (string): The project ID to get task counts for
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Task count information
asana_get_project_sections
- Get sections in a project
- Required input:
- project_id (string): The project ID to get sections for
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of project sections
asana_create_task_story
- Create a comment or story on a task
- Required input:
- task_id (string): The task ID to add the story to
- text (string): The text content of the story/comment
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Created story information
asana_add_task_dependencies
- Set dependencies for a task
- Required input:
- task_id (string): The task ID to add dependencies to
- dependencies (array of strings): Array of task IDs that this task depends on
- Returns: Updated task dependencies
asana_add_task_dependents
- Set dependents for a task (tasks that depend on this task)
- Required input:
- task_id (string): The task ID to add dependents to
- dependents (array of strings): Array of task IDs that depend on this task
- Returns: Updated task dependents
asana_create_subtask
- Create a new subtask for an existing task
- Required input:
- parent_task_id (string): The parent task ID to create the subtask under
- name (string): Name of the subtask
- Optional input:
- notes (string): Description of the subtask
- due_on (string): Due date in YYYY-MM-DD format
- assignee (string): Assignee (can be 'me' or a user ID)
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Created subtask information
asana_get_multiple_tasks_by_gid
- Get detailed information about multiple tasks by their GIDs (maximum 25 tasks)
- Required input:
- task_ids (array of strings or comma-separated string): Task GIDs to retrieve (max 25)
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of detailed task information
asana_get_project_status
- Get a project status update
- Required input:
- project_status_gid (string): The project status GID to retrieve
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Project status information
asana_get_project_statuses
- Get all status updates for a project
- Required input:
- project_gid (string): The project GID to get statuses for
- Optional input:
- limit (number): Results per page (1-100)
- offset (string): Pagination offset token
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of project status updates
asana_create_project_status
- Create a new status update for a project
- Required input:
- project_gid (string): The project GID to create the status for
- text (string): The text content of the status update
- Optional input:
- color (string): The color of the status (green, yellow, red)
- title (string): The title of the status update
- html_text (string): HTML formatted text for the status update
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Created project status information
asana_delete_project_status
- Delete a project status update
- Required input:
- project_status_gid (string): The project status GID to delete
- Returns: Deletion confirmation
asana_set_parent_for_task
- Set the parent of a task and position the subtask within the other subtasks of that parent
- Required input:
- task_id (string): The task ID to operate on
- data (object):
- parent (string): The new parent of the task, or null for no parent
- Optional input:
- insert_after (string): A subtask of the parent to insert the task after, or null to insert at the beginning of the list
- insert_before (string): A subtask of the parent to insert the task before, or null to insert at the end of the list
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: Updated task information
asana_get_tasks_for_tag
- Get tasks for a specific tag
- Required input:
- tag_gid (string): The tag GID to retrieve tasks for
- Optional input:
- opt_fields (string): Comma-separated list of optional fields to include
- opt_pretty (boolean): Provides the response in a 'pretty' format
- limit (integer): The number of objects to return per page. The value must be between 1 and 100.
- offset (string): An offset to the next page returned by the API.
- Returns: List of tasks for the specified tag
asana_get_tags_for_workspace
- Get tags in a workspace
- Required input:
- workspace_gid (string): Globally unique identifier for the workspace or organization
- Optional input:
- limit (integer): Results per page. The number of objects to return per page. The value must be between 1 and 100.
- offset (string): Offset token. An offset to the next page returned by the API.
- opt_fields (string): Comma-separated list of optional fields to include
- Returns: List of tags in the workspace
Prompts
-
task-summary
- Get a summary and status update for a task based on its notes, custom fields and comments
- Required input:
- task_id (string): The task ID to get summary for
- Returns: A detailed prompt with instructions for generating a task summary
-
task-completeness
- Analyze if a task description contains all necessary details for completion
- Required input:
- task_id (string): The task ID or URL to analyze
- Returns: A detailed prompt with instructions for analyzing task completeness
-
create-task
- Create a new task with specified details
- Required input:
- project_name (string): The name of the Asana project where the task should be created
- title (string): The title of the task
- Optional input:
- notes (string): Notes or description for the task
- due_date (string): Due date for the task (YYYY-MM-DD format)
- Returns: A detailed prompt with instructions for creating a comprehensive task
Resources
-
Workspaces -
asana://workspace/{workspace_gid}
- Representation of Asana workspaces as resources
- Each workspace is exposed as a separate resource
- URI Format:
asana://workspace/{workspace_gid}
- Returns: JSON object with workspace details including:
name
: Workspace name (string)id
: Workspace global ID (string)type
: Resource type (string)is_organization
: Whether the workspace is an organization (boolean)email_domains
: List of email domains associated with the workspace (string[])
- Mime Type:
application/json
-
Projects -
asana://project/{project_gid}
- Template resource for retrieving project details by GID
- URI Format:
asana://project/{project_gid}
- Returns: JSON object with project details including:
name
: Project name (string)id
: Project global ID (string)type
: Resource type (string)archived
: Whether the project is archived (boolean)public
: Whether the project is public (boolean)notes
: Project description/notes (string)color
: Project color (string)default_view
: Default view type (string)due_date
,due_on
,start_on
: Project date information (string)workspace
: Object containing workspace informationteam
: Object containing team informationsections
: Array of section objects in the projectcustom_fields
: Array of custom field definitions for the project
- Mime Type:
application/json
Setup
-
Create an Asana account:
- Visit the Asana.
- Click "Sign up".
-
Retrieve the Asana Access Token:
- You can generate a personal access token from the Asana developer console.
- More details here: https://developers.asana.com/docs/personal-access-token
-
Installation Options:
For Claude Desktop:
Add the following to your
claude_desktop_config.json
:{ "mcpServers": { "asana": { "command": "npx", "args": ["-y", "@roychri/mcp-server-asana"], "env": { "ASANA_ACCESS_TOKEN": "your-asana-access-token" } } } }
For Claude Code:
Use the following command to install and configure the MCP server:
claude mcp add asana -e ASANA_ACCESS_TOKEN=<TOKEN> -- npx -y @roychri/mcp-server-asana
Replace
<TOKEN>
with your Asana access token.
If you want to install the beta version (not yet released), you can use:
@roychri/mcp-server-asana@beta
You can find the current beta release, if any, with either:
- https://www.npmjs.com/package/@roychri/mcp-server-asana?activeTab=versions
npm dist-tag ls @roychri/mcp-server-asana
Troubleshooting
If you encounter permission errors:
- Ensure the asana plan you have allows API access
- Confirm the access token and configuration are correctly set in
claude_desktop_config.json
.
Contributing
Clone this repo and start hacking.
Test it locally with the MCP Inspector
If you want to test your changes, you can use the MCP Inspector like this:
npm run inspector
This will expose the client to port 5173
and server to port 3000
.
If those ports are already used by something else, you can use:
CLIENT_PORT=5009 SERVER_PORT=3009 npm run inspector
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
伺服器配置
{
"mcpServers": {
"mcp-server-asana": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--roychri--mcp-server-asana--mcp-server-asana",
"npm run start"
],
"env": {
"ASANA_ACCESS_TOKEN": "asana-access-token"
}
}
}
}