MCP tool turns are treated specially: a mid-response network failure surfaces
provider_outcome_unknown instead of silently re-running the tool. See Replay-Safe Retries.Which MCP package do I need?
Three packages cover three MCP roles — connecting, light serving, and full hosting. This page covers the client layer. To serve your own agents, see the praisonai-mcp Package and The Three MCP Layers.Quick Start
1
Connect to an MCP server
2
SSE-based MCP server
3
Streamable HTTP MCP server
mcp package (pip install -U 'mcp'). The transport is powered by the official SDK’s streamablehttp_client.Pass the full endpoint URL your server exposes. Bare-host URLs are no longer rewritten to /mcp (see PraisonAI #3032).4
Multiple MCP servers
Three equivalent forms
MCP(...) accepts the command in three equivalent forms — pick whichever reads best for your stdio server.
Pick the form that matches how the command reaches your code.
- Form 1 — single string
- Form 2 — string + args
- Form 3 — fully separated
Merge rules
A multi-token string is split withshlex: the first token becomes the command, and the remaining tokens are prepended to any explicit args.
MCP("cmd multi word", args=[...]) requires PraisonAI containing #3943 (merged 2026-08-15). On older versions this form silently discovered 0 tools — upgrade with pip install -U praisonaiagents or switch to Form 1 or Form 3.How It Works
For string forms, the command is parsed with
shlex before the server spawns.
MCP Server Types
Remote Streamable HTTP servers connect through the official MCP SDK client.Common Patterns
Pattern 1 — File management agent
Pattern 2 — Database agent
Pattern 3 — GitHub integration
Best Practices
Use official MCP servers
Use official MCP servers
Start with the official
@modelcontextprotocol npm packages for common integrations (filesystem, SQLite, GitHub, etc.). They’re well-tested and actively maintained.Scope filesystem access
Scope filesystem access
When using the filesystem MCP server, pass the narrowest directory path you need. Giving access to
/ or /home when you only need /app/data creates unnecessary risk.Environment variables for credentials
Environment variables for credentials
Never hardcode API keys or tokens in your code. Pass them as environment variables to the MCP server via the
env parameter, and source them from your environment or secrets manager.Combine multiple servers
Combine multiple servers
Agents can use tools from multiple MCP servers simultaneously. Unpack each server’s tools with
*MCP(...) and combine them into a single tools list for maximum capability. Loading via load_mcp_tools auto-namespaces each server’s tools (e.g. filesystem_search, github_search) so overlapping names never collide.Related
Tools — built-in tools and custom tool functions
MCP Tool Filtering — filter which tools to expose per agent

