[BUG] stdio transport fails to initialize with Codex CLI unless FastMCP banner is disabled
已打开 04:53AM - 29 Jun 26 UTC
bug
### Description
When using `jadx-mcp-server` with **Codex CLI** over stdio trans…port, the MCP server process appears to start, but the MCP initialization handshake fails.
Codex CLI reports that the connection is closed while waiting for the `initialize` response.
I noticed that #51 had already proposed disabling the FastMCP banner for stdio usage by adding `show_banner=False`. However, after the combined merge in 605429d, this specific change does not appear to be present. As a result, stdio usage with Codex CLI still fails unless the server is manually patched.
### Environment
- JADX Version: 1.5.5
- MCP Server Version: v6.4.0
- OS: Windows 11
- Java Version:
```text
openjdk version "21.0.11" 2026-04-21 LTS
OpenJDK Runtime Environment Zulu21.50+19-CA (build 21.0.11+10-LTS)
OpenJDK 64-Bit Server VM Zulu21.50+19-CA (build 21.0.11+10-LTS, mixed mode, sharing)
```
- MCP Client: Codex CLI
- FastMCP Version: 3.4.2
- Python Runner: `uv`
### Steps to Reproduce
1. Configure `jadx-mcp-server` as a stdio MCP server for Codex CLI:
```toml
[mcp_servers.jadx-mcp]
command = "uv"
args = [
"--directory",
"D:\\Tool\\jadx-gui-1.5.5-win\\jadx-mcp-server",
"run",
"jadx_mcp_server.py"
]
```
2. Start Codex CLI.
3. Wait for MCP server initialization.
4. Observe that MCP startup fails during the stdio initialize handshake.
### Expected Behavior
The MCP server should start successfully over stdio and complete the MCP `initialize` handshake with Codex CLI.
### Actual Behavior
Codex CLI fails to start the MCP server and reports an initialization/handshake failure.
Example error:
```text
MCP client for `jadx-mcp` failed to start:
MCP startup failed: handshaking with MCP server failed:
connection closed: initialize response
MCP startup incomplete (failed: jadx-mcp)
```
Running the server manually shows that it starts:
```powershell
uv --directory "D:\Tool\jadx-gui-1.5.5-win\jadx-mcp-server" run jadx_mcp_server.py
```
Example output:
```text
FastMCP 3.4.2
Starting MCP server 'JADX-AI-MCP Plugin Reverse Engineering Server' with transport 'stdio'
```
However, Codex CLI cannot complete the MCP stdio handshake unless the server is manually patched.
### Screenshots
N/A
### Sample Code/APK
N/A. This issue is reproducible during MCP server startup/initialization and does not require a specific APK.
### Logs
Codex CLI MCP error:
```text
MCP client for `jadx-mcp` failed to start:
MCP startup failed: handshaking with MCP server failed:
connection closed: initialize response
MCP startup incomplete (failed: jadx-mcp)
```
Manual server run:
```text
FastMCP 3.4.2
Starting MCP server 'JADX-AI-MCP Plugin Reverse Engineering Server' with transport 'stdio'
```
### Additional Context/ What you tried to solve it
I manually patched `jadx_mcp_server.py` by changing the stdio startup path from:
```python
# Run Server
if args.http:
mcp.run(transport="streamable-http", host=args.host, port=args.port)
else:
# StdIO transport must keep stdout reserved for MCP frames.
mcp.run()
```
to:
```python
# Run Server
if args.http:
mcp.run(transport="streamable-http", host=args.host, port=args.port)
else:
# StdIO transport must keep stdout reserved for MCP frames.
mcp.run(show_banner=False)
```
After this change, Codex CLI can start the MCP server successfully and the stdio initialization works.
This seems related to the change proposed in #51, but the `show_banner=False` part appears to have been missed in the combined merge commit 605429d.