IBM Granite via x402 — MCP server for Claude Code: setup and tools
Connect an MCP client to IBM Granite for coding, chat, embeddings, document analysis, and forecasting, with each call paid in USDC on Solana.
claude mcp add --env MCP_SVM_PAYMENT_ADDRESS=<MCP_SVM_PAYMENT_ADDRESS> --env WATSONX_API_KEY=<WATSONX_API_KEY> --env WATSONX_PROJECT_ID=<WATSONX_PROJECT_ID> --env WATSONX_SPACE_ID=<WATSONX_SPACE_ID> --env WATSONX_URL=<WATSONX_URL> --transport stdio ibm-x402-mcp -- npx -y @three-ws/ibm-x402-mcpWhat IBM Granite via x402 does
This server exposes IBM Granite through MCP tools. An agent can ask for code generation or review, create text embeddings, inspect a document, or forecast a time series. A free introductory tool explains the available tools, pricing, and payment process.
The operator provides WATSONX_API_KEY, WATSONX_PROJECT_ID, and a Solana wallet address through MCP_SVM_PAYMENT_ADDRESS. Callers pay USDC per request and do not need their own IBM account. Automatic payment depends on the MCP client supporting x402; without that, the payment-and-retry flow will not run automatically. Calls only perform model inference and do not change local files or account settings.
What it helps with
- generate or review code with IBM Granite
- create text embeddings for search and RAG
- extract entities and sentiment from a document
- forecast values from a timestamped series
Example prompts for the agent
- Review this code and suggest corrections.
- Create embeddings for these texts so I can use them in search.
- Analyze this document as a financial report and identify risks.
How to install IBM Granite via x402
Platform CLI
claude mcp add --env MCP_SVM_PAYMENT_ADDRESS=<MCP_SVM_PAYMENT_ADDRESS> --env WATSONX_API_KEY=<WATSONX_API_KEY> --env WATSONX_PROJECT_ID=<WATSONX_PROJECT_ID> --env WATSONX_SPACE_ID=<WATSONX_SPACE_ID> --env WATSONX_URL=<WATSONX_URL> --transport stdio ibm-x402-mcp -- npx -y @three-ws/ibm-x402-mcpReplace <…> with your own values. 4 more environment variables are in the server README
Platform CLI
codex mcp add ibm-x402-mcp --env MCP_SVM_PAYMENT_ADDRESS=<MCP_SVM_PAYMENT_ADDRESS> --env WATSONX_API_KEY=<WATSONX_API_KEY> --env WATSONX_PROJECT_ID=<WATSONX_PROJECT_ID> --env WATSONX_SPACE_ID=<WATSONX_SPACE_ID> --env WATSONX_URL=<WATSONX_URL> -- npx -y @three-ws/ibm-x402-mcpReplace <…> with your own values. 4 more environment variables are in the server README
Config file
{
"mcpServers": {
"ibm-x402-mcp": {
"command": "npx",
"args": [
"-y",
"@three-ws/ibm-x402-mcp"
],
"env": {
"MCP_SVM_PAYMENT_ADDRESS": "<MCP_SVM_PAYMENT_ADDRESS>",
"WATSONX_API_KEY": "<WATSONX_API_KEY>",
"WATSONX_PROJECT_ID": "<WATSONX_PROJECT_ID>",
"WATSONX_SPACE_ID": "<WATSONX_SPACE_ID>",
"WATSONX_URL": "<WATSONX_URL>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README
Config file
{
"servers": {
"ibm-x402-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@three-ws/ibm-x402-mcp"
],
"env": {
"MCP_SVM_PAYMENT_ADDRESS": "<MCP_SVM_PAYMENT_ADDRESS>",
"WATSONX_API_KEY": "<WATSONX_API_KEY>",
"WATSONX_PROJECT_ID": "<WATSONX_PROJECT_ID>",
"WATSONX_SPACE_ID": "<WATSONX_SPACE_ID>",
"WATSONX_URL": "<WATSONX_URL>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README
Platform CLI
gemini mcp add -e MCP_SVM_PAYMENT_ADDRESS=<MCP_SVM_PAYMENT_ADDRESS> -e WATSONX_API_KEY=<WATSONX_API_KEY> -e WATSONX_PROJECT_ID=<WATSONX_PROJECT_ID> -e WATSONX_SPACE_ID=<WATSONX_SPACE_ID> -e WATSONX_URL=<WATSONX_URL> ibm-x402-mcp npx -y @three-ws/ibm-x402-mcpReplace <…> with your own values. 4 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about IBM Granite via x402
How do I install IBM Granite via x402 in Claude Code?
Run `claude mcp add ibm-x402-mcp -e MCP_SVM_PAYMENT_ADDRESS=<MCP_SVM_PAYMENT_ADDRESS> -e WATSONX_API_KEY=<WATSONX_API_KEY> -- npx -y @three-ws/ibm-x402-mcp`. Replace the placeholders with your wallet address and IBM key.
What does IBM Granite via x402 do?
It gives MCP clients tools for IBM Granite chat, code tasks, text embeddings, document analysis, and forecasting. Calls are paid in USDC on Solana.
What does the operator need to configure?
The operator supplies IBM watsonx.ai credentials and a Solana receiving address. Callers need USDC, and automatic payment requires an x402-capable MCP client.