MYAI168 MCP 是把本站對話模型包裝成 MCP(Model Context Protocol) 伺服器的對外端點,讓支援 MCP 的用戶端把本站模型當成「工具(tool)」直接呼叫,不需要開瀏覽器。本頁說明用開發者金鑰(dev_key)從指令列/程式連線(Claude Code、mcp-remote 或自寫程式);傳輸採 Streamable HTTP(JSON-RPC 2.0),每次呼叫成功會自動扣點數,發生任何錯誤一律不扣點。
若你用的是 Claude.ai 等只能填網址、需用 OAuth 授權的網頁或應用程式用戶端,請改看「MYAI168 MCP 網頁及應用程式」分頁(免開發者金鑰)。
開發者金鑰取得網址:https://www.myai168.com/tw/ai/user/developer
https://www.myai168.com/tw/mcp/(請保留結尾斜線)。POST 送 JSON-RPC 2.0 內容。Authorization: Bearer YOUR_DEV_KEY(每次請求都必帶)。本站每個已開通的 AI 模組都各對應一個工具(聊天、影像、影片、語音、工具類等);完整清單請以 tools/list 查詢,會依本站開通狀況動態回傳。所有工具參數相同:input(必填,要送給模組的問題、指令或內容)、search_internet(選填,設為 true 且該模組支援時,先上網搜尋再回答)。
常見工具範例:
claude_opus_4_8 — Anthropic Claude Opus 4.8chatgpt_5_5 — OpenAI GPT-5.5gemini_3_5_flash — Google Gemini 3.5 Flash工具名稱即模組代號(含「.」者以「_」取代,例 qwen3.5_397b_a17b → qwen3_5_397b_a17b)。部分需上傳檔案的模組(如圖片轉提示詞、PDF 對話、語音辨識)目前以純文字介面呼叫;實際可用的模組依本站開通狀況而定。
以 Claude Code CLI 為例(單行指令):
claude mcp add --transport http myai168 https://www.myai168.com/tw/mcp/ --header "Authorization: Bearer YOUR_DEV_KEY"
或在支援 MCP 的用戶端設定檔(mcp-remote)填入:
{
"mcpServers": {
"myai168": {
"command": "npx",
"args": ["mcp-remote", "https://www.myai168.com/tw/mcp/", "--header", "Authorization: Bearer YOUR_DEV_KEY"]
}
}
}
列出可用工具(需開發者金鑰):
curl -s https://www.myai168.com/tw/mcp/ -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_DEV_KEY" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
呼叫模型(需開發者金鑰):
curl -s https://www.myai168.com/tw/mcp/ -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_DEV_KEY" -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"claude_opus_4_8","arguments":{"input":"你好,請自我介紹"}}}'
列出可用工具(需開發者金鑰):
import requests
url = "https://www.myai168.com/tw/mcp/"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_DEV_KEY",
}
payload = {"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
r = requests.post(url, headers=headers, json=payload)
for tool in r.json()["result"]["tools"]:
print(tool["name"], "-", tool.get("description", ""))
呼叫模型(需開發者金鑰):
import requests
url = "https://www.myai168.com/tw/mcp/"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_DEV_KEY",
}
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "claude_opus_4_8",
"arguments": {"input": "你好,請自我介紹"},
},
}
r = requests.post(url, headers=headers, json=payload)
data = r.json()
print(data["result"]["content"][0]["text"])
回應為單一 JSON-RPC 結果(Content-Type: application/json)。模型答案在 result.content[0].text;本次扣點與剩餘點數放在 result._meta。發生模型錯誤時 result.isError 為 true。
計費:每次成功呼叫依模型計價自動扣點數;若發生任何錯誤一律不扣點。點數不足時會回覆提示,不會呼叫模型。