Skip to main content
Glama
dev-in-black

OpenProject MCP Server

by dev-in-black

add_watcher

Add a user as a watcher to monitor updates and changes in a specific work package within OpenProject.

Instructions

Add a user as a watcher to a work package.

Args:
    work_package_id: Work package ID
    user_id: User ID to add as watcher

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_package_idYes
user_idYes

Implementation Reference

  • Core implementation of add_watcher: Posts to OpenProject API to add user as watcher to work package.
    async def add_watcher(work_package_id: int, user_id: int) -> dict[str, Any]:
        """Add a user as a watcher to a work package.
    
        Args:
            work_package_id: Work package ID
            user_id: User ID to add as watcher
    
        Returns:
            Updated work package with watchers information
        """
        client = OpenProjectClient()
    
        try:
            payload = {"user": build_link(f"/api/v3/users/{user_id}")}
    
            result = await client.post(
                f"work_packages/{work_package_id}/watchers", data=payload
            )
            return result
        finally:
            await client.close()
  • Tool registration via @mcp.tool() decorator. Thin wrapper delegating to work_packages.add_watcher.
    @mcp.tool()
    async def add_watcher(work_package_id: int, user_id: int):
        """Add a user as a watcher to a work package.
    
        Args:
            work_package_id: Work package ID
            user_id: User ID to add as watcher
        """
        return await work_packages.add_watcher(
            work_package_id=work_package_id, user_id=user_id
        )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dev-in-black/openproject-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server