Skip to content

Latest commit

 

History

History
106 lines (74 loc) · 3.05 KB

File metadata and controls

106 lines (74 loc) · 3.05 KB

Teamwork MCP HTTP CLI

Command-line interface for interacting with the Teamwork MCP server via HTTP

Go MCP

📖 Overview

The Teamwork MCP HTTP CLI is a command-line tool that allows you to interact with the Teamwork MCP (Model Context Protocol) server over HTTP. This tool provides a simple way to test MCP tools, list available capabilities, and debug integrations without needing to set up a full LLM client.

🤖 What is this CLI for?

This CLI tool is designed for:

  • Testing MCP tools: Execute individual tools and see their responses
  • Development and debugging: Validate MCP server functionality during development
  • Exploration: Discover available tools and their parameters

✨ Features

  • HTTP Transport: Connect to MCP servers via HTTP with authentication
  • Tool Listing: Display all available tools and their descriptions
  • Tool Execution: Call specific tools with custom parameters
  • JSON Parameter Support: Pass complex parameters as JSON strings
  • Structured Logging: Clear output with detailed logging information

🚀 Quick Start

📋 Prerequisites

  • Go 1.26 or later
  • Valid Teamwork MCP server URL and bearer token
  • Running Teamwork MCP server (see main README)

🏃 Running the CLI

Basic Usage

# 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"}'

Using Environment Variables

Set the bearer token via environment variable:

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

⚙️ Configuration

The CLI accepts the following command-line flags:

Flag Environment Variable Description Default
-mcp-url - URL of the MCP server to connect to https://mcp.ai.teamwork.com
-mcp-token TW_MCP_BEARER_TOKEN Bearer token for authentication (from environment)

📝 Commands

list-tools

Lists all available tools from the MCP server.

go run cmd/mcp-http-cli/main.go list-tools

call-tool <tool-name> [parameters]

Calls a specific tool with optional JSON parameters.

# 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"
}'