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:
- Console Script - Recommended for most users and production deployments
- Python Module - Direct execution using Python's module system
- Poetry - Development workflow using Poetry package manager
- UV - Modern Python package management with uv
Execution Method Details
1. Console Script (Recommended)
The console script method is the most straightforward and recommended approach for most users.
- MCP Server
- Webhook Server
# Install and run MCP server
pip install "slack-mcp[mcp]"
slack-mcp-server [OPTIONS]
# Install and run webhook server
pip install "slack-mcp[webhook]"
slack-webhook-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.
- MCP Server
- Webhook Server
# Run MCP server as Python module
python -m slack_mcp.mcp [OPTIONS]
# Run webhook server as Python module
python -m slack_mcp.webhook [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.
- MCP Server
- Webhook Server
# 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]
# Setup and run webhook server with Poetry
poetry add slack-mcp -E webhook
poetry run slack-webhook-server [OPTIONS]
# Alternative: Run as module
poetry run python -m slack_mcp.webhook [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.
- MCP Server
- Webhook Server
# 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]
# Setup and run webhook server with UV
uv add "slack-mcp[webhook]"
uv run slack-webhook-server [OPTIONS]
# Alternative: Run as module
uv run python -m slack_mcp.webhook [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
- Console Script
- Poetry
- UV
# Quick development setup
pip install -e .
slack-mcp-server --log-level DEBUG
slack-webhook-server --log-level DEBUG
# Development with Poetry
poetry install
poetry run slack-mcp-server --log-level DEBUG
poetry run slack-webhook-server --log-level DEBUG
# Development with UV
uv sync
uv run slack-mcp-server --log-level DEBUG
uv run slack-webhook-server --log-level DEBUG
Production Environment
- Console Script
- Python Module
# Production deployment
pip install "slack-mcp[mcp]"
pip install "slack-mcp[webhook]"
slack-mcp-server --log-level INFO
slack-webhook-server --log-level INFO
# Production with Python module
python -m slack_mcp.mcp --log-level INFO
python -m slack_mcp.webhook --log-level INFO
Container Deployments
- Console Script
- Python Module
- UV
# Dockerfile example
FROM python:3.11-slim
RUN pip install "slack-mcp[mcp]"
CMD ["slack-mcp-server", "--log-level", "INFO"]
# Dockerfile with Python module
FROM python:3.11-slim
RUN pip install "slack-mcp[mcp]"
CMD ["python", "-m", "slack_mcp.mcp", "--log-level", "INFO"]
# Dockerfile with UV
FROM python:3.11-slim
RUN pip install uv
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen
CMD ["uv", "run", "slack-mcp-server", "--log-level", "INFO"]
Troubleshooting Execution Issues
Common Problems
1. Command Not Found
- Console Script
- Python Module
# 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
# Error: No module named 'slack_mcp'
python -m slack_mcp.mcp
# Solution: Install package
pip install slack-mcp-server
python -c "import slack_mcp; print('OK')" # Verify
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
- venv
- Conda
# Activate virtual environment
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
# Install and run
pip install slack-mcp-server
slack-mcp-server
# Activate conda environment
conda activate your-env
# 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 DEBUGfor detailed debugging information - Set up
.envfiles for local configuration
Production
- Use Console Script method for simplicity and performance
- Use
--log-level INFOorWARNINGto 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: