# IBM Granite via x402

Connect an MCP client to IBM Granite for coding, chat, embeddings, document analysis, and forecasting, with each call paid in USDC on Solana.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 249
- Author: nirholas
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/nirholas/three.ws/tree/HEAD/packages/ibm-x402-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/ibm-granite-via-x402

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MCP_SVM_PAYMENT_ADDRESS`, `WATSONX_API_KEY`, `WATSONX_PROJECT_ID`, `WATSONX_SPACE_ID`, `WATSONX_URL`, `WATSONX_MODEL_ID`, `WATSONX_EMBED_MODEL_ID`, `X402_FEE_PAYER_SOLANA`, `X402_FACILITATOR_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values. 4 more environment variables are in the server README

## When to use it
- 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
- 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.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107423
- [Agent Skills Search Server](https://affpapa.org/en/nevibecode/mcp/agent-skills-search-server.md) — MCP server · ★ 26559
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [PraisonAI](https://affpapa.org/en/nevibecode/mcp/praisonai.md) — MCP server · ★ 9289

From the same set: [nirholas/three.ws](https://affpapa.org/en/nevibecode/by/nirholas/three.ws.md) — 43 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
