Skip to content

docs: Update MCP docs for client lifecycle changes#482

Merged
MervinPraison merged 1 commit into
mainfrom
claude/issue-480-20260602-1351
Jun 3, 2026
Merged

docs: Update MCP docs for client lifecycle changes#482
MervinPraison merged 1 commit into
mainfrom
claude/issue-480-20260602-1351

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

Fixes #480

This PR updates MCP documentation following PraisonAI PR #1777 client lifecycle changes.

Changes Made

Updated Existing Pages

  • mcp-oauth.mdx - Added experimental warning with status table
  • cli/mcp.mdx - Fixed canonical storage paths, documented remote server support
  • mcp-remote.mdx - Added OAuth warnings and CLI cross-references

New Feature Pages (docs/features/)

  • load-mcp-tools.mdx - New agent-centric API for loading MCP tools
  • mcp-tool-filtering.mdx - Documentation for allowed_tools/disabled_tools filtering
  • mcp-client-protocol.mdx - MCPClientProtocol interface for extensibility
  • mcp-yaml-config.mdx - YAML configuration examples and patterns

Navigation Updates

  • Added new pages to docs.json under Features > Integrations group
  • All pages follow AGENTS.md standards

Features Documented

  • OAuth marked as experimental (placeholder tokens only)
  • Canonical ~/.praisonai/mcp/ storage paths
  • Remote server testing (mcp test/sync commands)
  • load_mcp_tools() helper function
  • Tool filtering (whitelist/blacklist)
  • MCPClientProtocol extensibility
  • YAML MCP server configuration

All documentation follows AGENTS.md standards with:

  • Agent-centric Quick Start examples
  • Mermaid diagrams with standard color scheme (#8B0000, #189AB4, #fff)
  • Mintlify components (Steps, AccordionGroup, CardGroup)
  • Copy-paste runnable code examples

Generated with Claude Code

- 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-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Warning

Review limit reached

@MervinPraison, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7827267a-fe7f-4cae-a823-f7971cf3dffe

📥 Commits

Reviewing files that changed from the base of the PR and between aa7ace5 and 125a52a.

📒 Files selected for processing (8)
  • docs.json
  • docs/cli/mcp.mdx
  • docs/features/load-mcp-tools.mdx
  • docs/features/mcp-client-protocol.mdx
  • docs/features/mcp-tool-filtering.mdx
  • docs/features/mcp-yaml-config.mdx
  • docs/mcp/mcp-oauth.mdx
  • docs/mcp/mcp-remote.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-480-20260602-1351

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/cli/mcp.mdx
|----------|-------|-------------|
| `.praison/mcp/` | Workspace | Project-specific configs |
| `~/.praisonai/mcp/` | Global | Shared across all projects |
| `~/.praisonai/mcp/` | Workspace | Project-specific configs |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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 |

Comment on lines +138 to +145
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]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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]

Comment on lines +103 to +105
```python
import httpx
from typing import Any, Dict, List
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Comment on lines +214 to +239
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()
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Comment on lines +246 to +258
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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

Comment on lines +44 to +47
tools=MCP(
"npx -y @modelcontextprotocol/server-filesystem /tmp",
allowed_tools=["read_file", "list_directory"],
),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +138 to +145
# 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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]

@MervinPraison MervinPraison merged commit fd14649 into main Jun 3, 2026
30 checks passed
@MervinPraison MervinPraison deleted the claude/issue-480-20260602-1351 branch June 3, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Update MCP docs for client lifecycle changes (PR #1777 in PraisonAI)

1 participant