Debugging Easy-MCP-Use
Easy-MCP-Use provides built-in debugging functionality that increases log verbosity and helps diagnose issues in your agent implementation.Enabling Debug Mode
There are two primary ways to enable debug mode:1. Environment Variable (Recommended for One-off Runs)
Run your script with theDEBUG
environment variable set to the desired level:
2. Setting the Debug Flag Programmatically
You can set the global debug flag directly in your code, which is useful for debugging specific parts of your application or conditionally enabling debug mode based on your application state:Debug Levels
Easy-MCP-Use supports different levels of debugging:Level | Environment Variable | Program Setting | Description |
---|---|---|---|
0 | (not set) | setDebug(0) | Normal operation, only WARNING and above messages are shown |
1 | DEBUG=1 | setDebug(1) | INFO level messages are shown - useful for basic operational information. Shows tool calls. |
2 | DEBUG=2 | setDebug(2) | Full DEBUG level - all detailed debugging information is shown |
Agent-Specific Verbosity
If you only want to increase verbosity for the agent component without enabling full debug mode for the entire package, you can use theverbose
parameter when creating an MCPAgent:
Debug Information
When debug mode is enabled, you’ll see more detailed information about:- Server initialization and connection details
- Tool registration and resolution
- Agent steps and decision-making
- Request and response formats
- Communication with MCP servers
- Error details and stack traces