Watsonx.data Document Library Retrieval MCP Server
Bridges AI agents with watsonx.data document libraries, enabling natural language queries and intelligent retrieval from document libraries.
README
Watsonx.data Document Library Retrieval MCP Server
The Watsonx.data Document Library Retrieval MCP Server is a Model Context Protocol (MCP)-compliant service that seamlessly connects AI agents with document libraries in watsonx.data, enabling intelligent data retrieval and interaction.
Key Features
-
Dynamic Discovery & Registration
Automatically detects and registers document libraries as MCP tools. -
Natural Language Interface
Query document libraries using conversational language and receive human-readable responses. -
Minimal Configuration
Deploy with simple setup requirements and zero complex configurations. -
Framework-Agnostic Integration
Plug directly into the preferred agentic frameworks with native MCP compatibility.
Overview
- Protocol: Model Context Protocol (MCP)
- Purpose: Acts as a bridge between agentic AI frameworks and watsonx.data document libraries
- Supported Environments: IBM Cloud Pak for Data (CPD), Watsonx SaaS
- Agent Compatibility: The agentic framework must support the MCP standard (via SSE or Stdio).
Note: This server will not function with agents that do not support MCP.
Prerequisites
- Python version 3.11 or later
- Access to your CPD or SaaS environment
- Access credentials and a CA certificate bundle for CPD
- Ensure your agent framework supports MCP protocol
Getting CA Bundle for CPD
-
Login to your OpenShift cluster:
oc login -u kubeadmin -p '<your_openshift_password>' https://<your_openshift_cpd_url>:6443 -
Extract the root CA bundle:
oc get configmap kube-root-ca.crt -o jsonpath='{.data.ca\.crt}' > cabundle.crt
NOTE: Please use open shift login command. The user and password will be open shift portal login username and password
Setup
Step 1: Install Python
- Official Installer: https://www.python.org/downloads/
Step 2: Create a virtual environment
python -m venv .venv
Step 3: Activate the virtual environment
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
Step 4: Install the uv package manager
pip install uv
uvpackage: https://pypi.org/project/uv/
Step 5: Install the MCP server package
pip install ibm-watsonxdata-dl-retrieval-mcp-server
Configuration
For Cloud Pak for Data (CPD):
export CPD_ENDPOINT="<cpd-endpoint>"
export CPD_USERNAME="<cpd-username>"
export CPD_PASSWORD="<cpd-password>"
export CA_BUNDLE_PATH="<absolute_path_to_cabundle.crt>"
export LH_CONTEXT="CPD"
NOTE:
- For CPD_ENDPOINT use endpoint url for installed CPD. Example: "https://cpd-cpd-instance.apps.perf10.5y2z.openshiftapps.com"
- For CPD_USERNAME and CPD_PASSWORD use the username and password used to login to CPD.
For Watsonx SaaS:
export WATSONX_DATA_API_KEY="<api-key>"
export WATSONX_DATA_RETRIEVAL_ENDPOINT="<retrieval-service-endpoint>"
export DOCUMENT_LIBRARY_API_ENDPOINT="<document-library-endpoint>"
export WATSONX_DATA_TOKEN_GENERATION_ENDPOINT="<token-generation-endpoint>"
export LH_CONTEXT="SAAS"
NOTE:
- For DOCUMENT_LIBRARY_API_ENDPOINT please use the endpoint url corresponding to region from here: https://cloud.ibm.com/apidocs/data-ai-common-core#endpoint-url. Example: https://api.ca-tor.dai.cloud.ibm.com
- For WATSONX_DATA_RETRIEVAL_ENDPOINT please use the watsonx.data endpoint. Example : https://console-ibm-cator.lakehouse.saas.ibm.com
- For WATSONX_DATA_TOKEN_GENERATION_ENDPOINT please use the endpoint url from here: https://cloud.ibm.com/apidocs/iam-identity-token-api#endpoints . Example: https://iam.cloud.ibm.com
Running the Server
uv run ibm-watsonxdata-dl-retrieval-mcp-server
By default, the server runs in sse transport mode on port 8000.
Transport: SSE
uv run ibm-watsonxdata-dl-retrieval-mcp-server --port <desired_port> --transport sse
Transport: stdio
uv run ibm-watsonxdata-dl-retrieval-mcp-server --port <desired_port> --transport stdio
Integrating with WXO
Prerequisite:
Install WXO ADK and complete the initial setup. Refer documentation for more details: https://developer.watson-orchestrate.ibm.com
Transport: STDIO
To add the MCP server in stdio transport with WXO refer the example below.
- create connection
orchestrate connections add -a <app id>
- Configure connection
orchestrate connections configure --app-id <app id> --environment draft -t team -k key_value
- Setting credentials
orchestrate connections set-credentials --app-id=<app id> --env draft -e WATSONX_DATA_API_KEY="<api_key>" -e WATSONX_DATA_RETRIEVAL_ENDPOINT="<wxd retrieval endpoint>" -e DOCUMENT_LIBRARY_API_ENDPOINT="<DL endpoint>" -e WATSONX_DATA_TOKEN_GENERATION_ENDPOINT="<token generation endpoint>" -e LH_CONTEXT="SAAS"
Example for Saas:
orchestrate toolkits import \
--kind mcp \
--name "mcp-toolkit" \
--description "mcp server for watsonx retrival service" \
--package "ibm-watsonxdata-dl-retrieval-mcp-server" \
--command "uv run ibm-watsonxdata-dl-retrieval-mcp-server --port <port> --transport stdio" \
--language python \
--tools "*" \
--app-id <app id>
Transport: SSE
- Install mcp-proxy
pip install mcp-proxy
- Run ibm-watsonxdata-dl-retrieval-mcp-server in sse transport.
Once prerequisites are met, the tools can be added as toolkit in WXO.
Example :
orchestrate toolkits import \
--kind mcp \
--name mcp_toolkit \
--description "MCP server (hosted, SSE)" \
--package "mcp-proxy" \
--language python \
--command "uvx mcp-proxy https://<mcp server endpoint>/sse" \
--tools "*"
NOTE:
When running wxo in SAAS and MCP server locally, expose the mcp server endpoint if required.
Refer wxo documentation for more details: https://www.ibm.com/docs/en/watsonx/watson-orchestrate/base?topic=tools-importing-from-mcp-server
Integrating with other Agentic Frameworks
For more examples on using Watsonx.data Document Library Retrieval MCP Server with agentic framework refer examples
Limitations
- Environment credentials cannot be changed during runtime.
- To change credentials, either:
- Start a new server with new env variables, OR
- Source new environment variables and restart the server.
- To change credentials, either:
Tool Naming
Each document library is registered with a unique tool name:
tool_name = <library_name><library_id>
Example:
invoice_document_library77e4b4dd_479e_4406_acc4_ce154c96266c
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。