跳转至主要内容
返回示例应用

Solana 服务器

一个基础的Solana 服务器,可让Claude (或 Cursor)等工具直接查询Solana 。通过这一集成,您将能够利用 LLM 客户端的强大功能,执行查询钱包余额、查看代币账户、获取交易详情以及分析账户信息等操作。

前端框架/库:
Solana
语言:
TypeScript
构建工具/开发服务器:
Model Context Protocol
示例应用预览

概述

The Model Context Protocol (MCP) allows you to extend AI assistants like Claude with custom tools that interact with external data sources and services. In this guide, you'll build a Solana MCP server that gives tools like Claude Desktop (or Cursor) the ability to query the Solana blockchain directly. This integration will enable Claude to perform tasks like checking wallet balances, viewing token accounts, retrieving transaction details, and analyzing account information—all while you maintain control over these interactions.

The demo uses:

Supporting resources:

入门指南

Install Dependencies

Open the project directory:

cd AI/solana-mcp

Then, install the dependencies:

npm install
# or
yarn
# or
pnpm install
# or
bun install

Build the Server:

Then, build the server:

npm run build
# or
yarn build
# or
pnpm build
# or
bun build

Setup Claude Desktop

Update your claude_desktop_config.json file with the content from example Claude desktop config. You can find instructions here.

Make sure to update SOLANA_RPC_ENDPOINT with your Quicknode RPC endpoint. You can get one free here.

Make sure your args pass in the absolute path to the built server (for us it is /YOUR_PATH/build/index.js).

Relaunch Claude Desktop after setting up your config file.

Now you can prompt Claude with commands like:

  • What is the Wallet balance of <wallet_address>?
  • What is the token balance of <wallet_address>?
  • What's the status of the Solana network?
投稿与反馈
我们非常期待收到您的反馈,并欢迎大家为本示例应用贡献力量!
如需报告问题或提供反馈,请在 qn-guide-示例 存储库。
如需贡献,请按照以下步骤操作:
  1. 分叉该仓库
  2. 创建一个功能分支:
    git checkout -b feature/amazing-feature
  3. 提交您的更改:
    git commit -m "添加超棒的功能"
  4. 推送您的分支:
    git push origin feature/amazing-feature
  5. 提交一个拉取请求。