I’m trying to run a scheduled Slack check using the Cursor Agent CLI (headless) so that when I’m away, the agent periodically reads my Slack DMs and runs any task requests in my project.
Setup
I have the Slack MCP configured and working in Cursor (Settings → MCP). In the IDE, the agent can use slack_read_channel, slack_send_message, etc.
I run the standalone Cursor Agent CLI (Windows: agent.cmd from %LOCALAPPDATA%\cursor-agent) in a loop script every 15 minutes with:
The prompt tells the agent to read my Slack task inbox (channel ID), run any tasks, and post status back to Slack, following a project rule in .cursor/rules/.
What happens
When the CLI runs, the agent replies that it does not have access to the Slack MCP tools (slack_read_channel, slack_send_message). It says they’re not in its available tools and that list_mcp_resources shows no MCP resources. The same workflow works when I run it inside the IDE (e.g. “Check my Slack” in Composer).
What I’d like clarity on
Is the headless CLI supposed to use the same MCP servers as the IDE?
If yes: is there a specific way to run the CLI (e.g. from the project directory, or with a flag like --approve-mcps) so it picks up the Slack MCP (and other MCPs) I’ve configured in Cursor?
If the CLI uses a separate MCP config:
Where is that config (e.g. user-level vs workspace) and how do I add/authenticate the Slack MCP for the CLI so that agent -p … can call Slack tools?
If MCP is IDE-only for now:
Is headless + MCP (e.g. Slack) on the roadmap, and is there a recommended workaround for “run agent on a schedule with Slack access” (e.g. only via the IDE, or another approach)?
The headless CLI docs don’t mention MCP or loading IDE/workspace config, so I’m not sure what the intended behavior is for CLI + MCP.
Check whether the CLI can see your MCP servers at all. Run this from your project directory:
agent mcp list
If the Slack MCP doesn’t show up, the issue is that the CLI can’t find the config.
Env variables: the CLI doesn’t automatically inherit your shell environment. It only uses what you put in the env block in mcp.json. If the Slack MCP uses tokens via env vars (like SLACK_BOT_TOKEN, etc.), make sure they’re set explicitly in the config:
So I’m on Slack’s hosted MCP (https://mcp.slack.com/mcp) with only CLIENT_ID in auth — no env block or SLACK_BOT_TOKEN. My guess is the IDE has OAuth tokens stored elsewhere and the CLI doesn’t, so the CLI can’t connect. Can you confirm whether the CLI is supposed to use the same stored Slack tokens as the IDE, and if so, what I need to do so the CLI can connect (or if there’s a different supported way to run the agent headless with Slack MCP)?
Hey, the fact that agent mcp list shows the server but with a connection error is the key point. It’s almost certainly an OAuth issue. When the IDE connects, it opens a browser for auth and saves tokens, but the CLI doesn’t automatically complete that flow.
Try logging in explicitly via the CLI:
agent mcp login slack
This should start the OAuth flow and save tokens for the CLI. After that, check agent mcp list again. The status should change.
If agent mcp login doesn’t work (possible, OAuth for remote MCP in the CLI is still a bit unstable), there’s a workaround. Instead of the hosted Slack MCP mcp.slack.com/mcp, use a stdio-based Slack MCP server with a Bot Token directly, for example @modelcontextprotocol/server-slack or similar:
Yes, that’s exactly the issue. Slack’s hosted MCP (mcp.slack.com) doesn’t support dynamic client registration, which the CLI uses for OAuth. Right now, the OAuth flow for remote MCP servers in the CLI is unreliable, so agent mcp login won’t help here.
I’d recommend trying the workaround from my previous reply. Switch to the stdio-based Slack MCP using a Bot Token:
To do this, you’ll need to create a Slack App with a Bot Token (xoxb-…) at Slack API: Applications | Slack and grant the needed scopes (like channels:read, chat:write, etc, depending on what you need). Stdio servers work fine in the CLI, so no OAuth is required.
The team is aware of the OAuth flow issue in the CLI.
Let me know if you’ve got any questions about setting up the stdio option.