HomeQuickstart
WEB3MCP PROTOCOLSOLANA DEVNET

Discover on-chain tools

Start with a program ID. Read its config PDA, load its published tools, and use them through Solana RPC.

01 · PublishA program owns and updates its config PDA.
02 · DiscoverA compatible host loads validated tools on demand.
03 · UseReads use RPC; writes require wallet approval.
[ 01 ]

Start with a program ID

Web3MCP starts from the target Solana program ID. This Devnet vault is a reference program; its tools are published in a PDA owned by the same program.

Program IDReference vault on Devnet9zJzM4rHDPR4pd3vXHQjQ7whTVmx4zxB3ZH4Gb9iXRwD
Config PDASeeds: web3mcp + configJ8Ph37LoQsv4yED6USdupCooCZzsVMqJkgBTm9uSkvCw
RPCSolana Devnetapi.devnet.solana.com
[ 02 ]

Install the SDK

In a Node.js 20 or later project, install the SDK and Solana library.

Install from npm
npm install @web3mcp/sdk @solana/web3.js
[ 03 ]

Discover the published tools

The SDK derives the config PDA, fetches it through RPC, and validates its ownership, status, digest, manifest, and IDL before returning tools.

Discover through Solana RPC
node --input-type=module <<'JS'
import { Connection } from '@solana/web3.js';
import { Web3McpSdk } from '@web3mcp/sdk';
const programId = '9zJzM4rHDPR4pd3vXHQjQ7whTVmx4zxB3ZH4Gb9iXRwD';
const sdk = new Web3McpSdk({ connection: new Connection('https://api.devnet.solana.com') });
await sdk.discover(programId);
console.log(sdk.getTools(programId).map(({ name, solana }) => ({ name, kind: solana.kind })));
JS
[ 04 ]

Read an account

The published get_vault_by_owner tool derives a vault PDA from an owner public key. The SDK verifies the returned account before decoding it. This read needs no signature.

Read a reference vault
node --input-type=module <<'JS'
import { Connection } from '@solana/web3.js';
import { Web3McpSdk } from '@web3mcp/sdk';
const programId = '9zJzM4rHDPR4pd3vXHQjQ7whTVmx4zxB3ZH4Gb9iXRwD';
const ownerAddress = 'Bp9Va3Qx9oFwme5uuXhDMdh2uUf3o8YHDBwcg4VYxc2L';
const sdk = new Web3McpSdk({ connection: new Connection('https://api.devnet.solana.com') });
await sdk.discover(programId);
console.log(await sdk.executeRead('get_vault_by_owner', { ownerAddress }, { programId }));
JS
[ 05 ]

Prepare a write for approval

For a published instruction such as deposit, a compatible host validates arguments, resolves accounts, constructs one instruction, and simulates the transaction. The user reviews the exact message before their wallet signs. The SDK rejects a changed signed message.

🔐
The model proposes tool calls. It never holds the private key or authorizes a signature.

Continue

Read the protocol rules, publish your program's tools, or integrate the Node.js SDK.