mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-07 12:47:55 -10:00
PraisonAI MCP Server Examples
This directory contains examples for running PraisonAI as an MCP (Model Context Protocol) server.
Overview
PraisonAI can expose its capabilities via MCP protocol, allowing integration with:
- Claude Desktop
- Cursor
- Windsurf
- VSCode MCP clients
- Any MCP-compatible client
Protocol Version
These examples use MCP Protocol Version 2025-11-25.
Examples
1. STDIO Server (stdio_server.py)
Run PraisonAI as an MCP server using STDIO transport (for Claude Desktop integration).
# Run directly
python stdio_server.py
# Or via CLI
praisonai mcp serve --transport stdio
2. HTTP Stream Server (http_stream_server.py)
Run PraisonAI as an MCP server using HTTP Stream transport.
# Run directly
python http_stream_server.py
# Or via CLI
praisonai mcp serve --transport http-stream --port 8080
3. Custom Tools Server (custom_tools_server.py)
Register custom tools and expose them via MCP.
python custom_tools_server.py
4. Client Example (mcp_client_example.py)
Example of connecting to a PraisonAI MCP server as a client.
python mcp_client_example.py
CLI Commands
# Start STDIO server
praisonai mcp serve --transport stdio
# Start HTTP Stream server
praisonai mcp serve --transport http-stream --port 8080
# Start with authentication
praisonai mcp serve --transport http-stream --api-key YOUR_KEY
# List available tools
praisonai mcp list-tools
# List available resources
praisonai mcp list-resources
# List available prompts
praisonai mcp list-prompts
# Generate client configuration
praisonai mcp config-generate --client claude-desktop
# Check server health
praisonai mcp doctor
Client Configuration
Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"praisonai": {
"command": "praisonai",
"args": ["mcp", "serve", "--transport", "stdio"]
}
}
}
Cursor
Add to Cursor settings:
{
"mcpServers": {
"praisonai": {
"command": "praisonai",
"args": ["mcp", "serve", "--transport", "stdio"]
}
}
}
Environment Variables
Set the following environment variables for full functionality:
export OPENAI_API_KEY=your_key
export ANTHROPIC_API_KEY=your_key # Optional
export GOOGLE_API_KEY=your_key # Optional
Available Tools
Run praisonai mcp list-tools to see all available tools, including:
praisonai.chat.completion- Chat with LLMpraisonai.agent.chat- Chat with an agentpraisonai.agent.run- Run a task with an agentpraisonai.workflow.run- Run a workflowpraisonai.images.generate- Generate imagespraisonai.audio.transcribe- Transcribe audiopraisonai.embed.create- Create embeddingspraisonai.memory.*- Memory operationspraisonai.knowledge.*- Knowledge base operations- And many more...
Available Resources
praisonai://memory/sessions- List memory sessionspraisonai://workflows- List available workflowspraisonai://tools- List available toolspraisonai://agents- List agent configurationspraisonai://knowledge/sources- List knowledge sourcespraisonai://config- Get current configurationpraisonai://mcp/status- Get MCP server status
Available Prompts
deep-research- Generate deep research promptscode-review- Generate code review promptsworkflow-auto- Generate workflow auto-generation promptsguardrail-check- Generate guardrail check promptscontext-engineering- Generate context engineering promptseval-criteria- Generate evaluation criteria promptsagent-instructions- Generate agent instructions prompts