Skip to main content
Version: 0.0.2

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.

Installation Extras
  • [mcp]: installs the MCP server feature set.
  • [webhook]: installs the webhook server feature set.
  • [all]: installs everything.

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[mcp]"
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 add slack-mcp -E mcp
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 add "slack-mcp[mcp]"
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[mcp]" # MCP server
pip install "slack-mcp[webhook]" # Webhook server
pip install "slack-mcp[all]" # Everything

# Install development version
pip install -e .

Poetry Installation

# Add to existing Poetry project
poetry add slack-mcp -E mcp # MCP server
poetry add slack-mcp -E webhook # Webhook server
poetry add slack-mcp -E all # Everything

# Development installation
poetry install

UV Installation

# Add to UV project
uv add "slack-mcp[mcp]" # MCP server
uv add "slack-mcp[webhook]" # Webhook server
uv add "slack-mcp[all]" # Everything

# Development installation
uv sync

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[mcp]"
pip install "slack-mcp[webhook]"
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[mcp]"
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: