# Cursor-agent \`-p\` mode does not inject MCP server tools into agent context

**URL:** <https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275>\
**Category:** Bug Reports\
**Tags:** mcp, cli\
**Created:** [March 19, 2026, 1:57pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275 "2026-03-19T13:57:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Easy](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Easy](https://forum.cursor.com/u/Easy)\
**Post date:** [March 19, 2026, 1:57pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/1 "2026-03-19T13:57:25Z")

</div>

### Where does the bug appear (feature/product)?

Cursor CLI

### Describe the Bug

When running `cursor-agent -p` (headless agent mode), server-specific MCP tools (e.g. `my_search_records`, `my_create_item`) are never injected into the agent’s callable tool set — even though the MCP server is fully connected, authenticated, and `cursor-agent mcp list-tools` lists all tools correctly.

The agent reports these tools as unavailable and falls back to generic proxy tools only (`mcp_task`, `list_mcp_resources`, `fetch_mcp_resource`).

### Steps to Reproduce

1. Configure MCP server in `~/.cursor/mcp.json` using stdio/supergateway bridge:

```json
{
  "mcpServers": {
    "my-mcp-server": {
      "command": "npx",
      "args": ["-y", "supergateway", "--sse", "http://localhost:PORT/sse"]
    }
  }
}

```

1. Verify MCP is connected and tools are listed:

```auto
cursor-agent mcp list
# Output: my-mcp-server: ready

cursor-agent mcp list-tools my-mcp-server
# Output: many tools listed (my_search_records, my_create_item, my_execute_action, etc.)

```

1. Run agent in `-p` mode asking for custom tools:

```auto
cursor-agent -p --force --trust \
  --workspace /path/to/project \
  --model composer-1.5 \
  "List all tools available to you whose names start with 'my_'. Output them as a newline-separated list. If no my_ tools are available, say NONE."

```

1. Agent responds: `NONE`

2. Ask agent to list ALL available tools — only generic tools present:

```auto
codebase_search, run_terminal_cmd, grep, delete_file, web_search,
mcp_task, list_mcp_resources, fetch_mcp_resource

```

No custom tools appear despite many being listed by `cursor-agent mcp list-tools`.

### Expected Behavior

Server-specific MCP tools listed by `cursor-agent mcp list-tools` should be injected into the agent’s callable tool set in `-p` mode — consistent with how Cursor IDE (non-headless Composer) behaves.

In Cursor IDE Composer, the identical MCP configuration correctly exposes all custom server tools as first-class callable tools. The `-p` CLI agent should behave the same way.

### Operating System

MacOS

### Version Information

CLI Version: 2026.03.18-f6873f7  
OS: darwin (arm64)  
Node.js: v25.7.0

### For AI issues: which model did you use?

composer-1.5

### Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [March 19, 2026, 2:16pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/3 "2026-03-19T14:16:39Z")

</div>

Hey, great bug report, thanks for the detailed steps.

The first thing that stands out is that your command is missing the `--approve-mcps` flag. Without it, the CLI might not inject MCP tools into the agent context, even if the server is connected and `mcp list-tools` shows everything correctly. Try this:

```bash
cursor-agent -p --force --trust --approve-mcps \
    --workspace /path/to/project \
    --model composer-1.5 \
    "List all tools available to you whose names start with 'odoo_'. Output them as a newline-separated list. If no odoo_ tools are available, say NONE."

```

Second point, 592 tools is a lot. If `--approve-mcps` doesn’t help, it’s worth checking if it’s related to the tool count. For a quick test, connect an MCP server with a small number of tools and see if they show up in the agent context.

Let me know how it goes with `--approve-mcps`.

---

<div class="post-metadata">

**Author:** ![Easy](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Easy](https://forum.cursor.com/u/Easy)\
**Post date:** [March 19, 2026, 4:02pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/5 "2026-03-19T16:02:14Z")

</div>

Hi Dean, thanks for the quick response.

Tested with `--approve-mcps` — unfortunately it doesn’t fix the issue. Running `cursor-agent mcp enable my-mcp-server` beforehand confirmed the server was already enabled and approved, so the flag had no effect. The agent still reports only the generic proxy tools (`mcp_task`, `list_mcp_resources`, `fetch_mcp_resource`) and none of the server-specific tools.

On the tool count point: the server has many tools, so I can’t rule that out as a contributing factor. I’ll test with a minimal server (a handful of tools) and report back.

For now it looks like a deeper injection gap rather than an approval issue — but happy to keep investigating if you have other suggestions.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [March 19, 2026, 6:01pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/6 "2026-03-19T18:01:38Z")

</div>

Thanks for testing that. It confirms this isn’t an approval issue.

This looks like a real bug in how `-p` mode handles MCP tool injection. The tools load and show up in the list, but the headless flow doesn’t correctly pass them into the agent’s context. That’s why you only see the generic proxy tools `mcp_task`, `list_mcp_resources`, `fetch_mcp_resource`, and not the individual server tools. The IDE path doesn’t have this gap, which explains the different behavior you’re seeing.

I’ve flagged this with the team.

In the meantime, testing with a small MCP server would still help. If individual tools show up with 5 to 10 tools but not with 592, that points to a different code path like serialization or a size limit. If they still don’t show up at all, then it’s likely the injection gap. Either way, it’s useful data for the fix.

I’ll update this thread if there’s news. Let me know how the small server test goes.

---

<div class="post-metadata">

**Author:** ![Easy](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Easy](https://forum.cursor.com/u/Easy)\
**Post date:** [March 22, 2026, 2:14pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/9 "2026-03-22T14:14:03Z")

</div>

Hi Dean, we’ve tested with a very light test MCP server exposing only 7 tools and the problem is the same. I look forward to hearing updates from your side.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [March 22, 2026, 6:41pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/10 "2026-03-22T18:41:02Z")

</div>

Thanks for running the test. This confirms the issue isn’t related to the number of tools, it’s specifically the injection gap in headless mode. Good data.

I’ll update the thread when I have news.

---

<div class="post-metadata">

**Author:** ![Erik2](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@Erik2](https://forum.cursor.com/u/Erik2)\
**Post date:** [March 26, 2026, 7:58am UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/11 "2026-03-26T07:58:55Z")

</div>

Possibly related:

I have a local api and an mcp I (or well.. cursor) built configured for this, if I start the agent manually from the command line with `--trust --approve-mcps -p "whatever"`It can use the MCP just fine.

If I instead, from a dotnet worker application start an agent process with the same arguments using cmd.exe through System.Diagnostics.Process, it will fail reporting that “User rejected” or similar for the MCP. I verified the cmd process is running under my user.  
After adding `-–force`the agent started by the dotnet worker works fine and can use the MCP server. Seems the `-–approve-mcps`flag is not working properly, or at least the description is somewhat misleading.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [March 26, 2026, 8:17am UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/12 "2026-03-26T08:17:55Z")

</div>

Hey, thanks for the extra context.

This does look related, but it’s different from the main bug in this thread. It seems like `--approve-mcps` depends on whether the process has a TTY or an interactive context. When you run the agent via `System.Diagnostics.Process`, stdin is probably not attached to a terminal, so the flag doesn’t work as expected, which leads to “User rejected”.

In this case, `--force` is the right option for programmatic runs because it skips all interactive checks. But I agree the `--approve-mcps` behavior here is not obvious. It should auto-approve MCP servers regardless of how it’s launched.

I’ve logged this. If you can, please share the exact “User rejected” error text and the CLI version. That’ll help with the investigation.

---

<div class="post-metadata">

**Author:** ![Erik2](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@Erik2](https://forum.cursor.com/u/Erik2)\
**Post date:** [March 26, 2026, 8:36am UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/13 "2026-03-26T08:36:27Z")

</div>

Yeah, keep in mind this is the output from the agent (the report it mentions adds nothing more, its just repeating this in more words):

```auto
Manager Instruction Status: Cannot mark as FAILED via MCP (tool call also rejected)

Attempted MCP Call:

Tool: test-update_manager_instruction_status
Board ID: b17b3c8f-1663-44be-95f1-1849e82830eb
Instruction ID: 20dc2bad-9f70-40e6-a9fb-c28241a47224
Intended Status: Failed
Intended Reason: "MCP server not accessible - see MCP_INTEGRATION_ERROR_REPORT.md"
Result: Tool rejected: User rejected MCP: test-update_manager_instruction_status
Host Process Handling: The ManagerWorker host process should detect the failure via CLI exit code and mark the instruction accordingly.

Action Required: Human intervention needed to start the test stack and/or approve MCP server in Cursor before manager operations can proceed.

```

Edit: For clarification - If I add `--force`or `--yolo`to the command params, the MCP interaction works fine.

---

<div class="post-metadata">

**Author:** ![Easy](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Easy](https://forum.cursor.com/u/Easy)\
**Post date:** [March 28, 2026, 11:09am UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/14 "2026-03-28T11:09:28Z")

</div>

> [@Erik2](#):
>
> `--force`or `--yolo`

Tested with –force and –yolo and both flags work allow the cursor-agent to work with the MCP. Thanks a lot for your assistance.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [April 19, 2026, 11:10am UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/15 "2026-04-19T11:10:22Z")

</div>

Closed on April 19, 2026, 11:10am UTC

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [June 3, 2026, 9:31pm UTC](https://forum.cursor.com/t/cursor-agent-p-mode-does-not-inject-mcp-server-tools-into-agent-context/155275/17 "2026-06-03T21:31:01Z")

</div>

Hey all!

We’ve made some fixes here in the latest versions of the Cursor CLI. Please give it a try!

If you’re still facing an issue here, please raise a new bug report.
