Skip to main content

MCP

Defined in the MCP module.
AI Agent Model Context Protocol (MCP) integration for PraisonAI Agents. This class provides a simple way to connect to MCP servers and use their tools within PraisonAI agents.

Constructor

Any
No description available.
Any
No description available.

Methods

list_active_server_names()

Return the set of sanitized names of MCP servers namespaced this run.

apply_tool_filters()

Public API to (re)apply allow/deny tool filters to this instance.

with_tool_prefix()

Namespace this server’s tool names with prefix_ to avoid

get_tools()

Get the list of tool functions from this MCP instance.

get_resources()

List resources/resource-templates advertised by the MCP server.

get_prompts()

List prompt templates advertised by the MCP server.

to_openai_tool()

Convert the MCP tool to an OpenAI-compatible tool definition.

shutdown()

Explicitly shut down MCP resources.

Usage

Source

View on GitHub

praisonaiagents/mcp/mcp.py at line 248

MCP Concept

MCP Lifecycle