Quick Start
How It Works
The loader bridges configuration and agent setup by:- Reading configs from
~/.praisonai/mcp/directory - Filtering by enabled status and optional name selection
- Converting each config to an MCP client instance
- Returning ready-to-use tool instances
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
names | List[str] | None | Specific config names to load (None = all enabled) |
configs | List[MCPConfig] | None | Optional injected configs from wrapper TOML loader |
prefix_tools | bool | True | Namespace each server’s tools as <server_name>_<tool_name> when more than one server loads. Single-server loads keep bare names for backward compatibility. Set False to keep bare names always (collisions possible). |
Multi-Server Namespacing
Loading several servers together auto-prefixes each server’s tools so overlapping names never collide.search tool, yet the agent sees two distinct, callable names:
| Scenario | Before | After |
|---|---|---|
Load filesystem + github, both expose search | Silent collision — one shadows the other | filesystem_search, github_search — both callable |
Single-server loads keep bare names.
load_mcp_tools(["filesystem"]) still emits read_file, not filesystem_read_file.[0-9A-Za-z_] before prefixing. If two servers sanitize to the same prefix (e.g. "file-system" and "file system" both become file_system), the loader raises ValueError at load time instead of silently shadowing.
Prefixing a Single Server
MCP.with_tool_prefix() namespaces one server’s tools yourself when you build MCP instances directly.
- The prefix is sanitized to
[0-9A-Za-z_]; an empty result raisesValueError. - Returns
self, so calls chain fluently. - Dispatch still routes to the original server-side tool names.
Filtering a Single Server
MCP.apply_tool_filters() restricts which tools an instance exposes.
allowed_tools wins over disabled_tools when both are supplied. Returns self for chaining, so it composes with with_tool_prefix().
Common Patterns
Load All Enabled Servers
The simplest approach - load everything that’s enabled:Load Specific Servers
Target specific capabilities for focused agents:Inject Configs from TOML
Advanced usage with wrapper TOML loading:Best Practices
Configure Once, Use Everywhere
Configure Once, Use Everywhere
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.Filter by Purpose
Filter by Purpose
Use specific server names rather than loading everything. A file processing agent only needs
["filesystem"], while a development agent might need ["filesystem", "github", "postgres"].Handle Missing Configs Gracefully
Handle Missing Configs Gracefully
The loader silently skips disabled or missing configs. Always check that your expected servers are enabled with
praisonai mcp list.Rely on Auto-Prefixing for Collisions
Rely on Auto-Prefixing for Collisions
Multi-server loads auto-namespace tools as
<server_name>_<tool_name>, so overlapping names (like two search tools) both stay callable. If two server names sanitize to the same prefix, the loader raises a clear ValueError at load time — never a silent shadow. Set prefix_tools=False only when you need bare names and accept possible collisions.Related
MCP Tool Filtering
Restrict which MCP tools an agent can see and call
MCP CLI
Configure and manage MCP servers from the command line

