Repository Public
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : API Atlas8# File : examples/xai/tools/mcp/deepwiki.sh9# Module : examples10# Repository : https://git.spboucher.ai/doc-api11# Created : 2026-09-1912# Last Modified : 2026-09-1913#14# Author : Simon-Pierre Boucher15# Position : Professor of Finance16# Institution : Université du Québec en Outaouais (UQO)17# Organization : SP Boucher18# Website : https://spboucher.ai19# Git : https://git.spboucher.ai20#21# Preferred Contact: contact@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940# STATUS: LIVE_VERIFIED — executed 2026-09-19 (exit 0 in 43.4s)41# Remote MCP via curl.42set -euo pipefail43cd "$(dirname "$0")/../../../.."44source scripts/lib.sh45T=$(mktemp); trap 'rm -f "$T"' EXIT46xai POST /v1/responses -m 300 -d '{"model":"grok-4.3","store":false,"max_output_tokens":4000,"max_turns":3,"input":"Using the deepwiki tool, what does the xai-org/xai-sdk-python repo do? Max 10 words.","tools":[{"type":"mcp","server_url":"https://mcp.deepwiki.com/mcp","server_label":"deepwiki"}]}' > "$T"47log_request xai POST /v1/responses "$XAI_STATUS" 0.02 "example xai/tools/mcp/deepwiki.sh"48mask < "$T" | python3 -c 'import json,sys; r=json.load(sys.stdin); print([(o["type"], o.get("name")) for o in r["output"]]); print(next(c["text"] for o in r["output"] if o["type"]=="message" for c in o["content"]))'49[ "$XAI_STATUS" = "200" ]50