### Install Python Dependencies Source: https://github.com/teamwork/mcp/blob/main/examples/python-langchain/README.md Installs required Python packages for the Teamwork MCP client. It supports installation both directly and within a virtual environment. Ensure you are in the 'examples/python-langchain' directory. ```bash cd examples/python-langchain pip install -r requirements.txt ``` ```bash cd examples/python-langchain python -m venv venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Start Teamwork MCP HTTP Server (Go) Source: https://github.com/teamwork/mcp/blob/main/README.md Starts the production-ready HTTP server for cloud deployments and multi-client support. Requires Go and a Teamwork.com bearer token or OAuth2 setup. ```bash TW_MCP_SERVER_ADDRESS=:8080 go run cmd/mcp-http/main.go ``` -------------------------------- ### Go Project Setup and Dependency Management Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Commands to set up the Go toolchain, download project dependencies, and format code. Ensures the project adheres to Go coding standards. ```shell go mod download gofmt -s -w . go vet ./... golangci-lint -c .golangci.yml run ./... ``` -------------------------------- ### Start Teamwork MCP STDIO Server (Go) Source: https://github.com/teamwork/mcp/blob/main/README.md Starts the direct STDIO interface for desktop applications and development environments. Requires Go and a Teamwork.com bearer token or OAuth2 setup. ```bash TW_MCP_BEARER_TOKEN=your-token go run cmd/mcp-stdio/main.go ``` -------------------------------- ### Use HTTP CLI for MCP Server Testing Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Examples of using the HTTP CLI to interact with the MCP HTTP server. It demonstrates listing available tools and calling a specific tool with JSON payload. ```shell go run cmd/mcp-http-cli/main.go -mcp-url= -mcp-token= list-tools go run cmd/mcp-http-cli/main.go -mcp-url= -mcp-token= call-tool '{"k":"v"}' ``` -------------------------------- ### Run Teamwork MCP Python Client Example Source: https://github.com/teamwork/mcp/blob/main/examples/python-langchain/README.md Executes the main Python script for the Teamwork MCP client. Allows specifying the LLM model to use via the --llm-model argument. Other optional arguments include --server and --bearer-token. ```bash cd examples/python-langchain python main.py --llm-model openai:gpt-4o ``` -------------------------------- ### Verify Go Installation Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Checks if the Go programming language is installed and displays its version. This is a prerequisite for development. ```bash go version ``` -------------------------------- ### Go Project Testing Instructions Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Commands for running Go tests within the project. It covers running all tests, focusing on a specific package, and running a single test case by name. ```shell go test ./... go test ./internal/twprojects go test ./internal/twprojects -run TestName ``` -------------------------------- ### Run STDIO Server with Go Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Instructions to run the Model Context Protocol (MCP) server using the STDIO transport. It highlights required environment variables and optional flags for read-only mode and toolset filtering. ```shell export TW_MCP_BEARER_TOKEN= go run cmd/mcp-stdio/main.go -read-only -toolsets= ``` -------------------------------- ### Start Teamwork MCP HTTP Server Source: https://context7.com/teamwork/mcp/llms.txt Launches the production-ready HTTP MCP server for cloud deployments. Supports configurable addresses, environment settings, logging, and integrates with Datadog APM for observability. Includes a health check endpoint. ```bash # Basic HTTP server with default configuration TW_MCP_SERVER_ADDRESS=:8080 go run cmd/mcp-http/main.go # Production deployment with full configuration TW_MCP_URL=https://mcp.ai.teamwork.com \ TW_MCP_SERVER_ADDRESS=:8080 \ TW_MCP_ENV=production \ TW_MCP_VERSION=v1.0.0 \ TW_MCP_LOG_FORMAT=json \ TW_MCP_LOG_LEVEL=info \ TW_MCP_API_URL=https://teamwork.com \ DD_APM_TRACING_ENABLED=true \ DD_SERVICE=teamwork-mcp \ DD_AGENT_HOST=datadog-agent \ go run cmd/mcp-http/main.go # Health check endpoint curl http://localhost:8080/health # Response: {"status": "ok"} ``` -------------------------------- ### Configure Claude Desktop with Docker `tw-mcp` Source: https://github.com/teamwork/mcp/blob/main/usage.md This JSON configuration enables Claude Desktop to connect to Teamwork.com using a Docker container for the `tw-mcp` binary. It specifies the Docker command, arguments for running the container, and environment variables, including the bearer token. This method avoids the need to install `tw-mcp` directly on the system. ```json { "mcpServers": { "Teamwork.com": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "TW_MCP_BEARER_TOKEN", "ghcr.io/teamwork/mcp:latest" ], "env": { "TW_MCP_BEARER_TOKEN": "" } } } } ``` -------------------------------- ### Run HTTP Server with Go Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Commands to run the MCP server with HTTP transport, including setting the server address and log level. Also includes how to check the health endpoint. ```shell export TW_MCP_SERVER_ADDRESS=:8080 export TW_MCP_LOG_LEVEL=debug go run cmd/mcp-http/main.go GET /health ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Installs and updates the Go module dependencies for the project using `go mod tidy`. This ensures all required libraries are available. ```bash go mod tidy ``` -------------------------------- ### Run Teamwork MCP HTTP CLI (Bash) Source: https://github.com/teamwork/mcp/blob/main/cmd/mcp-http-cli/README.md Examples of how to run the Teamwork MCP HTTP CLI using 'go run' for basic usage, listing tools, calling tools without parameters, and calling tools with JSON parameters. It also shows how to set environment variables for authentication. ```bash # List all available tools go run cmd/mcp-http-cli/main.go list-tools # Call a tool without parameters go run cmd/mcp-http-cli/main.go \ -mcp-url=https://my-mcp.example.com \ -mcp-token=your-bearer-token \ call-tool twprojects-list_projects # Call a tool with JSON parameters go run cmd/mcp-http-cli/main.go \ -mcp-url=https://my-mcp.example.com \ -mcp-token=your-bearer-token \ call-tool twprojects-get_comment '{"id": "123456"}' ``` ```bash export TW_MCP_BEARER_TOKEN=your-bearer-token go run cmd/mcp-http-cli/main.go \ -mcp-url=https://my-mcp.example.com \ list-tools ``` ```bash # Without parameters go run cmd/mcp-http-cli/main.go call-tool twprojects-list_projects # With parameters go run cmd/mcp-http-cli/main.go call-tool twprojects-get_comment '{"id": "123456"}' # Complex parameters go run cmd/mcp-http-cli/main.go call-tool twprojects-create_task '{ "tasklist_id": "123456", "name": "New Task" }' ``` -------------------------------- ### MCP Client Configuration for Teamwork STDIO Server (JSON) Source: https://github.com/teamwork/mcp/blob/main/cmd/mcp-stdio/README.md Example JSON configuration for an MCP client to connect to the Teamwork STDIO server. Specifies the command to run, arguments, and environment variables including the bearer token. ```json { "mcpServers": { "teamwork": { "command": "go", "args": [ "run", "/path/to/teamwork/mcp/cmd/mcp-stdio/main.go" ], "env": { "TW_MCP_BEARER_TOKEN": "your-bearer-token" } } } } ``` -------------------------------- ### Manage Projects via Teamwork MCP HTTP CLI Source: https://context7.com/teamwork/mcp/llms.txt Provides examples for managing projects in Teamwork.com using the MCP HTTP CLI. Includes operations for retrieving project details, listing projects with filters, updating existing projects, and deleting projects. ```bash # Get project details go run cmd/mcp-http-cli/main.go call-tool twprojects-get_project '{"id": 54321}' # Returns: JSON with project details, links to /app/projects/54321 # List projects with filters go run cmd/mcp-http-cli/main.go call-tool twprojects-list_projects '{ \ "search_term": "marketing", \ "tag_ids": [10, 20], \ "match_all_tags": true, \ "page": 1, \ "page_size": 25 \ }' # Update project go run cmd/mcp-http-cli/main.go call-tool twprojects-update_project '{ \ "id": 54321, \ "name": "Q1 Marketing Campaign - Updated", \ "end_at": "20250415" \ }' # Response: "Project updated successfully" # Delete project (if delete permissions enabled) go run cmd/mcp-http-cli/main.go call-tool twprojects-delete_project '{"id": 54321}' # Response: "Project deleted successfully" ``` -------------------------------- ### Go Code for Tool Registration Source: https://github.com/teamwork/mcp/blob/main/AGENTS.md Illustrates how tools are registered within the MCP project using `DefaultToolsetGroup`. It shows the separation of read-only and write operations, and the gating of destructive operations. ```go import ( "context" "your_project/internal/server" "your_project/internal/twprojects" ) func DefaultToolsetGroup(readOnly, allowDelete bool, engine twprojects.Engine) *server.ToolsetGroup { group := server.NewToolsetGroup() // Add read-only tools twprojects.AddReadTools(group, engine) // Add write tools (if not read-only) if !readOnly { twprojects.AddWriteTools(group, engine) } // Add delete tools (guarded by allowDelete) if allowDelete { twprojects.AddDeleteTools(group, engine) } return group } ``` -------------------------------- ### Claude Desktop Integration Configuration Source: https://context7.com/teamwork/mcp/llms.txt JSON configuration for integrating Claude Desktop with Teamwork.com MCP via STDIO. This setup uses a bearer token for authentication and specifies the command and arguments for the MCP server. ```json { "mcpServers": { "Teamwork.com": { "command": "tw-mcp", "args": [], "env": { "TW_MCP_BEARER_TOKEN": "your-bearer-token" } } } } ``` -------------------------------- ### Start Teamwork MCP STDIO Server Source: https://context7.com/teamwork/mcp/llms.txt Launches the STDIO MCP server for desktop applications and local development. Supports bearer token authentication, configurable log levels, read-only mode, and selective toolset enabling. Can be configured via a JSON file for integration with applications like Claude Desktop. ```bash # All toolsets enabled (default) TW_MCP_BEARER_TOKEN=your-bearer-token \ go run cmd/mcp-stdio/main.go # Read-only mode for safe testing TW_MCP_BEARER_TOKEN=your-bearer-token \ TW_MCP_LOG_LEVEL=debug \ go run cmd/mcp-stdio/main.go -read-only # Enable specific toolsets only TW_MCP_BEARER_TOKEN=your-bearer-token \ go run cmd/mcp-stdio/main.go \ -toolsets=twprojects-list_projects,twprojects-get_project,twprojects-list_tasks # Integration with Claude Desktop (config file) { "mcpServers": { "teamwork": { "command": "/usr/local/bin/tw-mcp", "args": [], "env": { "TW_MCP_BEARER_TOKEN": "your-bearer-token" } } } } ``` -------------------------------- ### Configure Claude Desktop with `tw-mcp` Source: https://github.com/teamwork/mcp/blob/main/usage.md This JSON configuration is used for Claude Desktop to connect to Teamwork.com via a local `tw-mcp` binary. It specifies the command to run, arguments, and environment variables, including the bearer token for authentication. Ensure the `tw-mcp` binary is in your system's PATH. ```json { "mcpServers": { "Teamwork.com": { "command": "tw-mcp", "args": [], "env": { "TW_MCP_BEARER_TOKEN": "" } } } } ``` -------------------------------- ### Track Time with Timers using MCP CLI Source: https://context7.com/teamwork/mcp/llms.txt Commands for managing timers, including creating, starting, pausing, resuming, updating, completing, and deleting timers. These operations utilize the `twprojects-` tools and require JSON input for timer configuration. ```bash # Create and start a timer for a task go run cmd/mcp-http-cli/main.go call-tool twprojects-create_timer '{ "project_id": 54321, "task_id": 99999, "description": "Working on landing page design", "billable": true, "running": true, "stop_running_timers": true }' # Response: "Timer created successfully with ID 88888" # Create stopped timer with initial time go run cmd/mcp-http-cli/main.go call-tool twprojects-create_timer '{ "project_id": 54321, "task_id": 99999, "description": "Code review session", "billable": true, "running": false, "seconds": 3600 }' # Get timer details go run cmd/mcp-http-cli/main.go call-tool twprojects-get_timer '{"id": 88888}' # List all running timers go run cmd/mcp-http-cli/main.go call-tool twprojects-list_timers '{ "running_timers_only": true }' # List timers by user and project go run cmd/mcp-http-cli/main.go call-tool twprojects-list_timers '{ "user_id": 301, "project_id": 54321, "page": 1, "page_size": 20 }' # Pause running timer go run cmd/mcp-http-cli/main.go call-tool twprojects-pause_timer '{"id": 88888}' # Response: "Timer paused successfully" # Resume paused timer go run cmd/mcp-http-cli/main.go call-tool twprojects-resume_timer '{"id": 88888}' # Response: "Timer resumed successfully" # Update timer details go run cmd/mcp-http-cli/main.go call-tool twprojects-update_timer '{ "id": 88888, "description": "Updated description for timer", "billable": false }' # Complete timer and save as time log go run cmd/mcp-http-cli/main.go call-tool twprojects-complete_timer '{"id": 88888}' # Response: "Timer completed successfully" # Delete timer go run cmd/mcp-http-cli/main.go call-tool twprojects-delete_timer '{"id": 88888}' ``` -------------------------------- ### LangChain Python AI Agent Integration with Teamwork MCP Source: https://context7.com/teamwork/mcp/llms.txt Create Python-based AI agents that leverage Teamwork.com capabilities through MCP tools using LangChain. This example shows how to set up the MCP client, load tools, create an agent, and invoke it with a specific request. ```python import asyncio import os from langchain_mcp_adapters.client import MultiServerMCPClient from langchain_mcp_adapters.tools import load_mcp_tools from langgraph.prebuilt import create_react_agent async def main(): client = MultiServerMCPClient({ "Teamwork.com": { "transport": "streamable_http", "url": "https://mcp.ai.teamwork.com", "headers": { "Authorization": f"Bearer {os.getenv('TW_MCP_BEARER_TOKEN')}", } }, }) async with client.session("Teamwork.com") as session: tools = await load_mcp_tools(session) agent = create_react_agent("openai:gpt-4.1", tools) response = await agent.ainvoke({ "messages": "Create a new task in project 12345" }) print(response.get("messages", [])[-1].content) asyncio.run(main()) ``` -------------------------------- ### Run Teamwork MCP HTTP Server with Go Source: https://github.com/teamwork/mcp/blob/main/cmd/mcp-http/README.md This snippet shows how to run the Teamwork MCP HTTP server using Go. It demonstrates basic execution and how to apply custom configurations via environment variables for aspects like the server address, MCP URL, and logging level. Ensure Go 1.25 or later is installed. ```bash # Basic HTTP server TW_MCP_SERVER_ADDRESS=:8080 \ go run cmd/mcp-http/main.go # With custom configuration TW_MCP_URL=https://my-mcp.example.com \ TW_MCP_SERVER_ADDRESS=:8080 \ TW_MCP_LOG_LEVEL=debug \ go run cmd/mcp-http/main.go ``` -------------------------------- ### Configure Environment Variables for Teamwork MCP and LLM Source: https://github.com/teamwork/mcp/blob/main/examples/python-langchain/README.md Sets environment variables necessary for the Teamwork MCP client authentication and for specifying different Large Language Models (LLMs). The TW_MCP_BEARER_TOKEN is mandatory for MCP server authentication. API keys for OpenAI, Anthropic, and Google Generative AI are required for specific LLM providers. ```bash export TW_MCP_BEARER_TOKEN="your-bearer-token-here" ``` ```bash # when using openai:gpt-4, openai:gpt-4-turbo, openai:gpt-3.5-turbo, etc. export OPENAI_API_KEY="your-openai-api-key-here" ``` ```bash # when using anthropic:claude-3-5-sonnet-20241022, anthropic:claude-3-opus-20240229, etc. export ANTHROPIC_API_KEY="your-anthropic-api-key-here" ``` ```bash # when using google_genai:gemini-2.5-flash, etc. export GOOGLE_API_KEY="your-google-api-key-here" ``` -------------------------------- ### Gemini CLI Integration Configuration Source: https://context7.com/teamwork/mcp/llms.txt JSON configuration for integrating Gemini CLI with Teamwork.com MCP using a hosted HTTP endpoint. This setup utilizes OAuth personal authentication and specifies the HTTP URL, bearer token authorization, and connection timeout. ```json { "selectedAuthType": "oauth-personal", "mcpServers": { "Teamwork.com": { "httpUrl": "https://mcp.ai.teamwork.com", "headers": { "Authorization": "Bearer your-bearer-token" }, "trust": false, "timeout": 5000 } } } ``` -------------------------------- ### Generate Bearer Token using Node.js CLI Source: https://github.com/teamwork/mcp/blob/main/usage.md This command-line interface (CLI) tool, provided by Teamwork, interactively helps users obtain a bearer token for authentication. The generated token is typically used in the configuration of MCP clients to authenticate with Teamwork.com services. ```bash npx @teamwork/get-bearer-token ``` -------------------------------- ### Configure Gemini CLI for Teamwork.com HTTP MCP Source: https://github.com/teamwork/mcp/blob/main/usage.md This JSON configuration is for the Gemini CLI to connect to the hosted Teamwork.com MCP endpoint. It specifies the `httpUrl`, the `Authorization` header with the bearer token, and a `trust: false` setting to prompt for confirmation before executing actions. The `timeout` is set to 5000 milliseconds. ```json { "selectedAuthType": "oauth-personal", "mcpServers": { "Teamwork.com": { "httpUrl": "https://mcp.ai.teamwork.com", "headers": { "Authorization": "Bearer " }, "trust": false, "timeout": 5000 } } } ``` -------------------------------- ### Run MCP Inspector with Node.js Source: https://github.com/teamwork/mcp/blob/main/cmd/mcp-http/README.md This command executes the MCP Inspector tool using Node.js for debugging purposes. It requires setting the NODE_EXTRA_CA_CERTS environment variable when using OAuth2 authentication with the Let's Encrypt certification authority. Ensure Node.js and the inspector tool are installed. ```bash NODE_EXTRA_CA_CERTS=letsencrypt-stg-root-x1.pem npx @modelcontextprotocol/inspector node build/index.js ``` -------------------------------- ### Mock MCP Server and Execute Request for twprojects Source: https://github.com/teamwork/mcp/blob/main/internal/testutil/README.md Demonstrates how to create a mock MCP server for twprojects tests and execute a tool request using helper functions. It sets up a mock server response and uses `ExecuteToolRequest` to simulate an API call. ```go import "github.com/teamwork/mcp/internal/testutil" func TestSomething(t *testing.T) { mcpServer := testutil.ProjectsMCPServerMock(t, http.StatusOK, []byte(`{"id": 123}`)) // Use testutil.ExecuteToolRequest for simple cases testutil.ExecuteToolRequest(t, mcpServer, "twprojects-get_comment", map[string]any{ "id": float64(123), }) } ``` -------------------------------- ### Create Project via Teamwork MCP HTTP CLI Source: https://context7.com/teamwork/mcp/llms.txt Demonstrates creating a new project in Teamwork.com using the MCP HTTP CLI tool. Shows how to specify project details like name, description, dates, company, owner, and tags. ```bash # Create new project via HTTP CLI go run cmd/mcp-http-cli/main.go \ -mcp-url=https://mcp.ai.teamwork.com \ -mcp-token=your-bearer-token \ call-tool twprojects-create_project '{ \ "name": "Q1 Marketing Campaign", \ "description": "Launch new product marketing initiative", \ "start_at": "20250201", \ "end_at": "20250331", \ "company_id": 1001, \ "owned_id": 2002, \ "tag_ids": [10, 20, 30] \ }' # Response: "Project created successfully with ID 54321" ``` -------------------------------- ### Mock MCP Server and Execute Request for twdesk Source: https://github.com/teamwork/mcp/blob/main/internal/testutil/README.md Illustrates setting up a mock MCP server for twdesk tests, including a cleanup function, and executing a tool request. It uses `DeskMCPServerMock` for the mock server and `ExecuteToolRequest` for the request. ```go import "github.com/teamwork/mcp/internal/testutil" func TestSomething(t *testing.T) { mcpServer, cleanup := testutil.DeskMCPServerMock(t, http.StatusOK, []byte(`{"ticket_priority": {"id": 123}}`)) defer cleanup() // Use testutil.ExecuteToolRequest for simple cases testutil.ExecuteToolRequest(t, mcpServer, "twdesk-get_priority", map[string]any{ "id": 123, }) } ``` -------------------------------- ### Run Teamwork MCP HTTP CLI (Go) Source: https://github.com/teamwork/mcp/blob/main/README.md Executes the command-line tool for testing and debugging MCP server functionality via HTTP. Requires Go and the URL of the MCP server. ```bash go run cmd/mcp-http-cli/main.go -mcp-url=https://mcp.example.com list-tools ``` -------------------------------- ### Run Teamwork MCP STDIO Server (Go) Source: https://github.com/teamwork/mcp/blob/main/cmd/mcp-stdio/README.md Basic command to run the Teamwork MCP STDIO server using Go. Requires a bearer token and can be configured with flags for read-only mode or specific toolsets. ```bash TW_MCP_BEARER_TOKEN=your-bearer-token \ go run cmd/mcp-stdio/main.go ``` ```bash TW_MCP_BEARER_TOKEN=your-bearer-token \ go run cmd/mcp-stdio/main.go -read-only ``` ```bash TW_MCP_BEARER_TOKEN=your-bearer-token \ go run cmd/mcp-stdio/main.go -toolsets=twprojects-list_projects,twprojects-get_project ``` -------------------------------- ### Use Teamwork MCP HTTP CLI Tool Source: https://context7.com/teamwork/mcp/llms.txt Interacts with the Teamwork MCP HTTP server using a command-line interface. Allows listing available tools, calling tools with or without parameters, and executing complex operations like task creation. ```bash # List all available tools go run cmd/mcp-http-cli/main.go \ -mcp-url=https://mcp.ai.teamwork.com \ -mcp-token=your-bearer-token \ list-tools # Call tool without parameters export TW_MCP_BEARER_TOKEN=your-bearer-token go run cmd/mcp-http-cli/main.go \ -mcp-url=https://mcp.ai.teamwork.com \ call-tool twprojects-list_projects # Call tool with JSON parameters go run cmd/mcp-http-cli/main.go \ -mcp-url=https://mcp.ai.teamwork.com \ -mcp-token=your-bearer-token \ call-tool twprojects-get_project '{"id": 12345}' # Create task with complex parameters go run cmd/mcp-http-cli/main.go \ -mcp-url=https://mcp.ai.teamwork.com \ -mcp-token=your-bearer-token \ call-tool twprojects-create_task '{ \ "tasklist_id": 67890, \ "name": "Implement new feature", \ "description": "Add user authentication", \ "priority": "high", \ "due_date": "2025-12-31", \ "estimated_minutes": 480, \ "assignees": { \ "user_ids": [123, 456] \ } \ }' ``` -------------------------------- ### Run All Go Tests Source: https://github.com/teamwork/mcp/blob/main/README.md Executes all tests within the project using the Go testing framework. This is used for development and verifying code integrity. ```bash go test ./... ``` -------------------------------- ### Run All Tests Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Executes all tests within the Teamwork MCP Server project. Requires environment variables TWAPI_SERVER and TWAPI_TOKEN to be set for Teamwork API interaction. ```bash TWAPI_SERVER=https://yourdomain.teamwork.com/ TWAPI_TOKEN=your_api_token go test -v ./... ``` -------------------------------- ### Clone Repository Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Clones a fork of the Teamwork MCP Server repository to your local machine. Assumes you have already forked the repository on GitHub. ```bash git clone https://github.com/YOUR_USERNAME/mcp.git cd mcp ``` -------------------------------- ### Secure API Key Management in Go Source: https://github.com/teamwork/mcp/blob/main/SECURITY.md Demonstrates the recommended method for securely handling API keys in Go applications by using environment variables. Avoids hardcoding sensitive keys directly in the source code, which is a security risk. ```go // ✅ Good: Use environment variables apiKey := os.Getenv("TEAMWORK_API_KEY") ``` ```go // ❌ Bad: Hardcoded API keys apiKey := "tk_live_12345..." ``` -------------------------------- ### Manage Tasks using MCP CLI Source: https://context7.com/teamwork/mcp/llms.txt Commands to create, retrieve, list, update, and delete tasks within the Teamwork project. These operations require the `twprojects-` tools and accept JSON payloads for configuration. ```bash # Create task with full configuration go run cmd/mcp-http-cli/main.go call-tool twprojects-create_task '{ "tasklist_id": 78901, "name": "Design landing page mockups", "description": "Create mobile and desktop versions", "priority": "high", "progress": 0, "start_date": "2025-02-01", "due_date": "2025-02-15", "estimated_minutes": 960, "assignees": { "user_ids": [301, 302], "team_ids": [25] }, "tag_ids": [40, 41], "predecessors": [ { "task_id": 5000, "type": "complete" } ] }' # Response: "Task created successfully with ID 99999" # Get task details go run cmd/mcp-http-cli/main.go call-tool twprojects-get_task '{"id": 99999}' # List all tasks with filters go run cmd/mcp-http-cli/main.go call-tool twprojects-list_tasks '{ "search_term": "design", "tag_ids": [40], "assignee_user_ids": [301], "page": 1, "page_size": 50 }' # List tasks by project go run cmd/mcp-http-cli/main.go call-tool twprojects-list_tasks_by_project '{ "project_id": 54321, "search_term": "mockup" }' # Update task progress go run cmd/mcp-http-cli/main.go call-tool twprojects-update_task '{ "id": 99999, "progress": 50, "priority": "medium" }' # Response: "Task updated successfully" # Delete task go run cmd/mcp-http-cli/main.go call-tool twprojects-delete_task '{"id": 99999}' ``` -------------------------------- ### LangChain Node.js AI Agent Integration with Teamwork MCP Source: https://context7.com/teamwork/mcp/llms.txt Build AI agents in Node.js that interact with Teamwork.com through the MCP protocol using LangChain. This snippet demonstrates initializing the MCP client, fetching tools, setting up a language model, creating a React agent, and invoking it with a user query. ```typescript import { ChatOpenAI } from '@langchain/openai'; import { MultiServerMCPClient } from '@langchain/mcp-adapters'; import { createReactAgent } from '@langchain/langgraph/prebuilt'; const client = new MultiServerMCPClient({ mcpServers: { teamwork: { url: 'https://mcp.ai.teamwork.com', headers: { Authorization: `Bearer ${process.env.TW_MCP_BEARER_TOKEN}`, } }, }, }); const tools = await client.getTools(); const model = new ChatOpenAI({ model: 'gpt-4o-mini' }); const agent = createReactAgent({ llm: model, tools, }); const response = await agent.invoke({ messages: [ { role: 'user', content: 'List all projects tagged with "marketing"' } ], }); console.log(response.messages[response.messages.length - 1].content); ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Executes all tests in the project and generates a coverage report. This helps identify which parts of the codebase are not adequately tested. ```bash TWAPI_SERVER=https://yourdomain.teamwork.com/ TWAPI_TOKEN=your_api_token go test -v -cover ./... ``` -------------------------------- ### Run Specific Go Package Tests Source: https://github.com/teamwork/mcp/blob/main/README.md Executes tests for a specific package within the project using the Go testing framework. Useful for targeted testing during development. ```bash go test ./internal/twprojects/ ``` -------------------------------- ### Run Linters Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Runs `golangci-lint` to check for code quality issues and enforce coding standards. This helps maintain a consistent and high-quality codebase. ```bash golangci-lint -c .golangci.yml run ./... ``` -------------------------------- ### Secure Error Handling in Go Source: https://github.com/teamwork/mcp/blob/main/SECURITY.md Illustrates secure error handling practices in Go. The recommended approach involves logging generic error messages without exposing sensitive information like API keys, which could be a security vulnerability if logged. ```go // ✅ Good: Generic error handling if err != nil { log.Printf("API request failed: %v", err.Error()) return } ``` ```go // ❌ Bad: Logging potentially sensitive data if err != nil { log.Printf("Failed with token %s: %v", apiKey, err) return } ``` -------------------------------- ### Run Tests for Specific Package Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Executes tests only for a specified package within the project, such as `internal/twprojects`. This is useful for focusing on a specific area of the code. ```bash TWAPI_SERVER=https://yourdomain.teamwork.com/ TWAPI_TOKEN=your_api_token go test -v ./internal/twprojects ``` -------------------------------- ### Run Specific Test Function Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Executes a single, specific test function within a package. This is helpful for quickly testing a particular piece of functionality or a bug fix. ```bash TWAPI_SERVER=https://yourdomain.teamwork.com/ TWAPI_TOKEN=your_api_token go test -v -run TestSpecificFunction ./internal/twprojects ``` -------------------------------- ### Commit Changes Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Stages all changes in the current directory and creates a commit with a descriptive message. This is a standard Git workflow for saving changes. ```bash git add . git commit -m "Feature: Add new authentication method" ``` -------------------------------- ### Push Changes to Fork Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Pushes the committed changes from your local feature branch to your remote fork on GitHub. This makes your changes available for creating a pull request. ```bash git push origin feature/your-feature-name ``` -------------------------------- ### Update Main Branch Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Updates your local `main` branch with the latest changes from the upstream repository and then pushes these updates to your fork. This is crucial for keeping your fork synchronized. ```bash git checkout main git pull upstream main git push origin main ``` -------------------------------- ### Create Feature Branch Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Creates a new Git branch for developing a new feature. It first pulls the latest changes from the upstream main branch and then creates a new branch off it. ```bash git checkout main git pull upstream main git checkout -b feature/your-feature-name ``` -------------------------------- ### Add Upstream Remote Source: https://github.com/teamwork/mcp/blob/main/CONTRIBUTING.md Adds the official Teamwork MCP Server repository as an upstream remote. This allows you to pull changes from the main project to keep your fork synchronized. ```bash git remote add upstream https://github.com/teamwork/mcp.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.