Connecting the Slack MCP server to agent harnesses
The Slack MCP server can be connected to various agent harnesses. Agent harnesses are essentially software infrastructure wrapped around a LLM. They handle orchestrating all the tools, memory, and planning required for more involved or long-running tasks and development.
Connecting the Slack MCP server to an agent harness enables you to use Slack data and actions within your AI workflows. This guide covers how to connect to popular harnesses including Codex, Claude Code, and Pi.
Prerequisites
Before setting up connection to the Slack MCP server, ensure you have:
- Access to the agent harness you want to connect to (Codex, Claude Code, Pi, etc.)
- Access to a Slack workspace with the MCP integration approved by your workspace admin
- Your Slack app's client ID (available in your app settings)
Once you're ready, jump to the section for your specific harness. We offer instructions on connecting to Codex, Claude Code, and Pi, along with some guidelines for connecting to other harnesses.
Connect to Codex
Codex uses a TOML-based configuration file for MCP servers. You can add the Slack MCP server using the Codex CLI, or by editing your configuration file directly.
Using the Codex CLI
Run the following command in your terminal:
codex mcp add --transport http slack https://mcp.slack.com/mcp
Codex will then prompt you to authenticate via OAuth.
Configuring manually
Alternatively, edit your Codex configuration file at ~/.codex/config.toml to add the following:
[mcp_servers.slack]
url = "https://mcp.slack.com/mcp"
auth = "oauth"
After saving, run codex mcp login slack to complete the OAuth flow.
Once authorized, run the following command to verify the server is connected:
codex mcp list
You should see slack listed with a status of connected.
Connect to Claude Code
You can connect the Slack MCP server to Claude Code in three ways:
Using the Slack Skills Plugin
The quickest way to connect is by using the Slack Skills plugin. Run the following command in your Claude Code session to install the plugin:
/plugin install slack@claude-plugins-official
The Slack MCP server will be automatically configured when the plugin loads. You'll be prompted to authenticate into your Slack workspace via OAuth. The plugin uses the following MCP configuration:
{
"mcpServers": {
"slack": {
"type": "http",
"url": "https://mcp.slack.com/mcp",
"oauth": {
"clientId": "1601185624273.8899143856786",
"callbackPort": 3118
}
}
}
}
If you prefer to configure without using the Slack Skills plugin, you can use the Claude Code CLI, or edit the configuration file directly.
Using the Claude Code CLI
Run the following command in your terminal:
claude mcp add --transport http --scope local slack https://mcp.slack.com/mcp
If you used the Claude Code CLI, run /mcp in a Claude Code session to complete the OAuth flow. If you edited the configuration file manually, save it and restart Claude Code, then run /mcp to complete the OAuth flow.
Configuring manually
Alternatively, you can edit the .mcp.json file in your project root (or ~/.claude.json for user-wide configuration) and add:
{
"mcpServers": {
"slack": {
"type": "http",
"url": "https://mcp.slack.com/mcp",
"oauth": {
"clientId": "YOUR_SLACK_APP_CLIENT_ID",
"callbackPort": 3118
}
}
}
}
Replace YOUR_SLACK_APP_CLIENT_ID with your Slack app's actual client ID.
Connect to Pi
Pi uses the pi-mcp-adapter extension to connect to MCP servers. Follow these steps to set up the Slack MCP server.
First, install the pi-mcp-adapter extension by running the following command in your terminal:
pi install npm:pi-mcp-adapter
After installation completes, restart Pi for the extension to load.
You can configure the Slack MCP server using the Pi CLI or by manually editing the configuration file.
Using the Pi CLI
Run the following command in Pi:
/mcp setup
This will open an interactive panel where you can:
- add a new MCP server
- import existing configurations from other tools
- preview changes before saving
Select the option to add a new server and provide the following:
- Server name:
slack - URL:
https://mcp.slack.com/mcp - Authentication: OAuth
Manually editing the configuration file
Edit the configuration file at ~/.pi/agent/mcp.json to add:
{
"mcpServers": {
"slack": {
"url": "https://mcp.slack.com/mcp",
"auth": "oauth"
}
}
}
After configuration, run /mcp in Pi to view the MCP panel. Click Connect next to the Slack server to complete the OAuth flow. You'll be redirected to Slack to authorize the connection.
Connect to other harnesses
If you're using another agent harness, the general process will go something like this:
- Access your harness's settings or integrations panel.
- Find the MCP server configuration section.
- Add a new MCP server with these details:
- URL:
https://mcp.slack.com/mcp - Client ID: Your Slack app's client ID
- Authentication: OAuth 2.0
- URL:
- Complete the OAuth flow to authorize access to your Slack workspace.
Refer to the specific harness's documentation for instructions on adding MCP servers.
Troubleshooting
OAuth flow doesn't complete
If the OAuth flow fails or doesn't redirect back to your harness:
- Ensure your Slack app is properly configured with the correct redirect URIs.
- Check that your workspace admin has approved the MCP integration.
- Verify that your Slack app is published in the Slack Marketplace or is an internal app (unlisted apps cannot use MCP).
Connection shows as inactive
If the connection appears to be configured but isn't working:
- Check that your Slack app's client ID is correct.
- Verify that your workspace admin has approved the MCP integration for your app.
Missing Slack tools in your harness
If you've connected successfully but don't see Slack tools available:
- Check that your user token has the necessary scopes for the tools you want to use.
- Verify that your workspace admin hasn't restricted MCP access.
Next steps
Learn more about developing with the Slack MCP server: