IBM watsonx.ai Granite

io.github.nirholas由 GitHub 帳號 nirholas 發布v0.2.2更新於 Oct 24, 2026

IBM watsonx.ai MCP by three.ws: chat, text generation, embeddings, and tokenization.

發布方自己的服務:Granite

已驗證STDIO僅桌面資料與分析AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理呼叫 IBM watsonx.ai Granite 模型進行對話、文字生成、向量嵌入、分詞與預測。

可以做什麼
使用 watsonx.ai 基礎模型進行對話與文字生成,支援解碼參數並回傳 token 用量。為最多 1000 段文字批次產生嵌入向量。依模型分詞器計算 token 數量,並可選擇回傳 token 清單。對帶時間戳的數值序列執行零樣本時間序列預測。列出帳戶與區域可用的基礎模型,可依功能篩選。
適用情境
當你已有開通 watsonx.ai 的 IBM Cloud 帳戶,希望助理直接呼叫 Granite 模型完成對話、生成、嵌入、token 計數或短期預測,而不經過中介服務時使用。
執行需求
透過 npx 在本機執行,需要 Node.js 20 或更新版本。需要已開通 watsonx.ai 的 IBM Cloud 帳戶,在 WATSONX_API_KEY 提供 IBM Cloud API 金鑰,並在 WATSONX_PROJECT_ID 提供專案 ID,或在 WATSONX_SPACE_ID 提供空間 ID。選用變數可設定區域主機、模型 ID、API 版本與逾時。需要連線至 IBM Cloud 的網路。
安裝前請注意
伺服器持有 IBM Cloud API 金鑰並用它換取短期 IAM 權杖,應將該金鑰視為敏感憑證,避免寫入共用設定。推論呼叫會計入你的 IBM Cloud 帳戶,可能產生費用。工具被描述為唯讀推論,不會修改帳戶或本機環境。此伺服器由社群建置,與 IBM 無隸屬關係。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 IBM watsonx.ai Granite,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[three.ws]

@three-ws/ibm-watsonx-mcp

MCP server for IBM watsonx.ai — chat, generation, embeddings, tokenization, forecasting, and model discovery, on your own IBM Cloud account.

[npm] [downloads] [license] [node] [MCP Registry] [three.ws]

Install · Quick start · Tools · Requirements · three.ws


A Model Context Protocol server that exposes IBM watsonx.ai — IBM Granite foundation models and anything else in your account — to MCP clients such as Claude Desktop, Claude Code, and Cursor. It talks directly to the watsonx.ai as-a-Service REST API with your own IBM Cloud credentials: it mints an IAM bearer token from your API key, caches it until just before expiry, and scopes every call to your project. No intermediary backend, no telemetry, no mock data.

Community-built and not affiliated with IBM. Registry name: io.github.nirholas/ibm-watsonx.

Install

bash
npm install @three-ws/ibm-watsonx-mcp

Run it directly with npx (no install needed):

bash
WATSONX_API_KEY=... WATSONX_PROJECT_ID=... npx @three-ws/ibm-watsonx-mcp

Or install globally to get the ibm-watsonx-mcp binary on your PATH:

bash
npm install -g @three-ws/ibm-watsonx-mcp

Quick start

With Claude Code, one command:

bash
claude mcp add ibm-watsonx -e WATSONX_API_KEY=... -e WATSONX_PROJECT_ID=... -- npx -y @three-ws/ibm-watsonx-mcp

Or add the server to your MCP client config (claude_desktop_config.json, Cursor's mcp.json):

json
{	"mcpServers": {		"ibm-watsonx": {			"command": "npx",			"args": ["-y", "@three-ws/ibm-watsonx-mcp"],			"env": {				"WATSONX_API_KEY": "your-ibm-cloud-api-key",				"WATSONX_PROJECT_ID": "your-watsonx-project-id"			}		}	}}

Restart the client and the six tools below appear. Inspect the surface manually with the MCP Inspector:

bash
npx -y @modelcontextprotocol/inspector npx @three-ws/ibm-watsonx-mcp

Tools

ToolWhat it does
watsonx_chatChat completion from a list of role/content messages. Returns the reply plus token usage.
watsonx_generateRaw prompt completion with decoding control (greedy/sample, stop sequences).
watsonx_embedEmbedding vectors for one or more texts (up to 1000). One vector per input plus dimensionality.
watsonx_tokenizeToken count (and optionally the tokens) for a text against a model tokenizer.
watsonx_forecastZero-shot time-series forecasting with an IBM Granite TimeSeries (TinyTimeMixer) model.
watsonx_list_modelsList the foundation models available to your account and region, optionally filtered.

Every tool is a read-only model-inference call — nothing in your environment or IBM account is modified — and declares MCP tool annotations (readOnlyHint, openWorldHint, idempotentHint) so clients can reason about side effects.

Input parameters

watsonx_chat — messages (required: array of { role, content }, roles system/user/assistant), model, max_tokens (1–4096), temperature (0–2), top_p (0–1).

watsonx_generate — input (required), model, max_new_tokens (1–4096), temperature (0–2), decoding_method (greedy/sample), stop_sequences.

watsonx_embed — inputs (required: 1–1000 texts), model.

watsonx_tokenize — input (required), model, return_tokens (boolean).

watsonx_forecast — timestamps (required: ISO-8601, uniform cadence, oldest first), values (required: numeric, same length), freq (required: pandas cadence, e.g. 1h, 15min, 1D), model, target_column, prediction_length (1–96).

watsonx_list_models — filter (e.g. function_text_generation, function_embedding), limit (1–200, default 100).

Example calls

jsonc
// watsonx_chat{ "messages": [{ "role": "user", "content": "Explain MCP in one sentence." }] }
// watsonx_generate{ "input": "Write a haiku about Kubernetes.", "decoding_method": "sample", "temperature": 0.7, "max_new_tokens": 60 }
// watsonx_embed{ "inputs": ["lakehouse", "data warehouse"] }
// watsonx_forecast{ "timestamps": ["2025-01-01T00:00:00Z", "2025-01-01T01:00:00Z"], "values": [1200, 1180], "freq": "1h", "prediction_length": 24 }
// watsonx_list_models{ "filter": "function_embedding" }

How auth works

WATSONX_API_KEY is exchanged for a short-lived IAM bearer token at https://iam.cloud.ibm.com/identity/token (grant_type=urn:ibm:params:oauth:grant-type:apikey). The token is cached in-process and refreshed about five minutes before it expires. Your API key never leaves your machine except in that single IAM exchange.

Requirements

  • Node.js >= 20.
  • An IBM Cloud account with watsonx.ai provisioned — sign up (free tier available).
  • An IBM Cloud API key — create one at https://cloud.ibm.com/iam/apikeys.
  • Your watsonx.ai project id — open the project → Manage → General → Project ID (or a deployment space id).

Environment variables

VariableRequiredDefault
WATSONX_API_KEYyes—
WATSONX_PROJECT_IDyes (or WATSONX_SPACE_ID)—
WATSONX_SPACE_IDalternative to WATSONX_PROJECT_ID—
WATSONX_URLnohttps://us-south.ml.cloud.ibm.com
WATSONX_MODEL_IDnoibm/granite-3-8b-instruct
WATSONX_EMBED_MODEL_IDnoibm/granite-embedding-278m-multilingual
WATSONX_FORECAST_MODELnoibm/granite-ttm-512-96-r2
WATSONX_API_VERSIONno2024-05-31
WATSONX_TS_API_VERSIONno2025-02-11 (time-series API date)
WATSONX_TIMEOUT_MSno60000
WATSONX_IAM_URLnohttps://iam.cloud.ibm.com/identity/token

Regional hosts: us-south, eu-de, eu-gb, jp-tok, au-syd, ca-tor — e.g. https://eu-de.ml.cloud.ibm.com.

Related

  • @three-ws/ibm-x402-mcp — the same IBM Granite tools as pay-per-use x402 endpoints (USDC on Solana), so callers need no IBM account of their own.

Links


Part of the three.ws SDK suite — 3D AI agents, on-chain identity, and agent payments.
Website · Changelog · GitHub

來源:packages/ibm-watsonx-mcp/README.md,提交 c8f2cde

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.2.2最新Oct 10, 2026
  2. v0.2.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Granite 整合