Get the FREE Ultimate OpenClaw Setup Guide →

slackbot -host

MCP Host as a Slack Bot

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio miyamo2-slackbot-mcp-host mcp-server-fetch

How to use

This MCP host runs as a Slack bot and acts as a coordinator for multiple MCP servers. It can bundle certain MCP servers at compile time (Go, UV, Bun) and expose their functionality through Slack interactions. The Slack bot can receive commands or mentions, route requests to the configured MCP servers (hotpepper-gourmet-mcp-server, mcp-server-fetch, and mcp-server-brave-search in the example), and return the responses back to Slack. To use it, configure the MCP servers you want to connect to, provide any required API keys via environment variables, and deploy the host along with a matching Slack app integration so that the bot can read mentions and post messages. The setup also involves Google Cloud Platform (GCP) credentials for hosting/serving infrastructure and a Terraform workflow to provision resources.

How to install

Prerequisites:

  • Terraform installed and configured
  • Access to a Google Cloud Platform project (GCP) with billing enabled
  • Slack workspace and a Slack app with the required scopes (app_mentions:read, chat:write, users:read)
  • Optional: language runtimes if bundling (Go, UV, Bun) available in your environment

Step-by-step:

  1. Prepare Terraform variables file tfvars.json with your MCP servers and required config. Example structure (adjust keys to your needs): { "mcpServers": { "hotpepper-gourmet-mcp-server": { "command": "hotpepper-gourmet-mcp-server", "env": { "HOTPEPPER_GOURMET_API_KEY": "<HOTPEPPER Gourmet API Key>" } }, "fetch": { "command": "mcp-server-fetch" }, "server-brave-search": { "command": "mcp-server-brave-search", "env": { "BRAVE_API_KEY": "<BraveApiKey>" } } }, "bundle": { "go": {"packages": ["github.com/miyamo2/hotpepper-gourmet-mcp-server@latest"]}, "uv": {"packages": ["mcp-server-fetch"]}, "bun": {"packages": ["@modelcontextprotocol/server-brave-search@latest"]} }, "llmProviderName": "anthropic", "llmApiKey": "<LLMApiKey>", "llmModelName": "<LLMModelName>", "slackBotToken": "<SlackBotToken>", "slackSigninSecret": "<SlackSigninSecret>", "allowedUsers": ["<UserID1>"], "gcpProjectId": "<GCPProjectId>", "gcpProjectNumber": "<GCPProjectNumber>", "gcpRegion": "<GCPRegion>" }

  2. Initialize Terraform and provision resources:

  • cd .deploy
  • terraform init
  • terraform plan -var-file tfvars.json
  • terraform apply -var-file tfvars.json
  1. Create and configure Slack App:
  • In the Slack app, set the bot token and signing secret to the values you used in tfvars.json.
  • Ensure scopes include app_mentions:read, chat:write, users:read.
  • Add the Slack app to your workspace and note the Bot User OAuth access token.
  1. Populate environment variables for runtime and deploy the MCP host according to the generated infrastructure outputs. Start the host service and verify it connects to Slack and the configured MCP servers.

Additional notes

Tips and common notes:

  • Ensure all required API keys and tokens are kept secret and set through environment variables or a secure secret manager.
  • If a bundle target (Go, UV, Bun) is not needed, you can omit it to simplify deployment.
  • The mcpServers mapping should reflect the actual MCP services you want the host to manage; you can add or remove entries as needed.
  • For Slack access, verify that the bot has the necessary scopes and that the app is installed in the correct workspace.
  • When troubleshooting, check Terraform state and provider credentials, Slack token validity, and network access to external MCP services.

Related MCP Servers

Sponsor this space

Reach thousands of developers