MCP Server CLI

CLI commands for running PraisonAI as an MCP server

MCP Server CLI Commands

PraisonAI provides comprehensive CLI commands for running and managing MCP servers.

Primary Command

bash
praisonai-mcp <subcommand> [options]   # standalone console script
praisonai mcp <subcommand> [options]   # equivalent (umbrella)

Subcommands

list-tools, list-resources, list-prompts, serve, and doctor all share the same register_all() registration — anything serve exposes at runtime shows up in the corresponding list-* command (see sibling parity fix #2146).

serve

Start the MCP server.

bash
# STDIO transport (default, for Claude Desktop)
praisonai-mcp serve
praisonai mcp serve                 # equivalent

# HTTP Stream transport
praisonai-mcp serve --transport http-stream

# With all options
praisonai mcp serve \
  --transport http-stream \
  --host 127.0.0.1 \
  --port 8080 \
  --endpoint /mcp \
  --api-key YOUR_KEY \
  --name praisonai \
  --response-mode batch \
  --session-ttl 3600 \
  --log-level info

Options:

OptionDescriptionDefault
--transportstdio or http-streamstdio
--hostServer host127.0.0.1
--portServer port8080
--endpointMCP endpoint path/mcp
--api-keyAPI key for authentication (single wildcard-scoped key)None
--keys-fileJSON file of per-key scopes for least-privilege accessNone
--nameServer namepraisonai
--response-modebatch or streambatch
--cors-originsComma-separated CORS origins*
--allowed-originsComma-separated allowed originslocalhost
--session-ttlSession TTL in seconds3600
--no-terminationDisable client session terminationFalse
--resumabilityEnable SSE resumabilityTrue
--log-leveldebug, info, warning, errorwarning
--jsonOutput in JSON formatFalse
--debugEnable debug modeFalse

list-tools

List all available MCP tools.

bash
praisonai mcp list-tools

Example Output:

Available MCP Tools (86):

  • praisonai.chat.completion
    Generate chat completion.

  • praisonai.agent.chat
    Chat with a PraisonAI agent.

  • praisonai.images.generate
    Generate images from text prompt.
  ...

list-resources

List all available MCP resources.

bash
praisonai mcp list-resources

Example Output:

Available MCP Resources (7):

  • praisonai://memory/sessions
    List all memory sessions.

  • praisonai://workflows
    List available workflows in current directory.
  ...

list-prompts

List all available MCP prompts.

bash
praisonai mcp list-prompts

Example Output:

Available MCP Prompts (7):

  • deep-research
    Generate a deep research prompt for comprehensive topic analysis

  • code-review
    Generate a code review prompt for analyzing code quality
  ...

config-generate

Generate client configuration for MCP clients.

bash
# Claude Desktop config
praisonai mcp config-generate --client claude-desktop

# Cursor config
praisonai mcp config-generate --client cursor

# VSCode config
praisonai mcp config-generate --client vscode

# Windsurf config
praisonai mcp config-generate --client windsurf

# Save to file
praisonai mcp config-generate --client claude-desktop --output config.json

# HTTP Stream config
praisonai mcp config-generate --client claude-desktop --transport http-stream --port 8080

Options:

OptionDescriptionDefault
--clientClient typeclaude-desktop
--outputOutput file pathstdout
--transportTransport typestdio
--hostServer host (for http-stream)127.0.0.1
--portServer port (for http-stream)8080

Output:

Since v4.6.154, the generator auto-detects praisonai-mcp on your PATH and emits the matching STDIO command.

Standalone (praisonai-mcp)

json
{
  "mcpServers": {
    "praisonai": {
      "command": "praisonai-mcp",
      "args": ["serve", "--transport", "stdio"]
    }
  }
}

Umbrella (praisonai)

json
{
  "mcpServers": {
    "praisonai": {
      "command": "praisonai",
      "args": ["mcp", "serve", "--transport", "stdio"]
    }
  }
}

doctor

Health check for the MCP server. Human-readable by default, or machine-readable with --json.

bash
# Pretty (default)
praisonai mcp doctor

# Machine-readable — safe for CI, safe on Windows cp1252 consoles
praisonai mcp doctor --json
FlagEffect
--jsonMachine-readable JSON output (no Unicode symbols, safe for CI)

Example Output (text):

PraisonAI MCP Server Health Check

Protocol Version: 2025-11-25
Supported Versions: 2025-11-25, 2025-03-26, 2024-11-05

Registered Components:
  • Tools: 86
  • Resources: 7
  • Prompts: 7

Environment:
  ✓ OPENAI_API_KEY
  ○ ANTHROPIC_API_KEY
  ○ GOOGLE_API_KEY

Dependencies:
  ✓ starlette
  ✓ uvicorn
  ✓ praisonaiagents

✓ MCP server is ready to run

Example Output (--json):

json
{
  "protocol_version": "2025-11-25",
  "supported_versions": ["2025-11-25", "2025-03-26", "2024-11-05"],
  "components": {
    "tools": 86,
    "resources": 7,
    "prompts": 7
  },
  "environment": {
    "OPENAI_API_KEY": true,
    "ANTHROPIC_API_KEY": false,
    "GOOGLE_API_KEY": false
  },
  "dependencies": {
    "starlette": true,
    "uvicorn": true,
    "praisonaiagents": true
  },
  "ready": true
}

JSON-mode failures still emit valid JSON, so CI parsers never choke on Rich-formatted text:

json
{
  "error": "register blew up",
  "ready": false
}
Diagram

utf-8

cp1252 / other

praisonai mcp doctor

stdout
encoding?

✓ ○ ✗ •

[OK] [–] [X] –

Render health check

Deprecated Commands

The following commands are deprecated and will be removed in a future version:

bash
# DEPRECATED - use 'praisonai mcp serve' instead
praisonai serve mcp

# DEPRECATED - use 'praisonai mcp serve' instead
praisonai serve tools

These commands will show a deprecation warning and redirect to praisonai mcp serve.

Examples

Start STDIO Server for Claude Desktop

bash
praisonai mcp serve --transport stdio

Start HTTP Server with Authentication

bash
praisonai mcp serve \
  --transport http-stream \
  --port 8080 \
  --api-key mysecretkey

Start Server with Custom Origins

bash
praisonai mcp serve \
  --transport http-stream \
  --allowed-origins "http://localhost:3000,https://myapp.com"

Generate and Apply Claude Desktop Config

bash
# Generate config
praisonai mcp config-generate --client claude-desktop --output ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Or manually copy the output
praisonai mcp config-generate --client claude-desktop

Debug Mode

bash
praisonai mcp serve --transport http-stream --debug --log-level debug

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key for chat/image tools
ANTHROPIC_API_KEYAnthropic API key
GOOGLE_API_KEYGoogle API key

Exit Codes

CodeDescription
0Success — all dependencies present and at least one API key configured
1Error — any dependency missing, or any exception raised

Common Issues

IssueFix
praisonai-mcp list-resources or list-prompts prints “No resources/prompts registered”Upgrade to v4.6.154 or later — the registries were being read before being populated on those subcommands (PR #3220).

See Also