Skip to main content
Version: 0.1.0

CLI usages and scenarios

This page documents how to run the MCP server transport and how to connect to it from clients, with common usage scenarios.

MCP server CLI (clickup-mcp-server)

Starts the FastAPI web app that hosts the ClickUp MCP server. It loads configuration from a .env file (or a path passed via --env), resolves the API token, and mounts the MCP transport endpoints.

  • Uses .env for configuration first; --token can override the token.
  • Default transport is SSE mounted at /sse; HTTP streaming can be enabled at /mcp via --transport http-streaming.
  • Provides a health endpoint at /health for quick status checks.
  • Suitable for local development and deployment.

Synopsis

clickup-mcp-server [--env <path>] [--token <token>] [--host <host>] [--port <port>] \
[--log-level <level>] [--reload] [--transport <sse|http-streaming>]

Options

OptionRequiredTypeDefaultAllowed valuesUsage exampleDescription
--envOptionalstring.env---env /path/to/.envPath to a dotenv file. Loaded first to populate environment variables. If not provided or not found, the server will attempt to auto-discover a .env in the current or parent directories.
--tokenOptionalstringNone---token YOUR_TOKENClickUp API token. If provided, it overrides any token loaded from .env. If omitted, the server looks for CLICKUP_API_TOKEN (preferred) or E2E_TEST_API_TOKEN in the environment.
--hostOptionalstring0.0.0.0---host 0.0.0.0Host interface to bind the server to.
--portOptionalnumber80001–65535--port 8000Port to bind the server to. Must be between 1 and 65535.
--log-levelOptionalenuminfodebug, info, warning, error, critical--log-level debugLogging level.
--reloadOptionalbooleanfalsetrue, false--reloadEnable auto-reload for development (watches files and restarts on changes).
--transportOptionalenumssesse, http-streaming--transport sseTransport protocol used by the MCP server. SSE mounts at /sse; HTTP streaming mounts at /mcp.
Token loading precedence
  • .env is loaded first (auto-discovered or via --env).
  • --token overrides any token value from .env.
  • The server reads CLICKUP_API_TOKEN (preferred) or E2E_TEST_API_TOKEN.

Environment variables (.env)

You can configure the server via a dotenv file. The server will:

  • Load the specified file via --env, or
  • Auto-discover a .env file from the current directory upward (parent directories) when --env is not provided.
VariableRequiredApplies toExampleDescription
CLICKUP_API_TOKENYes (unless --token is set)Serversk_clickup_xxxPreferred API token used by the server for authentication. Loaded from .env first; can be overridden by --token.
CLICKUP_WEBHOOK_HANDLER_MODULESOptionalServer/Consumermy_app.webhooks.handlers,more.pkgComma-separated module paths to auto-import at startup so your custom handlers are registered. Modules must be importable on PYTHONPATH.
QUEUE_BACKENDOptionalConsumerlocalMessage queue backend selection for webhook event sink/consumer. Common local value is local. Other values depend on your abe backends installation.

Minimal .env example:

CLICKUP_API_TOKEN=sk_clickup_XXXXXXXXXXXXXXXX
CLICKUP_WEBHOOK_HANDLER_MODULES=my_app.webhooks.handlers
QUEUE_BACKEND=local

For development-only and E2E testing variables (including E2E_TEST_API_TOKEN and ClickUp test IDs), see the Development Requirements page.

Transports

  • SSE (default): mounted at /sse
  • HTTP streaming: mounted at /mcp

Client usage examples

SSE client

import asyncio
from mcp import ClientSession
from mcp.client.sse import sse_client

async def main():
url = "http://localhost:8000/sse"
async with sse_client(url) as (read_stream, write_stream):
async with ClientSession(read_stream, write_stream) as session:
await session.initialize()

tools = await session.list_tools()
print("Available tools:", [t.name for t in tools.tools])

res = await session.call_tool(name="get_authorized_teams")
print("get_authorized_teams →", res.model_dump())

if __name__ == "__main__":
asyncio.run(main())

HTTP streaming client

import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def main():
url = "http://localhost:8000/mcp/mcp"
async with streamablehttp_client(url) as (read_stream, write_stream, _close_fn):
async with ClientSession(read_stream, write_stream) as session:
await session.initialize()

tools = await session.list_tools()
print("Available tools:", [t.name for t in tools.tools])

res = await session.call_tool(name="get_authorized_teams")
print("get_authorized_teams →", res.model_dump())

if __name__ == "__main__":
asyncio.run(main())

Server running demonstration with scenarios

  • Run SSE transport (default)

    clickup-mcp-server --transport sse
  • Run streaming HTTP transport

    clickup-mcp-server --transport http-streaming
  • Use .env for token

    # .env contains CLICKUP_API_TOKEN=xxx
    clickup-mcp-server
  • Override token via CLI

    clickup-mcp-server --token YOUR_TOKEN

Quick checks server state

  • Health check

    curl http://localhost:8000/health

Webhook consumer CLI (clickup-webhook-consumer)

The webhook consumer listens to the internal message queue topic and dispatches events to your registered handler functions.

Synopsis

clickup-webhook-consumer [--queue-backend <name>]

Options

OptionRequiredTypeDefaultAllowed valuesUsage exampleDescription
--queue-backendOptionalstringFrom QUEUE_BACKEND or localdepends on setup (e.g., local)--queue-backend localQueue backend to use for consuming events. Reads from the QUEUE_BACKEND env var if not provided; falls back to local.

Environment variables

  • QUEUE_BACKEND: Selects the backend implementation (e.g., local). If not provided, the CLI defaults to local.
  • CLICKUP_WEBHOOK_HANDLER_MODULES: Comma-separated module paths that will be imported before consuming so your handlers are registered.

Examples

  • Run with default local backend

    clickup-webhook-consumer
  • Run with a specific backend name

    clickup-webhook-consumer --queue-backend local
  • Configure via environment variable

    export QUEUE_BACKEND=local
    clickup-webhook-consumer