-
Notifications
You must be signed in to change notification settings - Fork 71
feat: add MCP server instructions for tool search support #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: AJ Steers <[email protected]>
Original prompt from AJ Steers |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1768432632-add-server-instructions' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1768432632-add-server-instructions'Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
Community SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
📝 WalkthroughWalkthroughA new constant Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@airbyte/mcp/server.py`:
- Around line 31-37: Update the server description to remove the incorrect
"managing" claim and state that environment variables are only discoverable:
change the bullet "Listing and managing environment variables for connector
configuration" to "Listing environment variables for connector configuration"
(or similar), and ensure any mentions near list_dotenv_secrets() and
list_connector_config_secrets() reflect that these functions are read-only and
do not modify variables.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
airbyte/mcp/server.py
🧰 Additional context used
🧬 Code graph analysis (1)
airbyte/mcp/server.py (2)
airbyte/_util/meta.py (1)
set_mcp_mode(40-51)airbyte/mcp/_util.py (1)
initialize_secrets(55-88)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Pytest (All, Python 3.10, Ubuntu)
- GitHub Check: Pytest (All, Python 3.11, Ubuntu)
- GitHub Check: Pytest (All, Python 3.10, Windows)
- GitHub Check: Pytest (Fast)
- GitHub Check: Pytest (All, Python 3.11, Windows)
- GitHub Check: Pytest (No Creds)
🔇 Additional comments (3)
airbyte/mcp/server.py (3)
17-25: Nice documentation block!The explanatory comments with links to FastMCP docs and Claude tool search context are a nice touch for future maintainers. This makes it clear why this constant exists and how it's intended to be used.
45-49: Safety features are correctly implemented ✓Good thinking on double-checking! Both features are indeed implemented as described:
- Safe mode uses
AIRBYTE_CLOUD_MCP_SAFE_MODE(default enabled) to track GUIDs created in the current session via_GUIDS_CREATED_IN_SESSION, raisingSafeModeErrorwhen attempting destructive operations on objects created outside the session.- Read-only mode uses
AIRBYTE_CLOUD_MCP_READONLY_MODEto filter tool registration, allowing only read-only Cloud tools when enabled.The descriptions are accurate. No changes needed!
54-54: Clean integration with FastMCP!The change is spot-on — the
instructionsparameter is fully supported in FastMCP's constructor, so passingMCP_SERVER_INSTRUCTIONShere is exactly the right approach. This is a clean, minimal implementation that wires your server instructions into FastMCP as intended.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@airbyte/mcp/server.py`:
- Around line 27-49: The instructions string MCP_SERVER_INSTRUCTIONS currently
uses the generic phrase "Managing custom connector definitions in Airbyte Cloud"
but the code only implements custom source definition operations
(publish_custom_source_definition, update_custom_source_definition,
permanently_delete_custom_source_definition); update the wording to explicitly
say "custom source connector definitions" or, if you intend to support
destinations, implement and reference equivalent functions for custom
destination definitions and then keep the generic phrasing. Ensure you change
the MCP_SERVER_INSTRUCTIONS text to reflect whichever path you choose.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
airbyte/mcp/server.py
🧰 Additional context used
🧬 Code graph analysis (1)
airbyte/mcp/server.py (2)
airbyte/_util/meta.py (1)
set_mcp_mode(40-51)airbyte/mcp/_util.py (1)
initialize_secrets(55-88)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: update-description
- GitHub Check: Pytest (All, Python 3.11, Ubuntu)
- GitHub Check: Pytest (All, Python 3.10, Windows)
- GitHub Check: Pytest (All, Python 3.11, Windows)
- GitHub Check: Pytest (All, Python 3.10, Ubuntu)
- GitHub Check: Pytest (No Creds)
- GitHub Check: Pytest (Fast)
🔇 Additional comments (2)
airbyte/mcp/server.py (2)
17-25: Nice documentation header!This comment block provides excellent context for maintainers, explaining both the purpose of the instructions and linking to relevant documentation. This will help future contributors understand why this constant exists and how it's used in the MCP protocol. 👍
54-55: Clean integration with FastMCP constructor.The
instructionsparameter is correctly passed to the FastMCP constructor. FastMCP >=2.11.3 fully supports this parameter for server metadata exposure, and the implementation looks solid.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Summary
Adds server-level instructions to the PyAirbyte MCP server to support Claude's new tool search feature. When AI agents have many tools available, tool search helps them find the right tools by searching tool descriptions. The server instructions field provides high-level guidance about when to use this server's tools.
Background context:
Changes:
MCP_SERVER_INSTRUCTIONSconstant inserver.pydescribing the server's purpose and capabilitiesFastMCPconstructor to pass instructions parameterReview & Testing Checklist for Human
Suggested test plan: After merging, test with Claude Code or another MCP client that supports tool search to verify the server instructions are properly exposed and help with tool discovery.
Notes
This is part of a broader effort to add server instructions to all Airbyte MCP servers. The instruction text should be reviewed and refined by humans familiar with the server's capabilities.
Requested by: @aaronsteers
Devin session: https://app.devin.ai/sessions/5de868a97624482b9119920b7efb8612
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.
Note
Auto-merge may have been disabled. Please check the PR status to confirm.