inspector
inspector copied to clipboard
Add MCP server logs to --cli mode
When using the MCP Inspector in CLI mode, I couldn't find an easy way to see the MCP server logs (unlike in the web UI where they appear in the "Error output from MCP server" pane). Seeing the logs in the terminal or in a log file when launching mcp commands would be super useful for debuggin/troubleshooting and automation
Maybe we could add a flag to output the server logs to in CLI mode to the terminal or a log file, similar to how they're shown in the web UI
npx @modelcontextprotocol/inspector --cli --config config.json --server myserver --server-logs=true --method tools/list
or with a log file since the terminal output is already populated by mcp commands output
npx @modelcontextprotocol/inspector --cli --config config.json --server myserver --server-logs=true --server-logs-file=./my-mcp-logs.txt --method tools/list