DEV Community

shibayu36
shibayu36

Posted on

Added Streamable HTTP Support to Slack Explorer MCP

I've added Streamable HTTP support to Slack Explorer MCP, which I introduced in this article. Now you can easily connect from ChatGPT and other AI tools via Remote MCP by hosting it somewhere. Let me share how to use it.

Here's how to launch it:

# Launch in Streamable HTTP mode (default port: 8080)
docker run -i --rm --pull always \
  -e TRANSPORT=http \
  -p 8080:8080 \
  ghcr.io/shibayu36/slack-explorer-mcp:latest

# Launch with custom port
docker run -i --rm --pull always \
  -e TRANSPORT=http \
  -e HTTP_PORT=9090 \
  -p 9090:9090 \
  ghcr.io/shibayu36/slack-explorer-mcp:latest
Enter fullscreen mode Exit fullscreen mode

When running with default settings (http://localhost:8080), you can add the MCP server to Claude Code like this. The Slack token is passed through the X-Slack-User-Token header.

claude mcp add \
  --transport http \
  --header "X-Slack-User-Token: xoxp-..." \
  -- slack-explorer-mcp http://localhost:8080/mcp
Enter fullscreen mode Exit fullscreen mode

Why I Wanted Streamable HTTP Support

I wanted to add Streamable HTTP support to make it easier for non-engineers to use.

With the previous stdio communication, people needed to set up Docker locally and run containers... While this is simple for developers, it creates a barrier for others.

With Streamable HTTP support, you can host it somewhere and connect from ChatGPT and other tools. No more local environment setup required.

Technical Background: Cache and Stateful Implementation

I'd like to share a technical challenge I faced - I had to implement this as a stateful service.

When adding Streamable HTTP support, it's easier to implement it stateless. That way you can easily deploy to serverless platforms like Lambda. However, Slack Explorer MCP caches Slack's user list, so I couldn't make it stateless.

Therefore, I implemented it as a stateful service with in-memory cache management per session. The cache has an expiry mechanism, and I use goroutines to periodically clean up expired entries to prevent memory leaks.

You can see how this is implemented in user_repository.go which handles cache management.

Summary

I added Streamable HTTP support to Slack Explorer MCP to make it more accessible for non-engineers. While the cache implementation was challenging, I'm happy with the result.

Top comments (0)