---
title: "适用于 Claude Code 的 Alchemy 插件现已上线"
description: "安装适用于 Claude Code 的 Alchemy 插件后，即可查询 100 多条链上的区块链数据、运行斜杠命令，并在对话中直接管理 Alchemy 应用。"
---

# 适用于 Claude Code 的 Alchemy 插件现已上线

<ImageBlock
  src="https://media.alchemy.com/claude-plugin.png"
  alt="Alchemy Claude Plugin"
  width={1920}
  height={900}
  priority
/>

传统的开发流程正在发生变化。以前的情况是这样的：你正在写代码，需要查点东西——一个钱包余额、ETH 的当前价格、确认某笔交易是否真的上链了。于是你停下来，打开控制台，翻文档，拼凑出一段 SDK 调用，切换链，最后才拿到答案。

我们构建了用于 Claude Code 的 Alchemy 插件，目的就是去掉这个来回折腾的过程。只需安装一次，你的编码 Agent 就能查询 100+ 条链上的区块链数据、管理你的 Alchemy 应用，全程无需离开对话窗口。问一句“ETH 现在的价格是多少？”或者“看看 vitalik.eth 名下有哪些 NFT”，你就能直接得到基于实时数据的真实答案，就在你当前工作的地方。

<ExternalVideo
  url="https://www.youtube.com/watch?v=_9EK9tInVDo"
  provider="youtube"
  providerUid="_9EK9tInVDo"
/>

该插件为开源项目，现已在 [alchemyplatform/alchemy-claude-plugin](https://github.com/alchemyplatform/alchemy-claude-plugin) 上线。

## **一次安装，获得三样东西**

一次安装即可让 Claude Code 同时具备三项能力。它会连接托管的 Alchemy MCP Server，使 Claude 能够以工具调用的形式获取实时区块链数据。它还添加了对应最常用查询的斜杠命令，让常见操作一条命令即可完成。此外，它还提供了 Agent Skills，教会 Claude 如何正确使用 Alchemy——既包括在对话中回答问题，也包括针对我们的 API 编写应用代码。

这些都不需要你手动配置。安装、登录，然后就可以直接提问了。

## **快速上手**

在 Claude Code 中，添加 marketplace 并安装插件：

<CodeSnippet
  language="bash"
  code={`/plugin marketplace add alchemyplatform/alchemy-claude-plugin
/plugin install alchemy@alchemy`}
/>

第一次调用 Alchemy 工具时，会弹出一个浏览器窗口，你通过 OAuth 登录 Alchemy 账户。不需要复制 API key，也不需要运行本地服务器。如果你还没有账户，可以在 [Alchemy Dashboard](https://dashboard.alchemy.com/) 免费创建一个。

然后运行一次 setup，选择你要使用的应用：

`/alchemy:setup`

这会为本次会话缓存该应用的 API key，这也是大多数数据工具所需要的。之后你就可以用自然语言提问，或者直接调用命令。

## **你会用到的命令**

这些斜杠命令覆盖了最常打断你思路的查询操作。每个命令都接受一个可选的网络参数，不填时默认使用 Ethereum 主网。

<EmbeddedTable
  table={{
    columns: [
      { key: "command", width: 200, title: "Command", dataType: "object" },
      { key: "description", width: 420, title: "What it does", dataType: "object" },
    ],
    data: [
      {
        command: { title: "/alchemy:setup", tooltip: "", icon: "" },
        description: {
          title: "Connect and select an Alchemy app for the session",
          tooltip: "",
          icon: "",
        },
        id: 0,
      },
      {
        command: { title: "/alchemy:balance [network]", tooltip: "", icon: "" },
        description: {
          title: "Native and ERC-20 balances with USD values",
          tooltip: "",
          icon: "",
        },
        id: 1,
      },
      {
        command: { title: "/alchemy:nfts [network]", tooltip: "", icon: "" },
        description: { title: "NFTs owned by a wallet", tooltip: "", icon: "" },
        id: 2,
      },
      {
        command: { title: "/alchemy:token [network]", tooltip: "", icon: "" },
        description: {
          title: "Token price and metadata",
          tooltip: "",
          icon: "",
        },
        id: 3,
      },
      {
        command: { title: "/alchemy:tx [network]", tooltip: "", icon: "" },
        description: {
          title: "Transaction details and receipt",
          tooltip: "",
          icon: "",
        },
        id: 4,
      },
      {
        command: { title: "/alchemy:portfolio [networks]", tooltip: "", icon: "" },
        description: {
          title: "Multi-chain tokens and NFTs",
          tooltip: "",
          icon: "",
        },
        id: 5,
      },
      {
        command: { title: "/alchemy:gas [network]", tooltip: "", icon: "" },
        description: {
          title: "Current gas and fee estimates",
          tooltip: "",
          icon: "",
        },
        id: 6,
      },
      {
        command: { title: "/alchemy:solana", tooltip: "", icon: "" },
        description: {
          title: "SOL balance and SPL token accounts",
          tooltip: "",
          icon: "",
        },
        id: 7,
      },
      {
        command: { title: "/alchemy:create-app", tooltip: "", icon: "" },
        description: { title: "Create a new Alchemy app", tooltip: "", icon: "" },
        id: 8,
      },
    ],
  }}
/>

用 `portfolio` 跨链读取数据。以美元查看余额，无需自己接入价格数据源。查询交易及其回执，确认是否已完成上链。用同样的流程切入 Solana，查看 SOL 和 SPL token 账户，和处理 EVM 时一样方便。等到要正式上线时，`create-app` 可以直接在终端里创建一个新的 Alchemy 应用。

每个命令背后都是托管的 Alchemy MCP Server 提供的 160+ 个工具：EVM JSON-RPC、我们的 Token、NFT、Prices 和 Portfolio API，交易模拟与追踪，无 Gas 交易，以及通过 RPC 和 Digital Asset Standard 两种方式支持的 Solana。而且你不需要记住这些命令，直接问 Claude，它会自动调用正确的工具。

## **为什么这很重要**

关键不在于你能查询余额——这件事你本来就能做。关键在于，这次查询现在发生在工作过程之中，而不是工作之外。

当你的 Agent 能够在上下文中读取链上数据时，你提出的问题也会随之改变。你不再是单独去问“这个地址持有什么”，而是把它当作调试某个失败流程的一部分来问。你可以让 Claude 检查一笔交易的回执，推断它为什么被回滚，并提出修复方案，全程无需离开当前文件。模拟与追踪就在手边，让你在发送交易之前先了解它会做什么。Agent 不只是在写关于链的代码，它能看见链本身。

这也是我们把 Agent Skills 和工具一起提供的原因。实时数据用于当下回答问题，而这些 skills 则教会 Claude 我们 API 背后的使用模式，这样当它针对 Alchemy 编写代码时，写出来的就是我们会写的那种代码。你在对话中得到正确的帮助，在代码仓库中得到正确的代码。

## **如果你不使用 Claude Code**

对 Claude Code 用户来说，这个插件是最简便的方式，但它只是通过 Agent 使用 Alchemy 的三种方式之一。选择和你的开发环境相匹配的那一种。

<EmbeddedTable
  table={{
    columns: [
      { key: "option", width: 180, title: "", dataType: "object" },
      { key: "bestFor", width: 440, title: "Best for", dataType: "object" },
    ],
    data: [
      {
        option: { title: "Claude plugin", tooltip: "", icon: "" },
        bestFor: {
          title:
            "Claude Code, where one install bundles the MCP server, slash commands, and skills",
          tooltip: "",
          icon: "",
        },
        id: 0,
      },
      {
        option: {
          title:
            '<a href="https://www.alchemy.com/docs/alchemy-cli">Alchemy CLI</a>',
          tooltip: "",
          icon: "",
        },
        bestFor: {
          title:
            "The terminal directly, for live queries, transactions, and admin tasks in shell scripts, cron jobs, and CI pipelines",
          tooltip: "",
          icon: "",
        },
        id: 1,
      },
      {
        option: {
          title:
            '<a href="https://www.alchemy.com/docs/alchemy-mcp-server">MCP server</a>',
          tooltip: "",
          icon: "",
        },
        bestFor: {
          title:
            "Any MCP-compatible client such as Cursor, Codex, Claude Desktop, or VS Code Copilot, for live blockchain data as tool calls",
          tooltip: "",
          icon: "",
        },
        id: 2,
      },
      {
        option: {
          title:
            '<a href="https://www.alchemy.com/docs/alchemy-agent-skills">Agent Skills</a>',
          tooltip: "",
          icon: "",
        },
        bestFor: {
          title:
            "Any agent that writes code against Alchemy APIs, for endpoint knowledge without tool calls",
          tooltip: "",
          icon: "",
        },
        id: 3,
      },
    ],
  }}
/>

如果你使用 Claude Code，安装插件后，MCP server、斜杠命令和 skills 会一并到位。

## **试试看**

添加 marketplace，安装，运行 `/alchemy:setup`，然后向 Claude 提一个链上问题。整个过程大约一分钟，账户免费，而且该插件是开源的，你可以查看它的实现方式，或者参与贡献。

前往 [alchemyplatform/alchemy-claude-plugin](https://github.com/alchemyplatform/alchemy-claude-plugin) 获取，或阅读[文档](https://www.alchemy.com/docs/alchemy-claude-plugin)。
