> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Server: Recipes MCP

> Deploy recipes as MCP servers using praisonai mcp serve-recipe

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

## Quick Start

<Steps>
  <Step title="Install Dependencies">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install "praisonai[mcp]"
    ```
  </Step>

  <Step title="Set API Key">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    export OPENAI_API_KEY="your-key"
    ```
  </Step>

  <Step title="List Available Recipes">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai mcp list-recipes
    ```
  </Step>

  <Step title="Serve Recipe as MCP">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai mcp serve-recipe support-reply --transport stdio
    ```
  </Step>
</Steps>

## CLI - STDIO Transport

For Claude Desktop local integration:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 Component   | MCP Primitive          |
| ------------------ | ---------------------- |
| Recipe metadata    | Server metadata        |
| Agent tools        | MCP Tools (namespaced) |
| Agent instructions | MCP Prompts            |
| Recipe config      | MCP Resources          |
| Recipe outputs     | MCP Resources          |

## RecipeMCPConfig Options

| Field                | Type | Default    | Description                  |
| -------------------- | ---- | ---------- | ---------------------------- |
| `recipe_name`        | str  | -          | Recipe to serve              |
| `expose_agent_tools` | bool | `True`     | Expose agent tools           |
| `expose_run_tool`    | bool | `True`     | Expose run tool              |
| `tool_namespace`     | str  | `prefixed` | `flat`, `nested`, `prefixed` |
| `expose_config`      | bool | `True`     | Expose config as resource    |
| `expose_outputs`     | bool | `True`     | Expose outputs as resource   |
| `expose_prompts`     | bool | `True`     | Expose prompts               |
| `safe_mode`          | bool | `True`     | Enable security restrictions |
| `tool_allowlist`     | list | `None`     | Allowed tool names           |
| `tool_denylist`      | list | `None`     | Denied tool names            |

## CLI Options

| Option        | Default     | Description              |
| ------------- | ----------- | ------------------------ |
| `--transport` | `stdio`     | `stdio` or `http-stream` |
| `--host`      | `127.0.0.1` | HTTP host                |
| `--port`      | `8080`      | HTTP port                |
| `--safe-mode` | `True`      | Enable security          |
| `--log-level` | `warning`   | Log level                |

## Generate Client Config

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Generate Claude Desktop config
praisonai mcp config-generate-recipe support-reply --client claude-desktop
```

**Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "mcpServers": {
    "support-reply": {
      "command": "praisonai",
      "args": ["mcp", "serve-recipe", "support-reply", "--transport", "stdio"]
    }
  }
}
```

## Connect MCP Client

**Claude Desktop** (`claude_desktop_config.json`):

For STDIO:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "mcpServers": {
    "support-reply": {
      "command": "praisonai",
      "args": ["mcp", "serve-recipe", "support-reply", "--transport", "stdio"]
    }
  }
}
```

For HTTP Stream:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "mcpServers": {
    "support-reply": {
      "url": "http://localhost:8080/mcp",
      "transport": "http-stream"
    }
  }
}
```

## Validate Recipe

Check if a recipe is MCP-compatible:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

| Issue            | Fix                            |
| ---------------- | ------------------------------ |
| Recipe not found | `praisonai mcp list-recipes`   |
| Missing deps     | `pip install "praisonai[mcp]"` |
| Tool denied      | Check `tool_denylist`          |
| Port in use      | Change `--port`                |

## Related

* [Tools MCP](./tools-mcp) - Deploy tools as MCP server
* [Agents MCP](./agents-mcp) - Deploy agents as MCP server
* [PraisonAI MCP](./praisonai-mcp) - Full PraisonAI MCP server
