Skip to main content
Deploy any PraisonAI recipe as an MCP server for Claude Desktop, Cursor, and other MCP clients.

Quick Start

1

Install Dependencies

pip install "praisonai[mcp]"
2

Set API Key

export OPENAI_API_KEY="your-key"
3

List Available Recipes

praisonai mcp list-recipes
4

Serve Recipe as MCP

praisonai mcp serve-recipe support-reply --transport stdio

CLI - STDIO Transport

For Claude Desktop local integration:
praisonai mcp serve-recipe support-reply --transport stdio
Expected Output:
🚀 Starting Recipe MCP Server 'support-reply'
📡 Transport: stdio
🛠️ Available tools: support_reply.run, support_reply.agent.respond

CLI - HTTP Stream Transport

For remote access:
praisonai mcp serve-recipe support-reply --transport http-stream --port 8080
Expected Output:
🚀 Starting Recipe MCP Server 'support-reply'
📡 HTTP Stream endpoint: http://127.0.0.1:8080/mcp
🛠️ Available tools: support_reply.run, support_reply.agent.respond

Python SDK

from praisonai.mcp_server import RecipeMCPAdapter, RecipeMCPConfig

# Create adapter with config
config = RecipeMCPConfig(
    recipe_name="support-reply",
    expose_agent_tools=True,
    expose_run_tool=True,
    safe_mode=True
)

adapter = RecipeMCPAdapter("support-reply", config=config)
adapter.load()

# Get MCP server
server = adapter.to_mcp_server()
server.run(transport="stdio")

Recipe MCP Mapping

Recipe ComponentMCP Primitive
Recipe metadataServer metadata
Agent toolsMCP Tools (namespaced)
Agent instructionsMCP Prompts
Recipe configMCP Resources
Recipe outputsMCP Resources

RecipeMCPConfig Options

FieldTypeDefaultDescription
recipe_namestr-Recipe to serve
expose_agent_toolsboolTrueExpose agent tools
expose_run_toolboolTrueExpose run tool
tool_namespacestrprefixedflat, nested, prefixed
expose_configboolTrueExpose config as resource
expose_outputsboolTrueExpose outputs as resource
expose_promptsboolTrueExpose prompts
safe_modeboolTrueEnable security restrictions
tool_allowlistlistNoneAllowed tool names
tool_denylistlistNoneDenied tool names

CLI Options

OptionDefaultDescription
--transportstdiostdio or http-stream
--host127.0.0.1HTTP host
--port8080HTTP port
--safe-modeTrueEnable security
--log-levelwarningLog level

Generate Client Config

# Generate Claude Desktop config
praisonai mcp config-generate-recipe support-reply --client claude-desktop
Output:
{
  "mcpServers": {
    "support-reply": {
      "command": "praisonai",
      "args": ["mcp", "serve-recipe", "support-reply", "--transport", "stdio"]
    }
  }
}

Connect MCP Client

Claude Desktop (claude_desktop_config.json): For STDIO:
{
  "mcpServers": {
    "support-reply": {
      "command": "praisonai",
      "args": ["mcp", "serve-recipe", "support-reply", "--transport", "stdio"]
    }
  }
}
For HTTP Stream:
{
  "mcpServers": {
    "support-reply": {
      "url": "http://localhost:8080/mcp",
      "transport": "http-stream"
    }
  }
}

Validate Recipe

Check if a recipe is MCP-compatible:
praisonai mcp validate-recipe support-reply
Output:
✅ Recipe 'support-reply' is MCP-compatible

Tools: 3
  • support_reply.run
  • support_reply.agent.respond
  • support_reply.agent.analyze

Resources: 2
  • recipe://support-reply/config
  • recipe://support-reply/outputs

Prompts: 1
  • support_reply.instructions

Inspect Recipe Schema

praisonai mcp inspect-recipe support-reply

Security

Default denied tools (dangerous operations):
  • shell.exec, shell.run
  • file.write, file.delete
  • db.write, db.delete
  • execute_command, os.system
Override with --safe-mode=false (not recommended).

Troubleshooting

IssueFix
Recipe not foundpraisonai mcp list-recipes
Missing depspip install "praisonai[mcp]"
Tool deniedCheck tool_denylist
Port in useChange --port