PraisonAI MCP Server
Run PraisonAI as an MCP server for Claude Desktop, Cursor, and other MCP clients
PraisonAI MCP Server
PraisonAI can expose its capabilities via the Model Context Protocol (MCP), allowing integration with Claude Desktop, Cursor, Windsurf, VSCode, and other MCP-compatible clients.
Protocol Version
PraisonAI MCP Server implements MCP Protocol Version 2025-11-25.
Quick Start
STDIO Transport (Recommended for Claude Desktop)
praisonai mcp serve --transport stdioHTTP Stream Transport
praisonai mcp serve --transport http-stream --port 8080Features
- 80+ MCP Tools – Access all PraisonAI capabilities as MCP tools (86 registered by
praisonai-mcp serve) - 7 MCP Resources – Read-only access to configuration and status
- 7 MCP Prompts – Pre-built prompts for common tasks
- STDIO Transport – For Claude Desktop and local integrations
- HTTP Stream Transport – For web-based integrations
- Session Management – Full session support with resumability
- Origin Validation – Security for HTTP transport
- Progress Notifications – For long-running operations
Installation
Three pathways install the heavy MCP host.
| Pathway | Command | When to use |
|---|---|---|
| Standalone | pip install "praisonai-mcp[all]" | MCP host only, slim image |
| Umbrella | pip install "praisonai[mcp]" | Full PraisonAI stack |
| Dev install | pip install -e "praisonai-mcp[all]" | Hacking on the host |
# Standalone
pip install "praisonai-mcp[all]"
# Or via the umbrella product
pip install "praisonai[mcp]"CLI Commands
Start Server
The standalone praisonai-mcp console script and the umbrella praisonai mcp form are equivalent for all host commands.
# STDIO transport (for Claude Desktop)
praisonai-mcp serve --transport stdio
praisonai mcp serve --transport stdio # equivalent
# HTTP Stream transport
praisonai-mcp serve --transport http-stream --port 8080
praisonai mcp serve --transport http-stream --port 8080
# With authentication
praisonai-mcp serve --transport http-stream --api-key YOUR_KEY
# With custom allowed origins
praisonai-mcp serve --transport http-stream --allowed-origins "http://localhost:3000"List Components
The three discovery commands share the same registration surface as serve and doctor — anything serve exposes at runtime shows up here:
# List available tools (86 registered)
praisonai-mcp list-tools # or: praisonai mcp list-tools
# List available resources (7 registered)
praisonai mcp list-resources
# List available prompts (7 registered)
praisonai mcp list-promptsGenerate Client Config
# For Claude Desktop
praisonai mcp config-generate --client claude-desktop
# For Cursor
praisonai mcp config-generate --client cursor
# For VSCode
praisonai mcp config-generate --client vscode
# For Windsurf
praisonai mcp config-generate --client windsurfHealth Check
# Pretty (default)
praisonai-mcp doctor # or: praisonai mcp doctor
# Machine-readable — safe for CI, safe on Windows cp1252 consoles
praisonai-mcp doctor --json # or: praisonai mcp doctor --jsonSee the full doctor reference for the JSON payload shape, exit codes, and error output.
Server Options
| Option | Description | Default |
|---|---|---|
--transport | Transport type: stdio or http-stream | stdio |
--host | HTTP host | 127.0.0.1 |
--port | HTTP port | 8080 |
--endpoint | HTTP endpoint path | /mcp |
--api-key | API key for authentication | None |
--name | Server name | praisonai |
--response-mode | Response mode: batch or stream | batch |
--cors-origins | Comma-separated CORS origins | * |
--allowed-origins | Comma-separated allowed origins | localhost |
--session-ttl | Session TTL in seconds | 3600 |
--no-termination | Disable client session termination | False |
--resumability | Enable SSE resumability | True |
--log-level | Log level: debug, info, warning, error | warning |
Client Configuration
Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Standalone (praisonai-mcp)
{
"mcpServers": {
"praisonai": {
"command": "praisonai-mcp",
"args": ["serve", "--transport", "stdio"]
}
}
}Umbrella (praisonai)
{
"mcpServers": {
"praisonai": {
"command": "praisonai",
"args": ["mcp", "serve", "--transport", "stdio"]
}
}
}Cursor
Add to Cursor MCP settings:
Standalone (praisonai-mcp)
{
"mcpServers": {
"praisonai": {
"command": "praisonai-mcp",
"args": ["serve", "--transport", "stdio"]
}
}
}Umbrella (praisonai)
{
"mcpServers": {
"praisonai": {
"command": "praisonai",
"args": ["mcp", "serve", "--transport", "stdio"]
}
}
}HTTP Stream Client
{
"mcpServers": {
"praisonai": {
"url": "http://127.0.0.1:8080/mcp",
"transport": "http-stream"
}
}
}Environment Variables
Set these for full functionality:
export OPENAI_API_KEY=your_key
export ANTHROPIC_API_KEY=your_key # Optional
export GOOGLE_API_KEY=your_key # OptionalAvailable Tools
Run praisonai mcp list-tools to see all available tools. Key categories:
Agent Tools
praisonai.agent.chat– Chat with an agentpraisonai.agent.run– Run a task with an agentpraisonai.workflow.run– Run a workflowpraisonai.research.run– Run deep research
Capability Tools
praisonai.chat.completion– Chat completionpraisonai.images.generate– Generate imagespraisonai.audio.transcribe– Transcribe audiopraisonai.audio.speech– Text to speechpraisonai.embed.create– Create embeddingspraisonai.moderate.check– Content moderationpraisonai.rerank– Rerank documentspraisonai.search– Web search
Memory Tools
praisonai.memory.show– Show memorypraisonai.memory.add– Add to memorypraisonai.memory.search– Search memorypraisonai.memory.clear– Clear memory
Knowledge Tools
praisonai.knowledge.add(source)— add a knowledge source (file path, URL, or raw text). Nosource_typeneeded; the store auto-detects.praisonai.knowledge.query– Query knowledgepraisonai.knowledge.list– List sourcespraisonai.knowledge.clear— clear the knowledge base. Returns"Knowledge cleared"only when the configured backend actually reset. When the backend does not supportreset()(e.g.ChromaKnowledgeAdapter), the tool returns `”Error: knowledge was NOT cleared – the configured backend (
) does not support reset()”` — a truthful failure on a destructive path.
praisonai.knowledge.stats– Corpus statistics
Rules Tools
praisonai.rules.list– List active rulespraisonai.rules.show(rule_name)– Show a specific rulepraisonai.rules.create(rule_name, content)– Create a new rulepraisonai.rules.delete(rule_name)– Delete a rule
Rules Tool Examples
Valid rule names:
"team-style.md"✅"coding_standards.txt"✅"PROJECT_RULES"✅
Invalid rule names:
"../../etc/passwd"❌ (contains traversal)"subdir/rule.md"❌ (contains directory separator)".bashrc"❌ (starts with dot)
For security details, see GHSA-9mqq-jqxf-grvw.
Available Resources
| URI | Description |
|---|---|
praisonai://memory/sessions | List active sessions from the session store; returns { "sessions": [...] } |
praisonai://workflows | List available workflows |
praisonai://tools | List available tools |
praisonai://agents | List agent configurations |
praisonai://knowledge/sources | List knowledge sources; returns the corpus as { "sources": [...] }, not an empty list |
praisonai://config | Get current configuration |
praisonai://mcp/status | Get MCP server status |
Available Prompts
| Name | Description |
|---|---|
deep-research | Generate deep research prompts |
code-review | Generate code review prompts |
workflow-auto | Generate workflow auto-generation prompts |
guardrail-check | Generate guardrail check prompts |
context-engineering | Generate context engineering prompts |
eval-criteria | Generate evaluation criteria prompts |
agent-instructions | Generate agent instructions prompts |
Python API
from praisonai.mcp_server.server import MCPServer
from praisonai.mcp_server.adapters import register_all
# Register all tools, resources, and prompts
register_all()
# Create server
server = MCPServer(
name="praisonai",
version="1.0.0",
instructions="PraisonAI MCP Server",
)
# Run with STDIO transport
server.run(transport="stdio")
# Or HTTP Stream transport
server.run(
transport="http-stream",
host="127.0.0.1",
port=8080,
)Custom Tools
Register custom tools:
from praisonai.mcp_server.registry import register_tool
@register_tool("custom.greet")
def greet(name: str) -> str:
"""Greet a person by name."""
return f"Hello, {name}!"Security
Origin Validation
For HTTP Stream transport, origin validation is enabled by default:
- Localhost binding: Only localhost origins allowed
- External binding: Requires explicit
--allowed-originsconfiguration
Authentication
Use --api-key for Bearer token authentication:
praisonai mcp serve --transport http-stream --api-key YOUR_SECRET_KEYClients must include:
Authorization: Bearer YOUR_SECRET_KEYSTDIO Transport Reliability
The STDIO transport (praisonai-mcp serve --transport stdio) is hardened to work everywhere your MCP client runs and to survive bad input and shutdown.
- Runs on Windows too — including Windows + Python 3.13, which used to crash. The host reads stdin on a dedicated background thread (named
mcp-stdio-reader) instead of the async pipe API, so it no longer fails withOSError: [WinError 6] The handle is invalidwhen Cursor, Claude Desktop, or Windsurf spawn it with redirected pipes. - Bad input never kills the server — malformed (non-UTF-8) bytes become a JSON-RPC parse error (
-32700) and the server keeps running. - Bounded input queue — incoming lines are capped at
1000with backpressure, so a fast or hostile client can’t grow memory without limit. - Clean shutdown — stopping the server (Ctrl+C or client disconnect) wakes a reader that is blocked on idle-but-open stdin, so it never hangs.
Troubleshooting
Error semantics
A tool response with isError: true means the call failed — either the adapter raised, or it returned an "Error: …" string that the host now surfaces as an error. MCP clients, routers, and retry logic can rely on this field. Adapters that succeed always return isError: false.
Check Server Health
praisonai mcp doctorEnable Debug Logging
praisonai mcp serve --log-level debugClients can also raise the log level at runtime via the JSON-RPC logging/setLevel method. This scopes to the same per-server praisonai.mcp_server.<name> logger, and requires the admin scope when scoped API keys are configured.
Common Issues
- “Missing dependency” – Install with
pip install praisonai[mcp] - “No API keys configured” – Set
OPENAI_API_KEYenvironment variable - “Origin validation failed” – Add origin to
--allowed-origins
| Issue | Fix |
|---|---|
OSError: [WinError 6] The handle is invalid on Windows | Upgrade to a praisonai-mcp release with the threaded stdin reader — STDIO now works on Windows + Python 3.13. |
| MCP host exits after a client sends binary / non-UTF-8 bytes | Fixed — the server returns a -32700 parse error and keeps running. |
praisonai-mcp serve --transport stdio hangs on shutdown | Fixed — stop() unblocks the idle reader for a clean exit. |