Slack MCP Client in Go

by tuannvm

Not rated
GitHub

About

A Slack bot client that bridges Slack and Model Context Protocol (MCP) servers, enabling LLMs to use MCP tools.

Details

Author
tuannvm
Categories
Communication, Other, AI

Setup

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

Repository: https://github.com/tuannvm/slack-mcp-client

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

A Slack bot client that bridges Slack and Model Context Protocol (MCP) servers, enabling LLMs to use MCP tools.

A production-ready bridge between Slack and AI models with full MCP compatibility.

This client enables AI models (OpenAI GPT-4.1, Anthropic Claude 4.5, Ollama local models) to interact with real tools and systems through Slack conversations. Built on the industry-standard Model Context Protocol (MCP), it provides secure access to filesystems, databases, Kubernetes clusters, Git repositories, and custom tools.

Compatible with MCP Specification 2025-06-18- Compliant with the latest Model Context Protocol standards

Oct 2025: langchaingo v0.1.14 with streaming fixes, enhanced agent parsing, and API key sanitization.

- Universal MCP Compatibility- Supports all transport methods (HTTP, SSE, stdio)
- Multi-Provider LLM Support- OpenAI GPT-4.1/4o, Anthropic Claude 4.5, Ollama (Llama 3.3, Qwen, Mistral, DeepSeek)
- Agent Mode- Multi-step reasoning with LangChain for complex workflows
- RAG Integration- Knowledge base with semantic search capabilities
- Thread-Aware Context- Maintains separate conversation history per Slack thread
- User Context Integration- Personalized responses with cached user information
- Unique Tool Naming- Server-prefixed tool names prevent conflicts across MCP servers
- Production Ready- Comprehensive configuration, monitoring, and security

- DevOps Teams- Infrastructure automation and monitoring through Slack
- Development Teams- Code review, Git operations, and file management
- Support Teams- Database queries, system status checks, and troubleshooting
- General Use- AI assistance with actual tools and system integration

Compliant with the official Model Context Protocol (2025-06-18 specification):

- All Transport Methods- HTTP, SSE, and stdio protocols
- JSON-RPC 2.0- Standard communication protocol
- Official MCP Servers- Compatible with allmodelcontextprotocol/servers
- Custom MCP Servers- Works with any MCP-compliant server
- Security Standards- Implements user consent, data privacy, and tool safety requirements

Authentication with Server-Sent Events (SSE) MCP servers can be achieved using the following setup:

{ "httpHeaders": { "Authorization": "Bearer YOUR_TOKEN_HERE" } }

Make sure to replaceYOUR_TOKEN_HEREwith your actual token for authentication.

flowchart LR User([πŸ‘€ User]) --> Slack{πŸ”— Slack Interface} subgraph Infrastructure[Observability] Config[πŸ“‹ Unified Config<br/>JSON Schema] Monitoring[πŸ“Š Monitoring<br/>Prometheus Metrics] Tracing[πŸ” OpenTelemetry Tracing<br/>Langfuse & OTLP] Logging[πŸ“ Structured Logging<br/>Debug & Analytics] end subgraph Core[Features] Slack --> Bridge[πŸŒ‰ LLM-MCP Bridge<br/>Orchestration Layer] subgraph LLM[πŸ€– AI Processing] Bridge --> LLMRegistry[LLM Provider Registry] LLMRegistry --> OpenAI[OpenAI<br/>GPT-4o] LLMRegistry --> Anthropic[Anthropic<br/>Claude] LLMRegistry --> Ollama[Ollama<br/>Local Models] Bridge --> Agent{🎯 Agent Mode?} Agent -->|Yes| LangChain[πŸ”„ LangChain Agent<br/>Multi-step Reasoning] Agent -->|No| Standard[⚑ Standard Mode<br/>Single Response] end subgraph Knowledge[πŸ“š Knowledge & Memory] Bridge --> RAG[🧠 RAG System] RAG --> SimpleRAG[πŸ“„ JSON Store<br/>Simple Documents] RAG --> VectorRAG[πŸ” OpenAI Vector Store<br/>Semantic Search] end subgraph Tools[πŸ› οΈ MCP Mode] Bridge --> MCPManager[MCP Client] MCPManager --> FileSystem[πŸ“ Filesystem MCP Server<br/>Read/Write Files] MCPManager --> Git[🌿 Git MCP Server <br/>Repository Tools] MCPManager --> Kubernetes[☸️ Kubernetes MCP Server<br/>Cluster Management] end end Config -.-> Core Core -.-> Monitoring Core -.-> Tracing Core -.-> Logging style Core fill:#F8F9FA,stroke:#6C757D,stroke-width:3px style LLM fill:#E3F2FD,stroke:#1976D2,stroke-width:2px style Knowledge fill:#E8F5E8,stroke:#388E3C,stroke-width:2px style Tools fill:#FFF3E0,stroke:#F57C00,stroke-width:2px style Infrastructure fill:#F3E5F5,stroke:#7B1FA2,stroke-width:2px style User fill:#4CAF50,stroke:#2E7D32,stroke-width:2px,color:#fff style Slack fill:#4A90E2,stroke:#1565C0,stroke-width:2px,color:#fff style Bridge fill:#FF9800,stroke:#E65100,stroke-width:2px,color:#fff style LangChain fill:#9C27B0,stroke:#4A148C,stroke-width:2px,color:#fff style RAG fill:#2196F3,stroke:#0D47A1,stroke-width:2px,color:#fff

- Userinteracts through Slack, sending messages that trigger intelligent AI workflows
- LLM-MCP Bridgeserves as the intelligent orchestration layer that:

- Routes requests to appropriate LLM providers (OpenAI, Anthropic, Ollama)
- Chooses between Agent Mode (multi-step reasoning) or Standard Mode (single response)
- Integrates RAG system for knowledge retrieval and context enhancement
- Manages tool discovery and execution across multiple MCP servers

- Simple JSON store for lightweight document storage
- OpenAI Vector Store for semantic search and enterprise-grade RAG

- Filesystem operations for file management
- Git integration for repository interactions
- Kubernetes cluster management and monitoring
- Custom tools via HTTP, SSE, or stdio protocols

- Unified JSON configuration with environment variable support
- Prometheus metrics for observability and monitoring
- OpenTelemetry tracing with Langfuse and OTLP providers
- Structured logging for debugging and analytics

- βœ…Multi-Mode MCP Client:

- Server-Sent Events (SSE) for real-time communication with automatic retry
- HTTP transport for JSON-RPC
- stdio for local development and testing

- Uses Socket Mode for secure, firewall-friendly communication
- Works with both channels and direct messages
- Rich message formatting with Markdown and Block Kit
- Thread-aware conversation tracking with separate context per thread
- User context caching for personalized interactions
- Customizable bot behavior and message history

- OpenAI (GPT-4.1, GPT-4o, o3-pro)
- Anthropic (Claude Sonnet 4.5, Opus 4.1)
- Ollama (Llama 3.3, Qwen2.5, Mistral, DeepSeek)
- Native tool calling and unified LangChain gateway

- Autonomous AI agents powered by LangChain (langchaingo v0.1.14)
- Enhanced multi-step reasoning and tool orchestration
- Improved parsing for complex multi-line tool calls
- Configurable agent iterations and behavior
- Reliable streaming responses with memory leak fixes
- Advanced prompt engineering capabilities

- Multiple providers: Simple JSON storage, OpenAI Vector Store
- Reusable vector stores withvectorStoreIdsupport
- Configurable search parameters and similarity metrics
- PDF ingestion with intelligent chunking
- CLI tools for document management

- Single JSON configuration file with JSON schema validation
- Comprehensive timeout and retry configuration
- Environment variable substitution and overrides
- All underlying package options exposed
- Smart defaults with full customization capability
- Server-prefixed tool names to prevent naming conflicts

- Docker container support with GHCR publishing
- Kubernetes Helm charts with OCI registry
- Comprehensive logging and error handling
- Test coverage with security scanning

- Prometheus metrics integration
- Tool invocation tracking with error rates
- LLM token usage monitoring by model and type
- OpenTelemetry tracing with Langfuse and simple providers
- Configurable observability providers with graceful fallbacks
- Comprehensive span tracking for LLM operations and tool calls
- Configurable metrics endpoint and logging levels

Download the latest binary from theGitHub releases pageor install using Go:

# Install latest version using Go go install github.com/tuannvm/slack-mcp-client@latest # Or build from source git clone https://github.com/tuannvm/slack-mcp-client.git cd slack-mcp-client make build # Binary will be in ./bin/slack-mcp-client

After installing the binary, you can run it locally with the following steps:

# Using environment variables directly export SLACK_BOT_TOKEN="xoxb-your-bot-token" export SLACK_APP_TOKEN="xapp-your-app-token" export OPENAI_API_KEY="sk-your-openai-key" export OPENAI_MODEL="gpt-4.1" # or gpt-4o, o3-pro export LOG_LEVEL="info" # Or create a .env file and source it cat > .env << EOL SLACK_BOT_TOKEN="xoxb-your-bot-token" SLACK_APP_TOKEN="xapp-your-app-token" OPENAI_API_KEY="sk-your-openai-key" OPENAI_MODEL="gpt-4o" LOG_LEVEL="info" EOL source .env
# Create config.json with the new unified configuration format cat > config.json << EOL { "\$schema": "https://github.com/tuannvm/slack-mcp-client/schema/config-schema.json", "version": "2.0", "slack": { "botToken": "\${SLACK_BOT_TOKEN}", "appToken": "\${SLACK_APP_TOKEN}" }, "llm": { "provider": "openai", "useNativeTools": true, "providers": { "openai": { "model": "gpt-4o", "apiKey": "\${OPENAI_API_KEY}", "temperature": 0.7 } } }, "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "\$HOME"] } }, "monitoring": { "enabled": true, "metricsPort": 8080, "loggingLevel": "info" }, "observability": { "enabled": true, "provider": "simple-otel", "endpoint": "${OTEL_EXPORTER_OTLP_ENDPOINT}", "serviceName": "slack-mcp-client", "serviceVersion": "1.0.0" } } EOL
# Run with unified configuration (looks for config.json in current directory) slack-mcp-client --config config.json # Enable debug mode with structured logging slack-mcp-client --config config.json --debug # Validate configuration before running slack-mcp-client --config-validate --config config.json # Configure metrics port via config file or flag slack-mcp-client --config config.json --metrics-port 9090

If you have an existingmcp-servers.jsonfile from a previous version, you can migrate to the new unified configuration format:

# Automatic migration (recommended) slack-mcp-client --migrate-config --config legacy-mcp-servers.json --output config.json # Manual migration: Use examples as templates cp examples/minimal.json config.json # Edit config.json with your specific settings # Validate the new configuration slack-mcp-client --config-validate --config config.json

- Single File: All settings in oneconfig.jsonfile
- JSON Schema: IDE support with autocomplete and validation
- Environment Variables: Use${VAR_NAME}syntax for secrets
- Smart Defaults: Minimal configuration required for basic usage
- Comprehensive Options: All underlying package settings exposed

The application will connect to Slack and start listening for messages. You can check the logs for any errors or connection issues.

The client includes an improved RAG (Retrieval-Augmented Generation) system that's compatible with LangChain Go and provides professional-grade performance:

{ "$schema": "https://github.com/tuannvm/slack-mcp-client/schema/config-schema.json", "version": "2.0", "slack": { "botToken": "${SLACK_BOT_TOKEN}", "appToken": "${SLACK_APP_TOKEN}" }, "llm": { "provider": "openai", "useNativeTools": true, "providers": { "openai": { "model": "gpt-4o", "apiKey": "${OPENAI_API_KEY}" } } }, "rag": { "enabled": true, "provider": "simple", "chunkSize": 1000, "providers": { "simple": { "databasePath": "./knowledge.json" }, "openai": { "indexName": "my-knowledge-base", "vectorStoreId": "vs_existing_store_id", "dimensions": 1536, "maxResults": 10 } } } }
# Ingest PDF files from a directory slack-mcp-client --rag-ingest ./company-docs --rag-db ./knowledge.json # Test search functionality slack-mcp-client --rag-search "vacation policy" --rag-db ./knowledge.json # Get database statistics slack-mcp-client --rag-stats --rag-db ./knowledge.json

Once configured, the LLM can automatically search your knowledge base:

User: "What's our vacation policy?"

AI: "Let me search our knowledge base for vacation policy information..."(Automatically searches RAG database)

AI: "Based on our company policy documents, you get 15 days of vacation..."

- 🎯 Smart Search: Advanced relevance scoring with word frequency, filename boosting, and phrase matching
- πŸ”— LangChain Compatible: Drop-in replacement for standard vector stores
- πŸ“ˆ Extensible: Easy to add vector embeddings and other backends

The client supports advanced prompt engineering capabilities for creating specialized AI assistants:

Create custom AI personalities and behaviors:

# Create a custom system prompt file cat > sales-assistant.txt << EOL You are SalesGPT, a helpful sales assistant specializing in B2B software sales. Your expertise includes: - Lead qualification and discovery - Solution positioning and value propositions - Objection handling and negotiation - CRM best practices and sales processes Always: - Ask qualifying questions to understand prospect needs - Provide specific, actionable sales advice - Reference industry best practices - Maintain a professional yet friendly tone When discussing pricing, always emphasize value over cost. EOL # Use the custom prompt slack-mcp-client --system-prompt ./sales-assistant.txt
{ "$schema": "https://github.com/tuannvm/slack-mcp-client/schema/config-schema.json", "version": "2.0", "slack": { "botToken": "${SLACK_BOT_TOKEN}", "appToken": "${SLACK_APP_TOKEN}" }, "llm": { "provider": "openai", "useNativeTools": true, "customPrompt": "You are a helpful DevOps assistant specializing in Kubernetes and cloud infrastructure.", "providers": { "openai": { "model": "gpt-4.1", "apiKey": "${OPENAI_API_KEY}", "temperature": 0.7 } } } }

Create specialized assistants for different use cases:

- DevOps Assistant: Kubernetes, Docker, CI/CD expertise
- Sales Assistant: Lead qualification, objection handling
- HR Assistant: Policy questions, onboarding guidance
- Support Assistant: Customer issue resolution
- Code Review Assistant: Security, performance, best practices

Agent Mode enables more interactive and context-aware conversations using LangChain's agent framework. Instead of single-prompt interactions, agents can engage in multi-step reasoning, use tools more strategically, and maintain better context throughout conversations.

Agent Mode uses LangChain's conversational agent framework to provide:
- Interactive Conversations: Maintains context across multiple exchanges
- Strategic Tool Usage: Agents decide when and how to use available tools
- Multi-Step Reasoning: Can break down complex problems into manageable steps
- Streaming Responses: Provides real-time updates during processing
- User Context Integration: Incorporates cached user information for personalized responses
- Thread Context Awareness: Maintains separate conversation history per Slack thread

Enable Agent Mode in your configuration file:

{ "$schema": "https://github.com/tuannvm/slack-mcp-client/schema/config-schema.json", "version": "2.0", "slack": { "botToken": "${SLACK_BOT_TOKEN}", "appToken": "${SLACK_APP_TOKEN}" }, "llm": { "provider": "openai", "useNativeTools": true, "useAgent": true, "customPrompt": "You are a DevOps expert specializing in Kubernetes and cloud infrastructure. Always think through problems step by step.", "maxAgentIterations": 20, "providers": { "openai": { "model": "gpt-4.1", "apiKey": "${OPENAI_API_KEY}", "temperature": 0.7 } } }, "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"] }, "github": { "command": "github-mcp-server", "args": ["stdio"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" } } } }

- llm.useAgent: Enable agent mode (default: false)
- llm.useNativeTools: Use native LangChain tools vs system prompt-based tools (default: false)
- llm.customPrompt: System prompt for agent behavior
- llm.maxAgentIterations: Maximum agent reasoning steps (default: 20)

- Single-prompt interactions
- Tools described in system prompt as JSON schemas
- Direct tool call parsing and execution
- More predictable token usage
- Simpler conversation flow

- Multi-turn conversational interactions
- Context-aware tool usage decisions
- Better user context integration
- More natural conversation flow
- Enhanced reasoning capabilities

User: "I need help optimizing my React app performance" Agent Response: πŸ€– I'd be happy to help optimize your React app performance! Let me understand your current setup better. [Agent maintains conversation context and asks relevant follow-up questions] Agent: "What specific performance issues are you experiencing? Are you seeing slow renders, large bundle sizes, or something else?" User: "The app takes too long to load initially" Agent: "Let me check your current bundle setup and suggest optimizations..." [Agent uses filesystem tools to analyze the project structure and provides targeted advice]
User: "Can you help me with my deployment pipeline?" Agent Response: πŸ€– I'll help you with your deployment pipeline. Since I know you're working on a React project, let me check your current CI/CD setup. [Agent leverages previous conversation context and user information to provide personalized assistance] [Agent strategically uses relevant tools based on the conversation flow]

- System Prompts: Design clear, specific system prompts that guide the agent's behavior
- Tool Selection: Provide relevant tools for the agent's domain
- Context Management: Agents maintain better context across conversations
- User Personalization: Leverage user context integration for personalized responses
- Tool Strategy: Choose between native tools or system prompt-based tools based on your needs

- OpenAI Agent: Native OpenAI agent in langchaingo has known issues, uses conversational agent as workaround
- LangChain Dependency: Agent mode requires LangChain provider
- Permissions: May require additional Slack permissions for user information retrieval
- Performance: Agent mode may have different performance characteristics than standard mode

For deploying to Kubernetes, a Helm chart is available in thehelm-chartdirectory. This chart provides a flexible way to deploy the slack-mcp-client with proper configuration and secret management.

Installing from GitHub Container Registry

The Helm chart is also available directly from GitHub Container Registry, allowing for easier installation without needing to clone the repository:

# Add the OCI repository to Helm (only needed once) helm registry login ghcr.io -u USERNAME -p GITHUB_TOKEN # Pull the Helm chart helm pull oci://ghcr.io/tuannvm/charts/slack-mcp-client --version 0.1.0 # Or install directly helm install my-slack-bot oci://ghcr.io/tuannvm/charts/slack-mcp-client --version 0.1.0 -f values.yaml

You can check available versions by visiting the GitHub Container Registry in your browser.

- Kubernetes 1.16+
- Helm 3.0+
- Slack Bot and App tokens

# Create a values file with your configuration cat > values.yaml << EOL secret: create: true env: SLACK_BOT_TOKEN: "xoxb-your-bot-token" SLACK_APP_TOKEN: "xapp-your-app-token" OPENAI_API_KEY: "sk-your-openai-key" OPENAI_MODEL: "gpt-4o" LOG_LEVEL: "info" # Optional: Configure MCP servers configMap: create: true EOL # Install the chart helm install my-slack-bot ./helm-chart/slack-mcp-client -f values.yaml

The Helm chart supports various configuration options including:

- Setting resource limits and requests
- Configuring MCP servers via ConfigMap
- Managing sensitive data via Kubernetes secrets
- Customizing deployment parameters

For more details, see theHelm chart README.

The Helm chart uses the Docker image from GitHub Container Registry (GHCR) by default. You can specify a particular version or use the latest tag:

# In your values.yaml image: repository: ghcr.io/tuannvm/slack-mcp-client tag: "latest" # Or use a specific version like "1.0.0" pullPolicy: IfNotPresent
# Pull the latest image docker pull ghcr.io/tuannvm/slack-mcp-client:latest # Or pull a specific version docker pull ghcr.io/tuannvm/slack-mcp-client:1.0.0

If you're using private images, you can configure image pull secrets in your values:

imagePullSecrets: - name: my-ghcr-secret

For local testing and development, you can use Docker Compose to easily run the slack-mcp-client along with additional MCP servers.
- Create a.envfile with your credentials:

# Create .env file from example cp .env.example .env # Edit the file with your credentials nano .env
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.