Agent skill
slack-mcp-server
Create MCP servers that interact with Slack APIs. Use when building agent tools for Slack canvases, posting messages, or other Slack operations via Model Context Protocol.
Install this agent skill to your Project
npx add-skill https://github.com/rbarazi/agent-skills/tree/main/skills/slack-mcp-server
SKILL.md
Slack MCP Server Tools
Build MCP servers that enable AI agents to interact with Slack APIs.
Problem Statement
AI agents need to perform actions in Slack beyond just sending messages - creating canvases, managing channels, posting rich content. MCP servers provide a standardized way to expose these capabilities as tools.
When to Use
- Building agent tools that create/update Slack canvases
- Exposing Slack API operations as MCP tools
- Returning rich resources (Block Kit, Work Objects) from tool calls
- Keywords: mcp server, slack tools, slack canvas, agent tools, model context protocol
Quick Start
module SlackCanvasMCPServer
class Server < BaseMCPServer
server_name "slack_canvas"
server_version "1.0.0"
tool :create_canvas
tool :update_canvas
def create_canvas(title:, content:, channel_id: nil)
client = Slack::Web::Client.new(token: config[:slack_token])
response = client.canvases_create(
title: title,
document_content: JSON.generate({ type: "markdown", markdown: content })
)
build_success_result(
text: "Created canvas '#{title}'",
canvas_id: response["canvas_id"]
)
end
end
end
Architecture
Agent → Task → LLM → Tool Call → MCP Server → Slack API
↓
Tool Result with Resources
Key Patterns
Tool registration: Use tool :method_name DSL
Config injection: Credentials via config[:slack_token], config[:team_id]
Multi-channel results: Return ui:// + slack:// resources for different clients
Testing Strategy
RSpec.describe SlackCanvasMCPServer::Server do
let(:server) { described_class.new(config: { slack_token: "xoxb-test" }) }
it "creates canvas with valid content" do
stub_slack_api(:canvases_create).to_return(canvas_id: "C123")
result = server.create_canvas(title: "Test", content: "# Hello")
expect(result[:canvas_id]).to eq("C123")
end
end
Common Pitfalls
- Token scopes: Ensure bot token has required scopes (canvases:write, etc.)
- Rate limits: Handle Slack API rate limiting gracefully
- Content format: Canvas content must be valid markdown or document JSON
Reference Files
- base-server.md - BaseMCPServer DSL and constants
- canvas-api.md - Canvas create/update/sections operations
- templates.md - YAML template system for resources
- multi-channel.md - Returning resources for multiple channels
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
test-auth-helpers
Implement authentication testing patterns with RSpec, FactoryBot, and test helpers for Rails applications. Use when writing controller specs, system tests, or request specs that require authenticated users and multi-tenant account context.
multi-tenant-accounts
Implement multi-tenant architecture using an Account model as the tenant boundary. Use when building SaaS applications, team-based apps, or any system where data must be isolated between organizations/accounts.
user-management
Implement user CRUD operations within an account with permission controls and feature flags. Use when building team member management, user administration, or account user settings in multi-tenant Rails applications.
oauth21-provider
Implement an RFC-compliant OAuth 2.1 authorization server in Rails applications. Use when building apps that need to authorize third-party clients (like MCP clients, API consumers, or external integrations) using industry-standard OAuth flows with PKCE, dynamic client registration, and token management.
password-reset-flow
Implement secure password reset with Rails 8's built-in token generation. Use when building "forgot password" functionality with email verification and time-limited reset tokens.
code-pattern-extraction
Extract reusable design and implementation patterns from codebases into Skills. Use when asked to analyze code for patterns, document architectural decisions, create transferrable implementation guides, or extract knowledge into Skills. Transforms working implementations into comprehensive, reusable Skills that can be applied to new projects.
Didn't find tool you were looking for?