Slack

by miyatsuki

Not rated
GitHub

About

Interact with Slack workspaces using the Slack API.

Details

Author
miyatsuki
Categories
Communication, Other, API

Setup

Install Slack in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/miyatsuki/study-slack-remote-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server that enables LLMs to interact with Slack workspaces through OAuth 2.0 authentication.

- πŸ”OAuth 2.0 Authentication: Secure Slack OAuth flow with automatic token management
- πŸš€FastMCP Framework: Built with the official MCP SDK's FastMCP framework
- πŸ’ΎToken Persistence: Tokens are saved locally or in DynamoDB for cloud deployments
- πŸ“±Slack Integration: Post messages and list channels in Slack workspaces
- πŸ”„Dynamic Client Registration: Supports VSCode MCP extension and other clients
- ☁️GitHub + App Runner: Deploy directly from GitHub with AWS App Runner

- Python 3.11+
- Slack App with OAuth 2.0 configured
- uv (Python package manager)
- Create a new Slack App athttps://api.slack.com/apps
- Add OAuth Scopes in "OAuth & Permissions":

- chat:write- Post messages
- channels:read- List channels

- Local:http://localhost:8080/slack/callback
- Production:https://your-domain.com/slack/callback

# Clone the repository git clone https://github.com/miyatsuki/study-slack-remote-mcp.git cd study-slack-remote-mcp # Install dependencies using uv uv sync
# Required: Slack OAuth credentials SLACK_CLIENT_ID=your_client_id SLACK_CLIENT_SECRET=your_client_secret # Optional: Service base URL (for production deployments) # SERVICE_BASE_URL=https://your-apprunner-url.awsapprunner.com
# Start the server uv run python server.py # Or run in background nohup uv run python server.py > server.log 2>&1 &

- Install the MCP extension for VSCode
- Connect to the server URL:http://localhost:8080/mcp/
- The OAuth flow will start automatically when you first use a tool

Add to your Claude Desktop configuration:

macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json

{ "mcpServers": { "slack": { "command": "uv", "args": [ "--directory", "/path/to/slack-mcp-server", "run", "python", "server.py" ] } } }

-

list_channels: Get a list of Slack channels

Returns: Dictionary mapping channel names to IDs

post_message: Post a message to a Slack channel

Args: - channel_id: Channel ID (required) - text: Message text (required) Returns: Success/failure message

get_auth_status: Check authentication status

Returns: Current authentication state and session info

- When a tool is first used, the OAuth flow automatically starts
- A browser window opens for Slack authorization
- After authorization, the token is saved for future use
- Subsequent requests use the cached token

The server uses FastMCP's built-in OAuth 2.0 support with dynamic client registration. This allows compatibility with various MCP clients including VSCode's MCP extension.

- OAuth tokens are mapped between MCP tokens and Slack tokens internally
- Tokens are persisted locally in memory (or DynamoDB in cloud)
- OAuth flow starts automatically when tools are first used
- Dynamic client registration supported for VSCode and other clients

- 8080: MCP server endpoint (includes health check and OAuth callback routes)

The project uses ECR-based deployment with AWS App Runner for production:

# First, set up AWS Systems Manager parameters: aws ssm put-parameter --name "/slack-mcp/dev/client-id" --value "your-client-id" --type "String" aws ssm put-parameter --name "/slack-mcp/dev/client-secret" --value "your-secret" --type "SecureString" aws ssm put-parameter --name "/slack-mcp/dev/service-base-url" --value "https://your-apprunner-url.awsapprunner.com" --type "String" # Build and push Docker image to ECR: ./build-and-push.sh # Create App Runner service (if not exists) or update existing service aws apprunner update-service --service-arn <your-service-arn> --source-configuration '...'

- Deployment from ECR with pre-built Docker images
- Built-in HTTPS with automatic certificates
- Manual deployment control (auto-deploy disabled by default)
- Auto-scaling and simplified management
- Avoids Python 3.11 build issues with App Runner's source code deployment

study-slack-remote-mcp/ β”œβ”€β”€ server.py # Main MCP server using FastMCP framework β”œβ”€β”€ slack_oauth_provider.py # Slack OAuth provider implementation β”œβ”€β”€ storage_interface.py # Storage abstraction (local/cloud) β”œβ”€β”€ storage_dynamodb.py # DynamoDB storage for AWS β”œβ”€β”€ token_storage.py # Local file-based token storage β”œβ”€β”€ Dockerfile # Docker container configuration β”œβ”€β”€ build-and-push.sh # ECR deployment script β”œβ”€β”€ requirements.txt # Python dependencies for Docker β”œβ”€β”€ pyproject.toml # Project dependencies β”œβ”€β”€ uv.lock # Locked dependencies β”œβ”€β”€ tests/ # Unit tests β”œβ”€β”€ infrastructure/ # AWS CDK deployment code β”œβ”€β”€ CLAUDE.md # Development guidelines └── .env # Environment variables (create from .env.example)
# Check server health curl http://localhost:8080/health # Test with MCP client mcp run uv --directory /path/to/study-slack-remote-mcp run python server.py

Enable debug logging by checkingserver.log:

# Check what's using port 8080 lsof -i :8080 # Kill process using port 8080 if needed kill -9 $(lsof -ti:8080)

-

bad_redirect_uri: Ensure the redirect URL in Slack app matches exactly:

- Must include the full path:http://localhost:8080/slack/callback
- Port must be 8080 (MCP server port)

invalid_client_id: Verify SLACK_CLIENT_ID in .env

Token not found: Complete OAuth by authorizing in browser

- OAuth tokens are mapped between MCP tokens and Slack tokens
- Tokens stored in memory locally, DynamoDB in production
- Dynamic client registration supports various MCP clients
- OAuth callbacks use HTTPS in production (App Runner)
- Fork the repository
- Create a feature branch
- Follow the guidelines in CLAUDE.md
- Submit a pull request

MIT License - see LICENSE file for details

- MCP Documentation
-
MCP Python SDK
-
Slack API Documentation

Enables seamless integration with communication platform that allows you to reach your customers globally across any channel.

Interact with any other SaaS applications on behalf of your customers.

Official MCP Server to interact with Pearl API. Connect your AI Agents with 12,000+ certified experts instantly.

Platfone - Receive SMS & Virtual Numbers MCP

Virtual phone number platform for AI agents β€” rent numbers across 200+ countries, receive SMS, and manage the full activation lifecycle

Send emails directly from your editor using the Resend API.

Sendmux is an email inbox API and email API for AI agents.

Sinch Engage (Sinch MessageMedia in AU) MCP server, which provides Sinch Engage APIs as MCP tools.

Wavix is a global communications platform offering APIs for voice, SMS, 2FA, and phone numbers. Our MCP server brings these capabilities to AI agents and agentic workflows.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.