MCP Lifecycle CLI
CLI commands for MCP server lifecycle and agent integration
Commands for running PraisonAI’s MCP server, inspecting built-in tools, and attaching external MCP servers to agent runs.
Quick Start
# Start the built-in MCP server (stdio)
praisonai mcp serve
# List built-in MCP tools
praisonai mcp list-tools
# Run an agent with an external MCP server
praisonai "What time is it?" --mcp "uvx mcp-server-time"MCP server commands
Serve
Start the PraisonAI MCP server:
praisonai mcp serve --transport stdio
praisonai mcp serve --transport http-stream --host 127.0.0.1 --port 8080Common flags: --name, --debug, --response-mode batch|stream, --session-ttl, --log-level, --json.
Inspect built-in tools
# List all tools
praisonai mcp list-tools
# Search tools
praisonai mcp tools search "web"
# Tool details and schema
praisonai mcp tools info tavily_search
praisonai mcp tools schema tavily_searchHealth check
Use the doctor command to verify MCP connectivity (not praisonai mcp doctor):
praisonai doctor mcp
praisonai doctor mcp --deepUsing MCP with agents
Basic usage
praisonai "What time is it?" --mcp "uvx mcp-server-time"Multiple MCP servers
praisonai "Get time and search" \
--mcp "uvx mcp-server-time" \
--mcp "npx -y @modelcontextprotocol/server-brave-search"With environment variables
export BRAVE_API_KEY="your-key"
praisonai "Search for Python" \
--mcp "npx -y @modelcontextprotocol/server-brave-search" \
--mcp-env "BRAVE_API_KEY=${BRAVE_API_KEY}"Connection types
| Transport | Example --mcp value |
|---|---|
| Stdio (command) | "uvx mcp-server-time" |
| SSE URL | "http://localhost:8080/sse" |
| HTTP stream | "http://localhost:8080" |
| WebSocket | "ws://localhost:8080" |
Lifecycle management
Connections opened via --mcp are cleaned up automatically when the agent run finishes:
praisonai "What time is it?" --mcp "uvx mcp-server-time"Debugging
Verbose agent run
praisonai "Task" --mcp "uvx mcp-server-time" --verbosePython connectivity check
python -c "
from praisonaiagents import MCP
with MCP('uvx mcp-server-time') as mcp:
print('Connection: OK')
tools = mcp.get_tools()
print(f'Tools: {len(tools)}')
print('Cleanup: OK')
"