---
url: 'http://workflows-of-ai.com/blog/slack-mcp'
title: 'Slack + MCP'
author:
  name: 'Marcus Johansson'
  url: 'http://workflows-of-ai.com/about/marcus-johansson'
date: '2025-06-10T15:53:19+02:00'
updated: '2026-10-10T12:14:04+02:00'
type: article
summary: 'Chat with your Drupal content from Slack: an ECA webhook triggers an AI agent that answers through the Slack MCP server, without writing code.'
tags:
  - 'Marcus Johansson'
  - Workflows
  - Agents
  - 'Drupal AI'
image: 'http://workflows-of-ai.com/sites/default/files/previews/9b76c0e66647681c.jpg'
published: true
og:
  site_name: 'Workflows of AI'
  'image:width': '1280'
  'image:height': '720'
  'image:alt': 'Slack + MCP'
---
Agents

# Slack + MCP

Ask a Drupal agent about your content from Slack and get the answer back in the channel, built with ECA and MCP and no code.

  Marcus Johansson

June 10, 2025 · 1 min read

 ## About this video

We have shown before how you can use the new Agents to chat with your content using RAG inside Drupal, without writing a single line of code.

Let's take it one step further and add ECA, MCP Client and Slack to the mix. How about having Slack be the trigger and the output of your agent, so you can easily ask a Slack user for information from your website.

It's doable, without writing code, in under 30 minutes.

AI Module: <https://www.drupal.org/project/ai>
AI Agents Module: [https://www.drupal.org/project/ai\_agents](https://www.drupal.org/project/ai_agents)
ECA Module: <https://www.drupal.org/project/eca>
MCP Client Module: [https://www.drupal.org/project/mcp\_client](https://www.drupal.org/project/mcp_client)

## Watch the video

[Watch on YouTube: Slack + MCP](https://www.youtube.com/watch?v=iCqQmeNFHOg)

### Video chapters

- 0:00 Asking Drupal from Slack
- 1:09 How the pieces fit together
- 2:06 The ECA webhook model
- 3:44 Answering Slack within three seconds
- 4:50 Adding the Slack MCP server
- 5:38 The RAG agent with Slack tools

## Transcript

YouTube's automatic captions, lightly corrected. Click a line to jump to that moment in the video.

### Transcript

- 0:00 This video is sponsored by FreelyGive. If you need help with Drupal and get in contact with us. So today I'm going to do a video about a tool that I built without writing a single line of code.
- 0:13 Um that is your typical chat with your content uh chatbot or agent. So you can see you know I have added some content but with a twist. So, what are we going to do here? We're going to go into Slack
- 0:28 and ask Slack via Drupalbot, can you find all article about men's health, mental health? There should be this article that's the only one that has something to do with mental health. And it answers
- 0:39 back with an actual link to my website. So, how does this work? So, this time I will not actually show you how to set it up. I will show you how it is set up. Um, it took me pretty
- 0:54 long time to figure out some stuff in ECA, but if you know ECA well and if you know agents API, well, you can easily set this up in 30 minutes. And the kicker is you don't need to write a
- 1:06 single line of code to get this working. So, I just made a very ugly image here of what's happening. You're you're a user. You write something Slack. Slack has something called events where you
- 1:19 can send events as web hooks. This is being sent into a custom ECA web hook I have set up and this is then triggering the agent with whatever message this person has sent here as long as it's to
- 1:33 the Drupal bot. Uh one of the tools that the agent has. So it has the you know possibility to look at the content but it also has the possibility to via the MCP client run the Slack MCP server. So
- 1:47 we have installed the Slack MCP server on the same well in this case my local machine uh that makes it possible to get all the tools that available there and one of the tools is to post an answer.
- 2:00 So that is the way that the agent can actually post an answer in this case. So what you need to have well you need to have set up a event subscription to some kind of uh a web hook and that's
- 2:15 what I've set up in this ECA then it it probably looks more complex than it is but it took some time to get it right.
- 2:24 So what's happening here that we get a a web hook message uh we say that anyone can push there because Slack will never be authenticated. Of course we get the payload. I just log it just to be able
- 2:39 to uh debug it. So that step you don't necessarily need un serialize this payload. And the payload there are two basic parts of the payload that's important. So one thing is the first
- 2:54 time when you're setting it up, you have to basically say that I am the owner of this website, which means that if they say send a challenge, you have to respond with the same challenge to prove
- 3:05 that you own it. Uh so that's one way it's I'm currently putting in a cache or if there are instructions then the actual instructions uh we save those in a cache. I'm also
- 3:18 logging this and here you can see it will only do that if it has a at@ drupalbot mention. So you can see it should contain this. It's the ID of the Drupal bot. Then the web hook uh
- 3:30 respawn. So if the challenge exists, it's going to output the actual challenge. Otherwise, we just output nothing because the web hook doesn't really care about the response when it's
- 3:41 being used after you have validated it. uh and what uh took me some time to understand because I didn't read the documentation stupid as I am. I just saw the agent getting triggered over and
- 3:55 over. It turns out that you have to uh have a response within 3 seconds otherwise Slack starts retrying again.
- 4:04 And since agents can take pretty long time to run, this might be over 3 seconds. So what we do here is we're actually outputting something. We're throwing it out to the buffer. The web
- 4:14 server gets it and responds, but the PHP continues running in the background. So after the response is sent, we get the instruction cache check so it exists.
- 4:24 Then we log this for debugging again. We delete it so it doesn't run on every page load of course. And then we trigger the agent with this instructions. Then um and that is the ECA model. Then that
- 4:41 is the first part that has now triggered the agent. So what we have set up then in the agent or no before we set up that uh we have set up the MCP server because
- 4:52 the agent is going to need this. So we have set up a slack MCP server uh that is using it's this slack MCP server. So it's just sitting there listening to a port. Uh, and if you then add MCP
- 5:12 server, I'm going to edit it now. You just say the host name. In this case, it's outside of my Docker. That's why it has this funny host name. You get all the tools that's available. And those
- 5:22 are the tools that you can make available to the agents. I've only done Slack post message in this case, but you see you can get channel history. You can add a reaction or or do other stuff with
- 5:34 this MCP server. And then you can then set up the uh uh agent which is a pretty simple actually agent it basically says you know go and find something in rag if you don't find
- 5:50 anything say that um I have done videos before on how to set up rag search but what's important here then is you have to make sure you use the slack post message with the same output
- 6:03 u and then today's date is it's getting today's date. So you can ask can you get me the I don't know the latest or can you get me an article within the last week or something. The tools it has is
- 6:14 Slack post message and uh somewhere it should have rag vector search as well. That's the only two tools we have. We have set that the rag vector search can only search in articles.
- 6:27 Uh and we have set that the Slack post message can only then post in this specific channel that we had.
- 6:36 uh outside of that it is basically set up as a normal uh rag agent. So how you would set it up with the AI assistance framework. So the only difference is here now we're running a
- 6:51 Slack MCP server that can answer and we have a ECA agent that can trigger the agent. Uh and yeah, that's it. We're actually getting somewhere, especially now when we're working together with
- 7:05 Jürgen with ECA, that there is so crazy capabilities that you can do with Drupal without developing anything.
- 7:15 Thank you for watching.

  Filed under [Workflows](/blog?category=6) [Agents](/blog?category=5) [Drupal AI](/blog?category=2)

Parts of this content were produced by AI.

This site has not assessed whether a label is required for this content.

  How was AI used?The video and the introduction are Marcus's own, first published on workflows-of-ai.com. AI wrote the subtitle, the summary and the video chapters from the transcript, and corrected misheard names in YouTube's automatic captions.

   Marcus Johansson

Tinkers with AI and Drupal

 [About Marcus](/about/marcus-johansson)[Drupal.org profile](https://www.drupal.org/u/marcus_johansson)[Drupal AI](https://www.drupal.org/project/ai)

## The post in three sentences

A Slack message to the Drupal bot arrives as an event at an ECA webhook, which answers Slack's challenge, responds within three seconds and then triggers an agent. The agent searches articles with RAG and posts the answer back through the Slack MCP server, connected with the MCP Client module. No custom code is needed.