Skip to main content
Load MCP tools from your configured servers with a single function call, following the agent-centric design principles.
The user asks a question; the agent calls MCP tools loaded from your JSON/TOML server config.

Quick Start

1

Load All Enabled Servers

Wire all enabled MCP servers from your configuration:
2

Load Specific Servers

Load only the servers you need by name:

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


Multi-Server Namespacing

Loading several servers together auto-prefixes each server’s tools so overlapping names never collide.
Dispatch still routes to each server’s original tool name — only the name the model sees changes. Both servers expose a search tool, yet the agent sees two distinct, callable names:
Single-server loads keep bare names. load_mcp_tools(["filesystem"]) still emits read_file, not filesystem_read_file.
Server names are sanitized to [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 raises ValueError.
  • 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

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.
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.

MCP Tool Filtering

Restrict which MCP tools an agent can see and call

MCP CLI

Configure and manage MCP servers from the command line