docs: Update MCP docs for client lifecycle changes#482
Conversation
- Mark OAuth as experimental with warning in mcp-oauth.mdx - Fix canonical paths in cli/mcp.mdx and document remote server support - Update mcp-remote.mdx with OAuth warnings and CLI references - Add new feature pages in docs/features/: * load-mcp-tools.mdx - new agent-centric API * mcp-tool-filtering.mdx - allowed_tools/disabled_tools filtering * mcp-client-protocol.mdx - MCPClientProtocol interface * mcp-yaml-config.mdx - YAML configuration examples - Update docs.json navigation to include new pages under Features group - All pages follow AGENTS.md standards with Mermaid diagrams, agent-centric examples, and Mintlify components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 3 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive documentation for Model Context Protocol (MCP) features, including loading MCP tools, client protocols, tool filtering, YAML configuration, and OAuth support. The review feedback highlights several issues in the documentation's code examples, such as incorrect workspace paths, missing imports (like MCPConfig and Agent), incomplete protocol implementations for custom clients, and a potential TypeError when passing allowed_tools directly to the MCP constructor.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| |----------|-------|-------------| | ||
| | `.praison/mcp/` | Workspace | Project-specific configs | | ||
| | `~/.praisonai/mcp/` | Global | Shared across all projects | | ||
| | `~/.praisonai/mcp/` | Workspace | Project-specific configs | |
There was a problem hiding this comment.
The path ~/.praisonai/mcp/ is listed under the Workspace scope (Project-specific configs). However, the ~ prefix refers to the user's home directory, which is global. For project-specific (Workspace) configs, the path should be relative to the project root, such as .praisonai/mcp/ or ./.praisonai/mcp/.
| .praisonai/mcp/ | Workspace | Project-specific configs |
| from praisonaiagents import Agent | ||
| from praisonaiagents.mcp import load_mcp_tools | ||
| from praisonai.cli.configuration import get_config_loader | ||
|
|
||
| # Load from wrapper TOML config | ||
| loader = get_config_loader() | ||
| config = loader.load() | ||
| toml_configs = [MCPConfig(...) for server in config.mcp.servers] |
There was a problem hiding this comment.
The code example uses MCPConfig but does not import it, which will result in a NameError when executed. Please add MCPConfig to the imports from praisonaiagents.mcp.
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools, MCPConfig
from praisonai.cli.configuration import get_config_loader
# Load from wrapper TOML config
loader = get_config_loader()
config = loader.load()
toml_configs = [MCPConfig(...) for server in config.mcp.servers]
| ```python | ||
| import httpx | ||
| from typing import Any, Dict, List |
There was a problem hiding this comment.
The code example uses Agent at the end but does not import it. Please add from praisonaiagents import Agent to the imports at the top of the code block to make it fully runnable.
import httpx
from typing import Any, Dict, List
from praisonaiagents import Agent
from praisonaiagents.mcp import MCPClientProtocol
| class DatabaseMCPClient: | ||
| def __init__(self, database_path: str): | ||
| self.db_path = database_path | ||
|
|
||
| def list_tools(self) -> List[Dict[str, Any]]: | ||
| return [ | ||
| { | ||
| "name": "query_database", | ||
| "description": "Execute SQL query on database", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "sql": {"type": "string"} | ||
| }, | ||
| "required": ["sql"] | ||
| } | ||
| } | ||
| ] | ||
|
|
||
| def call_tool(self, name: str, args: Dict[str, Any]) -> Any: | ||
| if name == "query_database": | ||
| with sqlite3.connect(self.db_path) as conn: | ||
| cursor = conn.cursor() | ||
| cursor.execute(args["sql"]) | ||
| return cursor.fetchall() | ||
| ``` |
There was a problem hiding this comment.
The DatabaseMCPClient class does not implement the get_tools() and shutdown() methods, which are required by the MCPClientProtocol interface (as shown in the MinimalMCPClient definition). Please add these methods to ensure full protocol compliance.
class DatabaseMCPClient:
def __init__(self, database_path: str):
self.db_path = database_path
def list_tools(self) -> List[Dict[str, Any]]:
return [
{
"name": "query_database",
"description": "Execute SQL query on database",
"inputSchema": {
"type": "object",
"properties": {
"sql": {"type": "string"}
},
"required": ["sql"]
}
}
]
def get_tools(self) -> List[Dict[str, Any]]:
return self.list_tools()
def call_tool(self, name: str, args: Dict[str, Any]) -> Any:
if name == "query_database":
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute(args["sql"])
return cursor.fetchall()
def shutdown(self) -> None:
pass
| class MockMCPClient: | ||
| def __init__(self, mock_tools: Dict[str, Any]): | ||
| self.mock_tools = mock_tools | ||
|
|
||
| def list_tools(self) -> List[Dict[str, Any]]: | ||
| return [ | ||
| {"name": name, "description": f"Mock tool {name}"} | ||
| for name in self.mock_tools.keys() | ||
| ] | ||
|
|
||
| def call_tool(self, name: str, args: Dict[str, Any]) -> Any: | ||
| return self.mock_tools.get(name, f"Mock result for {name}") | ||
|
|
There was a problem hiding this comment.
Similar to DatabaseMCPClient, the MockMCPClient class is missing the required get_tools() and shutdown() methods from the MCPClientProtocol interface. Please add them to make the mock client fully compliant.
class MockMCPClient:
def __init__(self, mock_tools: Dict[str, Any]):
self.mock_tools = mock_tools
def list_tools(self) -> List[Dict[str, Any]]:
return [
{"name": name, "description": f"Mock tool {name}"}
for name in self.mock_tools.keys()
]
def get_tools(self) -> List[Dict[str, Any]]:
return self.list_tools()
def call_tool(self, name: str, args: Dict[str, Any]) -> Any:
return self.mock_tools.get(name, f"Mock result for {name}")
def shutdown(self) -> None:
pass
| tools=MCP( | ||
| "npx -y @modelcontextprotocol/server-filesystem /tmp", | ||
| allowed_tools=["read_file", "list_directory"], | ||
| ), |
There was a problem hiding this comment.
Passing allowed_tools directly to the MCP constructor will raise a TypeError because MCP.__init__ passes all **kwargs directly to StdioServerParameters, which does not accept allowed_tools. Please ensure that the MCP class is updated to support these parameters, or update the documentation to reflect the correct usage.
| # multi-tool-agent.yaml | ||
| agent: | ||
| name: developer_assistant | ||
| instructions: | | ||
| You are a developer assistant with access to: | ||
| - Filesystem operations (read, write, list files) | ||
| - Time and date utilities | ||
| - Web search capabilities |
There was a problem hiding this comment.
The code example uses MCPConfig but does not import it, which will result in a NameError when executed. Please add MCPConfig to the imports from praisonaiagents.mcp.
from praisonaiagents import Agent
from praisonaiagents.mcp import load_mcp_tools, MCPConfig
from praisonai.cli.configuration import get_config_loader
# Load from wrapper TOML config
loader = get_config_loader()
config = loader.load()
toml_configs = [MCPConfig(...) for server in config.mcp.servers]
Fixes #480
This PR updates MCP documentation following PraisonAI PR #1777 client lifecycle changes.
Changes Made
Updated Existing Pages
New Feature Pages (docs/features/)
Navigation Updates
Features Documented
All documentation follows AGENTS.md standards with:
Generated with Claude Code