-
Notifications
You must be signed in to change notification settings - Fork 4
Doc 1846: Remote MCP GA #472
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
Changes from 50 commits
9afebbd
0795b78
4af7395
196fd9e
ae615e9
2fae2f8
6fafd4d
bb13636
86fd22f
4e002c7
1762040
5dea823
cfdb632
e293ede
b7a0a61
c1f9e53
194f52f
5ba5218
2ac3688
d77ef3d
19fcd2e
e98b2d9
294cf1c
fc4b688
6c38dcd
2c4e0cd
1c724c2
9f55377
b40d095
d43c0d4
7c282da
c440a3c
96348ff
482be19
3a665a5
12be320
efb6611
f64a6c6
473015b
d6f4da6
0d5d6fa
520f5c0
b970ed7
f370b41
665ea67
d5d30e3
d91266b
e9cd68d
a9ec8ce
721e322
fef4dc0
24a0f37
6eb42b3
3940445
7904d44
f404c42
0403bd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Test MCP Examples | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'modules/ai-agents/examples/**/*.yaml' | ||
| - 'modules/ai-agents/examples/test-mcp-examples.sh' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'modules/ai-agents/examples/**/*.yaml' | ||
| - 'modules/ai-agents/examples/test-mcp-examples.sh' | ||
|
|
||
| jobs: | ||
| test-all-examples: | ||
| name: Test All MCP Examples | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install npm dependencies | ||
| run: npm install | ||
|
|
||
| - name: Install doc-tools dependencies | ||
| run: npx --no-install doc-tools install-test-dependencies | ||
|
|
||
| - name: Install yq | ||
| run: | | ||
| sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 | ||
| sudo chmod +x /usr/local/bin/yq | ||
|
|
||
| - name: Make test script executable | ||
| run: chmod +x modules/ai-agents/examples/test-mcp-examples.sh | ||
|
|
||
| - name: Run MCP examples tests | ||
| run: | | ||
| cd modules/ai-agents/examples | ||
| ./test-mcp-examples.sh | ||
|
|
||
| - name: Test Summary | ||
| if: always() | ||
| run: | | ||
| echo "::notice title=MCP Examples Testing::All Cloud MCP examples have been validated" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ jobs: | |
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| node-version: '22' | ||
|
|
||
| - run: npm install | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ build/_redirects | |
| poc-docs/ | ||
| docs/ | ||
| .docusaurus | ||
| .env | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ content: | |
| branches: main | ||
| start_paths: [docs,'*/docs'] | ||
| - url: https://github.com/redpanda-data/rp-connect-docs | ||
| branches: main | ||
| branches: single-source | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reminder |
||
| ui: | ||
| bundle: | ||
| url: https://github.com/redpanda-data/docs-ui/releases/latest/download/ui-bundle.zip | ||
|
|
@@ -37,6 +37,7 @@ asciidoc: | |
| - '@redpanda-data/docs-extensions-and-macros/macros/config-ref' | ||
| - '@redpanda-data/docs-extensions-and-macros/macros/helm-ref' | ||
| - '@redpanda-data/docs-extensions-and-macros/asciidoc-extensions/add-line-numbers-highlights' | ||
| - '@redpanda-data/docs-extensions-and-macros/macros/badge' | ||
| antora: | ||
| extensions: | ||
| - require: '@redpanda-data/docs-extensions-and-macros/extensions/generate-rp-connect-info' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| redpanda: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this work? in MCP there must be one component at the root IIRC
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah outputs and inputs can have individual processors too |
||
| seed_brokers: [ "${REDPANDA_BROKERS}" ] | ||
| topic: "llm-responses" | ||
| tls: | ||
| enabled: true | ||
| sasl: | ||
| - mechanism: "${REDPANDA_SASL_MECHANISM}" | ||
| username: "${REDPANDA_SASL_USERNAME}" | ||
| password: "${REDPANDA_SASL_PASSWORD}" | ||
|
|
||
| processors: | ||
| - openai_chat_completion: | ||
| api_key: "${secrets.OPENAI_API_KEY}" | ||
| model: "gpt-4" | ||
| prompt: ${! json("question") } | ||
| - mapping: | | ||
| root.question = this.question | ||
| root.answer = this.content | ||
| root.timestamp = now().ts_format("2006-01-02T15:04:05Z07:00") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Automated testing script for Redpanda Connect MCP examples | ||
| # | ||
| # Usage: | ||
| # ./test-mcp-examples.sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Colors for output | ||
| RED='\033[0;31m' | ||
| GREEN='\033[0;32m' | ||
| YELLOW='\033[1;33m' | ||
| BLUE='\033[0;34m' | ||
| NC='\033[0m' | ||
|
|
||
| # Counters | ||
| TOTAL=0 | ||
| SKIPPED=0 | ||
| MCP_FAILS=0 | ||
|
|
||
| echo "🧪 Redpanda Connect MCP Examples Test Suite" | ||
| echo "============================================" | ||
| echo "" | ||
|
|
||
| # Run MCP server lint on the directory | ||
| echo "Running rpk connect mcp-server lint..." | ||
| LINT_OUTPUT=$(rpk connect mcp-server lint --skip-env-var-check --verbose 2>&1) || { | ||
| echo -e "${RED}❌ Linting failed${NC}" | ||
| echo "" | ||
| echo "$LINT_OUTPUT" | ||
| exit 1 | ||
| } | ||
| echo -e "${GREEN}✅ Linting passed${NC}" | ||
| echo "" | ||
|
|
||
| # Function to validate MCP metadata | ||
| validate_mcp_metadata() { | ||
| local file=$1 | ||
|
|
||
| echo -n " Validating MCP metadata... " | ||
|
|
||
| # Determine which YAML parser to use | ||
| local use_yq=true | ||
| if ! command -v yq &> /dev/null; then | ||
| use_yq=false | ||
| if ! command -v python3 &> /dev/null; then | ||
| echo -e "${RED}FAILED${NC} (neither yq nor python3 available)" | ||
| MCP_FAILS=$((MCP_FAILS + 1)) | ||
| return 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Check if .meta.mcp exists | ||
| local mcp_exists | ||
| if $use_yq; then | ||
| mcp_exists=$(yq eval '.meta.mcp' "$file" 2>/dev/null) | ||
| else | ||
| mcp_exists=$(python3 -c " | ||
| import yaml | ||
| try: | ||
| with open('$file') as f: | ||
| doc = yaml.safe_load(f) | ||
| meta = doc.get('meta', {}) if doc else {} | ||
| mcp = meta.get('mcp') | ||
| print('null' if mcp is None else 'exists') | ||
| except: | ||
| print('null') | ||
| " 2>/dev/null) | ||
| fi | ||
|
|
||
| if [[ "$mcp_exists" == "null" || -z "$mcp_exists" ]]; then | ||
| echo -e "${YELLOW}SKIPPED${NC} (no MCP metadata)" | ||
| SKIPPED=$((SKIPPED + 1)) | ||
| return 0 | ||
| fi | ||
|
|
||
| # Read .meta.mcp.enabled | ||
| local enabled | ||
| if $use_yq; then | ||
| enabled=$(yq eval '.meta.mcp.enabled' "$file" 2>/dev/null) | ||
| else | ||
| enabled=$(python3 -c " | ||
| import yaml | ||
| try: | ||
| with open('$file') as f: | ||
| doc = yaml.safe_load(f) | ||
| enabled = doc.get('meta', {}).get('mcp', {}).get('enabled') | ||
| print('null' if enabled is None else str(enabled).lower()) | ||
| except: | ||
| print('null') | ||
| " 2>/dev/null) | ||
| fi | ||
|
|
||
| if [[ "$enabled" != "true" ]]; then | ||
| echo -e "${YELLOW}WARNING${NC} (mcp.enabled not set to true)" | ||
| return 0 | ||
| fi | ||
|
|
||
| # Read .meta.mcp.description | ||
| local description | ||
| if $use_yq; then | ||
| description=$(yq eval '.meta.mcp.description' "$file" 2>/dev/null) | ||
| else | ||
| description=$(python3 -c " | ||
| import yaml | ||
| try: | ||
| with open('$file') as f: | ||
| doc = yaml.safe_load(f) | ||
| desc = doc.get('meta', {}).get('mcp', {}).get('description') | ||
| print('null' if desc is None or desc == '' else str(desc)) | ||
| except: | ||
| print('null') | ||
| " 2>/dev/null) | ||
| fi | ||
|
|
||
| if [[ "$description" == "null" || -z "$description" ]]; then | ||
| echo -e "${RED}FAILED${NC} (missing description)" | ||
| MCP_FAILS=$((MCP_FAILS + 1)) | ||
| return 1 | ||
| fi | ||
|
|
||
| echo -e "${GREEN}PASSED${NC}" | ||
| return 0 | ||
| } | ||
|
JakeSCahill marked this conversation as resolved.
|
||
|
|
||
| # Validate MCP metadata for each file | ||
| for file in *.yaml; do | ||
| if [[ -f "$file" ]]; then | ||
| TOTAL=$((TOTAL + 1)) | ||
| echo "" | ||
| echo -e "${BLUE}📄 Validating: $file${NC}" | ||
| validate_mcp_metadata "$file" | ||
| fi | ||
| done | ||
|
|
||
| # Summary | ||
| echo "" | ||
| echo "============================================" | ||
| echo "📊 Test Summary" | ||
| echo "============================================" | ||
| echo "Total configs tested: $TOTAL" | ||
| if [[ $MCP_FAILS -gt 0 ]]; then | ||
| echo -e "MCP validation failures: ${RED}$MCP_FAILS${NC}" | ||
| fi | ||
| if [[ $SKIPPED -gt 0 ]]; then | ||
| echo -e "Skipped: ${YELLOW}$SKIPPED${NC}" | ||
| fi | ||
| echo "" | ||
|
|
||
| if [[ $MCP_FAILS -gt 0 ]]; then | ||
| echo -e "${RED}❌ Some tests failed${NC}" | ||
| exit 1 | ||
| else | ||
| echo -e "${GREEN}✅ All tests passed!${NC}" | ||
| exit 0 | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.