Skip to main content
Version: 0.0.1

CLI Execution Methods

Both the MCP server and webhook server can be executed using multiple methods depending on your development workflow and deployment preferences. This guide covers all available execution methods with their respective use cases and examples.

Available Execution Methods

Overview

The Slack MCP servers support four primary execution methods:

  1. Console Script - Recommended for most users and production deployments
  2. Python Module - Direct execution using Python's module system
  3. Poetry - Development workflow using Poetry package manager
  4. UV - Modern Python package management with uv

Execution Method Details

The console script method is the most straightforward and recommended approach for most users.

# Install and run MCP server
pip install slack-mcp-server
slack-mcp-server [OPTIONS]

When to use:

  • ✅ Production deployments
  • ✅ Simple local development
  • ✅ CI/CD pipelines
  • ✅ Docker containers

2. Python Module

Execute servers directly using Python's module system.

# Run MCP server as Python module
python -m slack_mcp.mcp [OPTIONS]

When to use:

  • ✅ Development environments
  • ✅ Custom Python environments
  • ✅ Script automation
  • ✅ Debugging with specific Python versions

3. Poetry

Development workflow using Poetry for dependency management.

# Setup and run MCP server with Poetry
poetry install
poetry run slack-mcp-server [OPTIONS]

# Alternative: Run as module
poetry run python -m slack_mcp.mcp [OPTIONS]

When to use:

  • ✅ Local development
  • ✅ Contributing to the project
  • ✅ Isolated development environments
  • ✅ Team development with locked dependencies

4. UV (Modern Package Manager)

Modern Python package management using UV for fast, reliable dependency resolution.

# Setup and run MCP server with UV
uv sync
uv run slack-mcp-server [OPTIONS]

# Alternative: Run as module
uv run python -m slack_mcp.mcp [OPTIONS]

When to use:

  • ✅ Modern development workflows
  • ✅ Fast dependency resolution
  • ✅ CI/CD with performance requirements
  • ✅ Large-scale deployments

Installation Methods

Standard Installation (pip)

# Install from PyPI
pip install slack-mcp-server

# Install development version
pip install -e .

# Install with specific extras
pip install slack-mcp-server[redis,kafka]

Poetry Installation

# Add to existing Poetry project
poetry add slack-mcp-server

# Development installation
poetry install

# Install with extras
poetry add slack-mcp-server[redis,kafka]

UV Installation

# Add to UV project
uv add slack-mcp-server

# Development installation
uv sync

# Install with extras
uv add slack-mcp-server[redis,kafka]

Common Usage Patterns

Development Environment

# Quick development setup
pip install -e .
slack-mcp-server --log-level DEBUG
slack-webhook-server --log-level DEBUG

Production Environment

# Production deployment
pip install slack-mcp-server
slack-mcp-server --log-level INFO
slack-webhook-server --log-level INFO

Container Deployments

# Dockerfile example
FROM python:3.11-slim
RUN pip install slack-mcp-server
CMD ["slack-mcp-server", "--log-level", "INFO"]

Troubleshooting Execution Issues

Common Problems

1. Command Not Found

# Error: command not found
slack-mcp-server: command not found

# Solution: Ensure proper installation
pip install slack-mcp-server
pip show slack-mcp-server # Verify installation

2. Import Errors

# Check Python environment
python --version
pip list | grep slack-mcp

# Verify installation location
python -c "import slack_mcp; print(slack_mcp.__file__)"

3. Permission Issues

# Fix permissions for user installation
pip install --user slack-mcp-server

# Add user bin to PATH
export PATH="$HOME/.local/bin:$PATH"

Environment-Specific Issues

Virtual Environment Activation

# Activate virtual environment
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows

# Install and run
pip install slack-mcp-server
slack-mcp-server

Best Practices

Development

  • Use Poetry or UV for development to ensure reproducible environments
  • Use --log-level DEBUG for detailed debugging information
  • Set up .env files for local configuration

Production

  • Use Console Script method for simplicity and performance
  • Use --log-level INFO or WARNING to reduce log verbosity
  • Implement proper process management (systemd, supervisor, etc.)

CI/CD

  • Use UV for fastest dependency resolution
  • Use Console Script for execution in containers
  • Cache dependencies between builds

For server-specific CLI options and advanced configuration, see: