cai icon indicating copy to clipboard operation
cai copied to clipboard

Unable to load MCP Servers

Open crypt0d1v3r opened this issue 7 months ago • 4 comments

I recently attempted to add the burp mcp server (via the extension), and CAI does not recognize it. I see the option in the help menu, but it does not seem to understand the /mcp command. Everything else seems to work as expected.

crypt0d1v3r avatar Jun 20 '25 14:06 crypt0d1v3r

Could you please let me know if this issue still exists in the latest code? I’ve fixed some of the problems I encountered while using the /mcp command. If the issue persists, please describe exactly how it happens — I might be able to help.

1793649019 avatar Jul 22 '25 16:07 1793649019

I have a problem that may be similar. I can load the MCP tools but the agents don't recognize them:

CAI> /mcp load http://localhost:8000/sse shyhurricane
✓ Connected to SSE server 'shyhurricane' at http://localhost:8000/sse
Available tools: 19
...
CAI> /mcp add shyhurricane redteam_agent
Adding tools from MCP server 'shyhurricane' to agent 'Red Team Agent'...
                          Adding tools to Red Team Agent
<SNIP>
Added 19 tools from server 'shyhurricane' to agent 'Red Team Agent'.
Agent now has 21 tools total

CAI> /agent select redteam_agent
Switched to agent: Red Team Agent (Parallel mode disabled)
🤖 Red Team Agent (Current Agent)
┣━━ Tools
┃   ┣━━ generic_linux_command
┃   ┣━━ execute_code
┃   ┗━━ (2 regular tools)
┗━━ Handoffs

CAI> /agent select one_tool_agent
Switched to agent: CTF agent (Parallel mode disabled)
🤖 CTF agent (Current Agent)
┣━━ Tools
┃   ┣━━ generic_linux_command
┃   ┗━━ (1 regular tools)
┗━━ Handoffs

╭─ Stream ─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [6] Agent: CTF agent >> I understand you'd like me to find CTF flags on 10.129.231.253 and have provided a list of   │
│ tools: `run_unix_command`, `deobfuscate_javascript`, `find_wordlists`, `directory_buster`,                           │
│ `fetch_web_resource_content`, `find_domains`, `find_hosts`, `find_netloc`, `find_urls`, `find_web_resources`,        │
│ `spider_website`, `save_finding`, `query_findings`, `index_http_url`, `port_scan`, `prompt_chooser`, `prompt_list`,  │
│ `register_hostname_address`, `web_search`.                                                                           │
│                                                                                                                      │
│ However, after reviewing my capabilities, I can confirm that the **only** tool available to me for interacting with  │
│ the target system is `default_api.generic_linux_command`. The other tools you listed are not present in my current   │
│ environment.                                                                                                         │
│                                                                                                                      │
│ Given this limitation, I can only proceed with finding the flags on 10.129.231.253 using `generic_linux_command`.    │
│                                                                                                                      │
│ Would you like me to proceed with finding the CTF flags using `default_api.generic_linux_command`? Current: I:1803   │
│ O:769 R:506 ($0.0025) | Total: I:5175 O:2321 R:1792 ($0.0025) | Session: $0.0074 | Context: 1.4% 🟩                  │
│ [15:00:55 (gemini/gemini-2.5-flash)] | I:1803 O:769 ($0.0025)  | Session: $0.0074🟩 1.4%                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
$ cai_env pip freeze | grep cai
cai-framework==0.5.3

double16 avatar Aug 05 '25 20:08 double16

I have tried looking into this issue and submitted a possible fix in #222 . It seems that the latest version hasn’t been released on PyPI yet, but you can try fixing it by using the latest source code from the repository.

1793649019 avatar Aug 07 '25 13:08 1793649019

I am just going to echo what some others have said, I am encountering this same exact issue. It really does not make that much sense that agents dont recognize MCP tools that they have been associated with

xopherKPMG avatar Aug 29 '25 11:08 xopherKPMG

Confirmed latest code pulled from main less than an hour ago will use tools from my MCP server. Now the problem is the timeout is too short for some tools like port scan and spider, but that's another issue.

double16 avatar Oct 08 '25 10:10 double16

It seems this is hardcoded in cai/src/cai/repl/commands/mcp.py, line 257. As a temporary workaround, you might try changing that value. Now that MCP server seems to be working properly, it looks like this issue has been resolved to some extent.

1793649019 avatar Oct 08 '25 22:10 1793649019

Glad to hear the issue is resolved. Thank you for your contributions to the community and for using CAI.

aliasrobotics-support avatar Oct 28 '25 16:10 aliasrobotics-support