Skip to main content

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.

Load MCP tools from your configured servers with a single function call, following the agent-centric design principles.

Quick Start

1

Load All Enabled Servers

Wire all enabled MCP servers from your configuration:
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools

agent = Agent(name="assistant", tools=load_mcp_tools())
agent.start("List files in /tmp")
2

Load Specific Servers

Load only the servers you need by name:
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools

tools = load_mcp_tools(["filesystem", "github"])
agent = Agent(name="coder", tools=tools)
agent.start("Read the README file and create a GitHub issue")

How It Works

The loader bridges configuration and agent setup by:
  1. Reading configs from ~/.praisonai/mcp/ directory
  2. Filtering by enabled status and optional name selection
  3. Converting each config to an MCP client instance
  4. Returning ready-to-use tool instances

Configuration Options

ParameterTypeDefaultDescription
namesList[str]NoneSpecific config names to load (None = all enabled)
configsList[MCPConfig]NoneOptional injected configs from wrapper TOML loader
prefix_toolsboolTruePrefix tool names when multiple servers loaded (collision avoidance — currently stub)

Common Patterns

Load All Enabled Servers

The simplest approach - load everything that’s enabled:
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools

agent = Agent(
    name="multi-tool-assistant",
    instructions="Help with various tasks using available tools",
    tools=load_mcp_tools()
)

Load Specific Servers

Target specific capabilities for focused agents:
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools

# File operations only
file_agent = Agent(
    name="file-assistant", 
    tools=load_mcp_tools(["filesystem"])
)

# Development tools
dev_agent = Agent(
    name="dev-assistant",
    tools=load_mcp_tools(["filesystem", "github", "postgres"])
)

Inject Configs from TOML

Advanced usage with wrapper TOML loading:
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools
from praisonai.cli.configuration import get_config_loader

# Load from wrapper TOML config
loader = get_config_loader()
config = loader.load()
toml_configs = [MCPConfig(...) for server in config.mcp.servers]

# Use injected configs
tools = load_mcp_tools(configs=toml_configs)
agent = Agent(name="toml-configured", tools=tools)

Best Practices

Set up your MCP servers once using praisonai mcp create, then any agent can pick them up automatically via load_mcp_tools(). This follows the “configure once, use everywhere” principle.
Use specific server names rather than loading everything. A file processing agent only needs ["filesystem"], while a development agent might need ["filesystem", "github", "postgres"].
The loader silently skips disabled or missing configs. Always check that your expected servers are enabled with praisonai mcp list.
When loading multiple servers that might have overlapping tool names, be aware that prefix_tools=True is currently a stub. Plan your server selection to avoid conflicts.

MCP Tool Filtering

Restrict which MCP tools an agent can see and call

MCP CLI

Configure and manage MCP servers from the command line