Skip to content

Conversation

@aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Nov 12, 2025

feat(mcp): Add mcp_smoke_tests_prompt for validating all tools and resources

Summary

Adds a new MCP prompt called mcp_smoke_tests_prompt that provides comprehensive testing instructions for validating all MCP tools and resources in the PyAirbyte MCP server. The prompt:

  • Dynamically discovers all registered MCP tools using the existing get_registered_tools() function
  • Groups tools by domain (cloud, local, registry) for organized testing
  • Supports a read_only parameter (default: True) to filter tools by their read-only status
  • Generates detailed testing instructions including tool testing, resource testing, and report generation guidelines
  • Is registered as an MCP prompt that can be invoked by MCP clients like Claude Desktop

Implementation Details:

  • New file: airbyte/mcp/smoke_tests.py containing the prompt function and registration logic
  • Modified: airbyte/mcp/server.py to import and register the smoke test prompt
  • The prompt generates instructions as text rather than executing tests automatically

Review & Testing Checklist for Human

⚠️ IMPORTANT: Please verify the requirements alignment

  • Confirm this is what you wanted: This PR implements a prompt that provides testing instructions, not an automated test runner. When invoked, it generates a markdown document with step-by-step guidance for manually testing tools. If you wanted an automated test function that actually calls all tools and reports results, please clarify and I can revise the implementation.

  • Test the prompt end-to-end: Invoke the mcp_smoke_tests_prompt through an MCP client (e.g., Claude Desktop) with both read_only=True and read_only=False to verify it generates useful testing instructions

  • Verify read-only filtering: Check that the readOnlyHint annotation filtering correctly identifies all read-only tools. Some tools might be implicitly read-only but not marked as such in their annotations.

  • Resource testing coverage: Note that the prompt provides generic resource testing instructions but doesn't enumerate specific resources (PyAirbyte MCP doesn't appear to have a resource registry like Connector Builder does). Verify this is acceptable or if resource enumeration should be added.

Notes

  • This PR only covers the PyAirbyte MCP server. A separate PR for the Connector Builder MCP server is still pending.
  • The prompt was tested locally to confirm it can be imported and called successfully, returning properly formatted instructions.
  • Lint checks pass for all changes.

Requested by: AJ Steers (aj@airbyte.io / @aaronsteers)
Devin Session: https://app.devin.ai/sessions/1145d85639d849b396b2021ba80433b8

Summary by CodeRabbit

  • New Features
    • Added comprehensive smoke testing capability for validating MCP tools and resources.
    • Supports dual testing modes: read-only tests or comprehensive testing of all available tools.
    • New testing interface organizes tools by domain and provides detailed validation procedures with reporting and expected behavior guidance.

…sources

- Add new smoke_tests.py module with mcp_smoke_tests_prompt function
- Prompt provides comprehensive testing instructions for all MCP tools and resources
- Supports read_only parameter (default: True) to filter tools by read-only status
- Register smoke test prompt in MCP server initialization
- Groups tools by domain and generates detailed testing instructions

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration
Copy link
Contributor

Original prompt from AJ Steers
Received message in Slack channel #ask-devin-ai:

@Devin - In the PyAirbyte MCP server and also in the Connector Builder MCP server, let's add a prompt-based smoke test of all tools. I think we can call this something like `mcp_smoke_tests_prompt` . The prompt will be something like 'run all of your tools and check all of your mcp resource assets to confirm that they all are working properly'. The tool will take a single arg which is 'read_only', defaulting to True.
Thread URL: https://airbytehq-team.slack.com/archives/C08BHPUMEPJ/p1762905441804149

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This PyAirbyte Version

You 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/1762905862-add-mcp-smoke-test-prompt' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1762905862-add-mcp-smoke-test-prompt'

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test-pr - Runs tests with the updated PyAirbyte

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

Comment on lines +54 to +55
"This smoke test will validate that all MCP tools and resources are "
"functioning correctly. ",
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

The PR adds smoke test functionality to the MCP server by introducing a new module that registers a prompt for testing MCP tools. The prompt retrieves registered tools, filters them by read-only status based on annotations, groups them by domain, and generates structured testing instructions.

Changes

Cohort / File(s) Summary
MCP server initialization
airbyte/mcp/server.py
Imports register_smoke_test_prompt and calls it during server setup to register the smoke test prompt with the FastMCP app.
New smoke tests module
airbyte/mcp/smoke_tests.py
Adds mcp_smoke_tests_prompt() that builds a structured markdown prompt for testing registered MCP tools (filtered by read-only status and grouped by domain) and register_smoke_test_prompt() that registers this prompt with the FastMCP app.

Sequence Diagram

sequenceDiagram
    participant ServerInit as Server Initialization
    participant FastMCP
    participant SmokeTestModule as smoke_tests.py
    participant ToolRegistry as Tool Registry

    ServerInit->>SmokeTestModule: register_smoke_test_prompt(app)
    SmokeTestModule->>FastMCP: register prompt "mcp_smoke_tests_prompt"
    
    Note over FastMCP: Prompt registered

    FastMCP->>SmokeTestModule: invoke mcp_smoke_tests_prompt(read_only)
    SmokeTestModule->>ToolRegistry: get_registered_tools()
    ToolRegistry-->>SmokeTestModule: list of tools with annotations
    SmokeTestModule->>SmokeTestModule: filter by readOnlyHint if read_only=True
    SmokeTestModule->>SmokeTestModule: group tools by domain
    SmokeTestModule->>SmokeTestModule: build markdown prompt
    SmokeTestModule-->>FastMCP: return user prompt with testing instructions
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The changes are contained within a new module with clear, single-purpose functions
  • Smoke test logic involves filtering and grouping operations, but no complex control flow
  • Server initialization change is trivial (one import and one function call)
  • One file modified, one file added with contained scope

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a new MCP smoke test prompt function for validating tools and resources, which directly aligns with the changeset additions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1762905862-add-mcp-smoke-test-prompt

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
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte/mcp/smoke_tests.py (1)

117-122: Consider simplifying the description string formatting, wdyt?

The description on lines 119-120 splits the string oddly:

"Run smoke tests on all MCP tools and resources to confirm " "they are working properly"

While valid Python (adjacent strings concatenate), you could simplify it to:

"Run smoke tests on all MCP tools and resources to confirm they are working properly"

or use parentheses if line length is a concern:

(
    "Run smoke tests on all MCP tools and resources to confirm "
    "they are working properly"
)

Just a minor style suggestion!

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 813d0d0 and 492cf31.

📒 Files selected for processing (2)
  • airbyte/mcp/server.py (2 hunks)
  • airbyte/mcp/smoke_tests.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
airbyte/mcp/smoke_tests.py (1)
airbyte/mcp/_tool_utils.py (1)
  • get_registered_tools (85-99)
airbyte/mcp/server.py (1)
airbyte/mcp/smoke_tests.py (1)
  • register_smoke_test_prompt (111-122)
⏰ 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, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (Fast)
🔇 Additional comments (4)
airbyte/mcp/smoke_tests.py (3)

78-82: Generic resource testing instructions noted.

The resource testing section provides generic guidance without discovering actual resources. Based on the PR objectives, this is expected since PyAirbyte MCP doesn't have a resource registry. Just flagging this for visibility in case future enhancements add resource discovery capabilities.


12-108: Nice work on the prompt structure!

The function cleanly generates comprehensive testing instructions with good organization. The domain-based grouping and clear sections make the output very readable. The approach of generating instructions rather than running automated tests aligns well with the PR objectives.


38-41: I'll search for actual tool definitions to verify how readOnlyHint is being used:

Filtering logic is correct per MCP specification; no changes needed.

The MCP specification defines readOnlyHint as an optional boolean annotation that indicates if a tool does not modify its environment, with a default of false when unspecified. The MCP spec specifies that readOnlyHint defaults to false, which is exactly what the filtering logic implements via ann.get("readOnlyHint", False) on line 39.

This design is intentional and correct: tools must explicitly declare readOnlyHint=True to be included in read-only test suites. This follows the principle that tools must opt-in to such categorization rather than being implicitly assumed to be safe. MCP guidance emphasizes being accurate: "Ensure that the annotations truthfully reflect the tool's behavior. Misleading annotations can lead to poor user experiences or safety issues."

The filtering logic aligns with standard MCP tool annotation practices and is not a bug.

airbyte/mcp/server.py (1)

14-14: Clean integration! LGTM.

The import and registration follow the established pattern for other MCP tools. The placement is logical and consistent with the existing code structure.

Also applies to: 26-26

@github-actions
Copy link

PyTest Results (Fast Tests Only, No Creds)

312 tests  ±0   312 ✅ ±0   5m 50s ⏱️ +8s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 492cf31. ± Comparison against base commit 813d0d0.

@github-actions
Copy link

PyTest Results (Full)

381 tests  ±0   364 ✅  - 1   28m 17s ⏱️ + 1m 51s
  1 suites ±0    16 💤 ±0 
  1 files   ±0     1 ❌ +1 

For more details on these failures, see this check.

Results for commit 492cf31. ± Comparison against base commit 813d0d0.

@devin-ai-integration
Copy link
Contributor

CI Failure Analysis

The single failing test test_list_destinations in tests/integration_tests/cloud/test_cloud_api_util.py appears to be unrelated to the MCP smoke test prompt changes in this PR.

Failure Details:

airbyte_api.errors.sdkerror.SDKError: API error occurred: Status 500
{"status":500,"message":"Secret reference 858ddf43-3caa-489f-8a3c-393fb7ad1500 does not exist but is referenced in the config"}

This is a 500 error from the Airbyte Cloud API indicating a missing secret reference in the CI workspace's destination configuration. The failure is environmental and not caused by the code changes in this PR, which only:

  1. Added a new prompt function in airbyte/mcp/smoke_tests.py
  2. Registered the prompt in airbyte/mcp/server.py

Test Results:

  • ✅ All fast tests passed (312/312)
  • ✅ All lint, format, and type checks passed
  • ✅ Python 3.11 Ubuntu tests passed
  • ✅ Windows tests (both 3.10 and 3.11) passed
  • ❌ Only Python 3.10 Ubuntu full test suite hit this Cloud API 500 error

Request:
Could someone with Airbyte Cloud access repair the broken secret reference in the CI workspace, or rerun the "Pytest (All, Python 3.10, Ubuntu)" job to see if this was a transient issue?

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.

2 participants