Quick Start
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.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.| Synthetic tool | Purpose | Registered when |
|---|---|---|
list_mcp_resources | List concrete resources on the server | server exposes resources or resource templates |
list_mcp_resource_templates | List URI templates the server can materialise | server exposes resources or resource templates |
read_mcp_resource(uri) | Fetch a resource by URI (returns normalised text) | server exposes resources or resource templates |
list_mcp_prompts | List prompt templates | server exposes prompts |
get_mcp_prompt(name, arguments={}) | Render a prompt with arguments | server exposes prompts |
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?” Agent →list_mcp_resources()(findsdocs://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.| Option | Type | Default | Description |
|---|---|---|---|
allowed_tools | List[str] | None | Include whitelist — only these tool names are kept (applies to synthetic tools too) |
disabled_tools | List[str] | None | Exclude blacklist — these tool names are filtered out |
with_tool_prefix("<name>") | method | none | Namespace tool names as <name>_<tool> to avoid collisions across servers |
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 byMAX_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 asearch tool and a corpus of resources feeds one agent — the tool searches, the resources get read.
Best Practices
Prefer smaller resources
Prefer smaller resources
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.Use with_tool_prefix when combining servers
Use with_tool_prefix when combining servers
Two servers advertising
read_mcp_resource otherwise show up with the same name and confuse the model. Prefix each server so names stay distinct.Filter with disabled_tools for tighter agents
Filter with disabled_tools for tighter agents
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.A server tool of the same name always wins
A server tool of the same name always wins
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.Related
MCP Tools
MCP module basics and tool usage
MCP Transports
How PraisonAI connects to MCP servers

