Skip to main content
Some MCP servers ship files and prompt templates, not just tools. PraisonAI surfaces both as agent-callable tools automatically — no extra config.

Quick Start

1

Read a resource

An agent connects to a resource server and reads a file — no extra setup.
list_mcp_resources and read_mcp_resource were auto-registered because the server advertises resources.
2

Run a prompt

Servers that ship prompt templates expose list_mcp_prompts and get_mcp_prompt.
3

Namespace with a prefix (optional)

Add a per-server prefix when combining multiple servers on one agent.

How It Works

Resources and prompts are looked up during connect, then routed through synthetic tools the agent can call. Synthetic tools are capability-gated — they only appear when the server advertises them. Resources are looked up during connect via list_resources(), list_resource_templates(), and list_prompts(). Each is a best-effort call — tools-only servers still initialise cleanly.

User interaction flow

A real run stitches the synthetic tools together automatically.
User: “What’s the tallest mountain?” Agentlist_mcp_resources() (finds docs://mountains.md) → read_mcp_resource("docs://mountains.md") → composes the final answer.

Configuration Options

No config class is required — behaviour is capability-gated automatically. Two knobs let you shape what the agent sees.

Introspection API

Inspect capability without invoking any tool.
MCP.get_resources() returns resource and resource-template dicts:
MCP.get_prompts() returns prompt dicts with argument hints:

Payload guard

Content is normalised before it reaches the agent, capped by MAX_INLINE_BYTES = 100_000.
  • Text over the limit is truncated with a ...[truncated, N chars total] marker.
  • Binary payloads never inline — they become [binary resource: <mimeType>, <N> bytes].

Common Patterns

Combine tools + resources on one agent. A research server offering both a search tool and a corpus of resources feeds one agent — the tool searches, the resources get read.
Multiple MCP servers with prefixes. A docs server and a prompts server sit side by side, each namespaced to keep tool names distinct.
Introspect before calling. Log or gate what the agent can see at wire-up time.

Best Practices

Servers that expose very large files hand agents truncated content once past MAX_INLINE_BYTES = 100_000. Split resources or add a search tool so the agent fetches only what it needs.
Two servers advertising read_mcp_resource otherwise show up with the same name and confuse the model. Prefix each server so names stay distinct.
If an agent shouldn’t browse prompt packs, drop list_mcp_prompts explicitly via disabled_tools. Synthetic tools go through the same filters as server tools.
If the server registers a real read_mcp_resource, the synthetic version is skipped by design so the callable and its schema stay consistent. Don’t rely on the synthetic tool when the server exposes its own.

MCP Tools

MCP module basics and tool usage

MCP Transports

How PraisonAI connects to MCP servers