three.ws Solana Memo Media

io.github.nirholasv0.1.0更新于 Oct 10, 2026

Extract validated image data URIs from Solana SPL Memos and return them inline to MCP clients.

已验证STDIO仅桌面FinanceMedia & Design

概览

AI 生成的概览

读取 Solana SPL Memo 指令,并将其中嵌入的图片 data URI 以内联方式返回给 MCP 客户端。

功能
该服务器按交易签名获取 Solana 交易,返回其顶层和内部 Memo 指令中所有受支持的图片,并附带签名者、slot 和交易版本。它还能扫描某地址最近最多 1,000 个签名以查找包含 data URI 的 memo,在本地解码 data URI(无需网络),并报告本地策略、可识别的 memo 程序以及 RPC 故障转移主机。响应包含一条 JSON 记录,以及每个资源一个 image 内容块,含 MIME 类型、字节长度、SHA-256 摘要和尺寸。
适用场景
当你希望助手直接显示存储在 Solana memo 中的图片,而不必手动把 base64 data URI 复制到转换工具时,它很有用。适合对已知交易签名或地址相关的 memo 媒体做只读查看。
运行要求
通过 stdio 在本地运行,通常用 npx 和 Node.js 启动。无需账号或 API 密钥;可选的环境变量 SOLANA_RPC_URL 和 SOLANA_RPC_URLS 可指向你自己的 JSON-RPC 端点,否则使用公共 Solana 主网端点。获取和扫描工具需要网络访问。
安装前请注意
只读且无需密钥:不会签名、发送、上传、缓存或修改链上数据。Memo 文本是任意签名内容,data URI 只是一种约定,并非背书;在信任图片含义之前,应独立核实签名者、程序和交易上下文。仅接受 PNG、JPEG、WebP 和 GIF,SVG 及可执行或文档类媒体会被拒绝,解码内容上限为 262,144 字节。

安装

在 SourceWeft 中

  1. 打开 控制台中的 three.ws Solana Memo Media,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@three-ws/solana-memo-media-mcp

Read and display image data URIs embedded in Solana SPL Memo instructions. Instead of copying a data:image/...;base64,... memo payload into a browser converter, give an AI assistant the transaction signature and receive the validated image inline.

This is a keyless, read-only stdio MCP server. It never signs, sends, uploads, caches, or modifies chain data.

Install

bash
claude mcp add solana-memo-media -- npx -y @three-ws/solana-memo-media-mcp

For Cursor, Claude Desktop, or another stdio MCP client:

json
{  "mcpServers": {    "solana-memo-media": {      "command": "npx",      "args": ["-y", "@three-ws/solana-memo-media-mcp"]    }  }}

Tools

ToolPurpose
extract_solana_memo_mediaFetch one legacy, v0, or v1 transaction and return every supported image in its top-level and inner Memo instructions, with signer, slot, and version.
find_solana_memo_mediaScan up to 1,000 recent signatures for an address (pageable with before). Only signatures whose memo summary holds a data URI are fetched, so a scan costs a handful of RPC calls.
decode_solana_memo_data_uriDecode one already-copied data URI locally. No network call.
get_solana_memo_media_statusShow the local policy, recognized memo programs, and RPC failover hosts. No network call.

Recognized memo programs: SPL Memo v1 (Memo1UhkJRfHyvLMcVLMbLJYfW2tfU8G8H4PqvV6v8), SPL Memo v2 (MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr), and the newer program carried by version 1 transactions (Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH).

Example

Ask an MCP client: "Show any image embedded in Solana transaction <signature>." It calls extract_solana_memo_media with:

json
{ "signature": "<base58 Solana transaction signature>" }

The response is a JSON record plus one MCP image content block per asset. The record carries the signature, fee payer, slot, transaction version, and for each asset its MIME type, byte length, SHA-256, and dimensions. The raw data URI is intentionally not echoed into text output.

Use it from your own code:

js
import { decodeDataUri } from '@three-ws/solana-memo-media-mcp/src/lib/media.js';
const media = decodeDataUri('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgwJ/lwV8YQAAAABJRU5ErkJggg==');console.log(media.mimeType, media.byteLength, media.dimensions, media.sha256);

Full guide: docs/mcp-solana-memo-media.md.

Safety and provenance

An SPL Memo is arbitrary signed text. A data URI is only a convention inside that text, not a Solana media standard and not an endorsement by a wallet, explorer, or this package.

  • Only image/png, image/jpeg, image/webp, and image/gif are accepted.
  • SVG and all executable or document media are rejected.
  • Decoded content is capped at 262,144 bytes.
  • The declared MIME type must match PNG, JPEG, WebP, or GIF file signatures before an image is returned.
  • The server reports a SHA-256 digest so callers can preserve an exact reference.
  • Verify the transaction signer, program, and surrounding transaction context independently before trusting what an image means.

RPC configuration

The server tries SOLANA_RPC_URLS, then SOLANA_RPC_URL, then public Solana mainnet endpoints. You do not need a key for normal use.

VariableRequiredMeaning
SOLANA_RPC_URLSnoComma-separated ordered JSON-RPC failover endpoints.
SOLANA_RPC_URLnoOne primary JSON-RPC endpoint.

Development

bash
npm test --prefix packages/solana-memo-media-mcpnpx -y @modelcontextprotocol/inspector node packages/solana-memo-media-mcp/src/index.js

License: Apache-2.0.

来源:packages/solana-memo-media-mcp/README.md,提交 0e68f46

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.1.0最新Oct 10, 2026