Skip to content

Update navigation and MCP integration#433

Merged
MervinPraison merged 1 commit intomainfrom
develop
Mar 29, 2025
Merged

Update navigation and MCP integration#433
MervinPraison merged 1 commit intomainfrom
develop

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

@MervinPraison MervinPraison commented Mar 29, 2025

  • Added "MCP" section to mint.json for improved documentation navigation.
  • Integrated environment variable for BRAVE_API_KEY in mcp-npx-brave.py to enhance security and flexibility.
  • Updated search agent prompt for better clarity.

Summary by CodeRabbit

  • Documentation

    • Added comprehensive guides explaining how to integrate Airbnb bookings, Brave Search, and custom server workflows with AI.
    • Updated navigation with a new MCP section for streamlined access to these resources.
  • New Features

    • Introduced AI agents that assist with Airbnb bookings, web searches, and stock price inquiries.
    • Enhanced security by securely retrieving API keys from environment variables.

- Added "MCP" section to `mint.json` for improved documentation navigation.
- Integrated environment variable for `BRAVE_API_KEY` in `mcp-npx-brave.py` to enhance security and flexibility.
- Updated search agent prompt for better clarity.
@MervinPraison MervinPraison merged commit 57c4cf9 into main Mar 29, 2025
3 of 6 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes add new documentation files covering Airbnb, Brave Search, and custom MCP integrations for PraisonAI agents, along with updates to the documentation navigation. New agent scripts have been introduced for processing Airbnb booking requests, Brave Search queries, and stock price checks. These scripts leverage the MCP tool with updated API key handling and simplified command arguments.

Changes

File(s) Change Summary
docs/mcp/{airbnb, bravesearch, custom}.mdx, docs/mint.json Added new documentation files with flowcharts and quick start guides for Airbnb, Brave Search, and custom MCP integrations; updated navigation and topbar links for the MCP group.
src/praisonai-agents/mcp-mini-airbnb.py Introduced an Airbnb booking search agent using MCP integration with a predefined request and "gpt-4o-mini" language model configuration.
src/praisonai-agents/{mcp-mini-bravesearch.py, mcp-npx-brave.py} Added Brave Search agent scripts with MCP integration, enhanced API key retrieval via environment variables, and streamlined search query commands.
src/praisonai-agents/{mcp-npx-mini-airbnb-stockprice.py, mcp-python-stockprice.py} Introduced agents handling both Airbnb bookings and stock price queries through MCP integration, featuring custom command configurations and asynchronous support.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant A as Airbnb Agent
    participant M as MCP (Airbnb)
    participant B as Airbnb Service
    U->>A: Initiate booking request
    A->>M: Send MCP command
    M->>B: Process booking
    B-->>M: Return booking info
    M-->>A: Relay confirmation
    A-->>U: Display booking result
Loading
sequenceDiagram
    participant U as User
    participant A as Brave Search Agent
    participant M as MCP (Brave Search)
    participant S as Brave Search API
    U->>A: Initiate search query
    A->>M: Send MCP command
    M->>S: Query search API
    S-->>M: Return results
    M-->>A: Relay search results
    A-->>U: Display results
Loading
sequenceDiagram
    participant U as User
    participant A as Stock Price Agent
    participant M as MCP (Stock Price)
    participant S as Stock Price Server
    U->>A: Request stock price
    A->>M: Send MCP command
    M->>S: Retrieve stock data
    S-->>M: Return stock price
    M-->>A: Relay info
    A-->>U: Display stock price
Loading

Poem

I'm a coding bunny with a hop and a leap,
Celebrating new features that make agents leap.
Docs and scripts now sing a fresh, clear tune,
With MCP magic under a programming moon.
Cheers to changes, bright as the springtime bloom!
🥕 Hopping through code with a joyful boom!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b6140 and 17f4a5c.

📒 Files selected for processing (9)
  • docs/mcp/airbnb.mdx (1 hunks)
  • docs/mcp/bravesearch.mdx (1 hunks)
  • docs/mcp/custom.mdx (1 hunks)
  • docs/mint.json (2 hunks)
  • src/praisonai-agents/mcp-mini-airbnb.py (1 hunks)
  • src/praisonai-agents/mcp-mini-bravesearch.py (1 hunks)
  • src/praisonai-agents/mcp-npx-brave.py (1 hunks)
  • src/praisonai-agents/mcp-npx-mini-airbnb-stockprice.py (1 hunks)
  • src/praisonai-agents/mcp-python-stockprice.py (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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.

Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request focuses on updating the navigation and integrating Model Context Protocol (MCP) to enhance the functionality of PraisonAI agents. It introduces new documentation pages for Airbnb, Brave Search, and custom Python MCP server integrations. The pull request also includes updates to the mint.json file to reflect these changes in the navigation and incorporates environment variables for API key management in the Brave Search integration.

Highlights

  • Documentation: Adds new documentation pages for Airbnb, Brave Search, and custom Python MCP server integrations, providing guides and examples for users.
  • MCP Integration: Integrates MCP to enable PraisonAI agents to interact with external tools and services like Airbnb and Brave Search.
  • Security: Enhances security by using environment variables for API key management, specifically for the Brave Search integration.
  • Navigation: Updates the mint.json file to include a new "MCP" section in the navigation, improving the discoverability of MCP-related documentation.

Changelog

Click here to see the changelog
  • docs/mcp/airbnb.mdx
    • Created a new documentation page for Airbnb MCP integration, including a quick start guide, features overview, and code examples for integrating Airbnb booking capabilities with PraisonAI agents.
  • docs/mcp/bravesearch.mdx
    • Created a new documentation page for Brave Search MCP integration, including a quick start guide, features overview, and code examples for integrating Brave Search capabilities with PraisonAI agents.
    • Demonstrates how to set the Brave Search API key as an environment variable for enhanced security.
  • docs/mcp/custom.mdx
    • Created a new documentation page for custom Python MCP server integration, including a quick start guide, features overview, and code examples for creating and using custom Python MCP servers with PraisonAI agents.
    • Provides implementation details for the FastMCP class and agent integration.
  • docs/mint.json
    • Added a new "MCP" section to the navigation to improve the discoverability of MCP-related documentation (lines 78-81).
    • Added new entries to the mint.json file to group the new MCP documentation pages under the "MCP" section (lines 237-244).
  • src/praisonai-agents/mcp-mini-airbnb.py
    • Added a minimal example file to demonstrate Airbnb MCP integration.
  • src/praisonai-agents/mcp-mini-bravesearch.py
    • Added a minimal example file to demonstrate Brave Search MCP integration.
  • src/praisonai-agents/mcp-npx-brave.py
    • Updated the Brave Search integration to use environment variables for the API key (lines 4, 6, 14).
    • Simplified the MCP command to use @modelcontextprotocol/server-brave-search directly (line 13).
    • Updated the search agent prompt to search for "AI News" instead of "Praison AI" (line 18).
  • src/praisonai-agents/mcp-npx-mini-airbnb-stockprice.py
    • Added a minimal example file to demonstrate Airbnb and Stockprice MCP integration.
  • src/praisonai-agents/mcp-python-stockprice.py
    • Added a minimal example file to demonstrate Python Stockprice MCP integration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


In realms of code, where agents roam,
MCP guides them, bringing tools home.
From Airbnb's listings to Brave's keen search,
AI's potential, within our grasp, we beseech.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 29, 2025

Deploy Preview for praisonai ready!

Name Link
🔨 Latest commit 17f4a5c
🔍 Latest deploy log https://app.netlify.com/sites/praisonai/deploys/67e8478782b9360008e33049
😎 Deploy Preview https://deploy-preview-433--praisonai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Contributor

@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 new documentation for integrating PraisonAI agents with Model Context Protocol (MCP) servers, including Airbnb, Brave Search, and custom Python implementations. It also updates the navigation in mint.json to include an MCP section. The use of environment variables for API keys is a good security practice. Overall, the changes seem well-structured and provide useful guidance for users.

Summary of Findings

  • API Key Security: The use of environment variables for API keys is a good practice, but the example code in brave_search.py includes a default API key. This could lead to unintentional exposure if users don't replace it with their own key.
  • Path Hardcoding: The custom Python MCP server example in custom.mdx and mcp-python-stockprice.py includes hardcoded paths to the Python interpreter and app.py file. This makes the example less portable and requires users to modify the code to match their environment.
  • Inconsistent Agent Prompt: The agent prompt in mcp-npx-brave.py was updated from 'Praison AI' to 'AI News'. It would be useful to understand the reasoning behind this change and ensure consistency across all examples.

Merge Readiness

The pull request introduces valuable documentation and examples for MCP integration. However, the potential security risk of the default API key in the Brave Search example and the hardcoded paths in the custom Python MCP example should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. I would recommend that the pull request not be merged until the high severity issues are addressed.

Comment thread docs/mcp/bravesearch.mdx
Comment on lines +42 to +43
# Use the API key from environment or set it directly
brave_api_key = os.getenv("BRAVE_API_KEY") or "your_brave_api_key_here"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

While using environment variables is great, providing a default value directly in the code can be a security risk. It's better to force users to explicitly set the environment variable to avoid accidental exposure of the API key. Consider raising an error if the environment variable is not set.

        # Use the API key from environment or set it directly
        brave_api_key = os.getenv("BRAVE_API_KEY")
        if not brave_api_key:
            raise ValueError("BRAVE_API_KEY environment variable must be set.")

import os

# Use the API key from environment or set it directly
brave_api_key = os.getenv("BRAVE_API_KEY") or "BSAbRwmwE-WV_7gKR1ZZIdE2Twa0l4w"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Including a default API key directly in the code is a security risk. It's better to force users to explicitly set the environment variable to avoid accidental exposure of the API key. Consider raising an error if the environment variable is not set.

Suggested change
brave_api_key = os.getenv("BRAVE_API_KEY") or "BSAbRwmwE-WV_7gKR1ZZIdE2Twa0l4w"
brave_api_key = os.getenv("BRAVE_API_KEY")
if not brave_api_key:
raise ValueError("BRAVE_API_KEY environment variable must be set.")

Comment thread docs/mcp/custom.mdx
Comment on lines +80 to +81
tools = MCP("/path/to/python /path/to/app.py")
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding the path to the Python interpreter and the app.py file makes this example less portable. It would be better to use relative paths or environment variables to specify these locations.

        agent = Agent(
            instructions="""You are a helpful assistant that can check stock prices and perform other tasks.
            Use the available tools when relevant to answer user questions.""",
            llm="gpt-4o-mini",
            tools = MCP("python app.py")
        )

)

search_agent.start("Search more information about Praison AI") No newline at end of file
search_agent.start("Search more information about AI News") No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The prompt was changed from 'Praison AI' to 'AI News'. Can you explain the reasoning behind this change? It would be good to ensure consistency across all examples.

Suggested change
search_agent.start("Search more information about AI News")
search_agent.start("Search more information about Praison AI")

instructions="""You are a helpful assistant that can check stock prices and perform other tasks.
Use the available tools when relevant to answer user questions.""",
llm="gpt-4o-mini",
tools = MCP("/Users/praison/miniconda3/envs/mcp/bin/python /Users/praison/stockprice/app.py")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding the path to the Python interpreter and the app.py file makes this example less portable. It would be better to use relative paths or environment variables to specify these locations.

Suggested change
tools = MCP("/Users/praison/miniconda3/envs/mcp/bin/python /Users/praison/stockprice/app.py")
tools = MCP("python app.py")

@coderabbitai coderabbitai bot mentioned this pull request Apr 1, 2025
shaneholloman pushed a commit to shaneholloman/praisonai that referenced this pull request Feb 4, 2026
Update navigation and MCP integration
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.

1 participant