MCPcopy Index your code
hub / github.com/alchemyplatform/alchemy-mcp-server

github.com/alchemyplatform/alchemy-mcp-server @v0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.0 ↗ · + Follow
230 symbols 512 edges 17 files 0 documented · 0% updated 8d agov0.3.0 · 2026-03-26★ 886 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Alchemy MCP Server

A Model Context Protocol (MCP) server that enables AI agents to interact with Alchemy's blockchain APIs in a structured way. This allows agents to query blockchain data directly without writing any code.

Alchemy Server MCP server

General Usage

This MCP server creates a bridge between AI agents and Alchemy's blockchain APIs, allowing agents to:

  • Query token prices and price history (including flexible time frame queries)
  • Get NFT ownership information and contract data
  • View transaction history across multiple networks
  • Check token balances across multiple blockchain networks
  • Retrieve detailed asset transfers with filtering
  • Send transactions via Smart Contract Accounts (requires configured wallet agent server)
  • Execute token swaps via DEX protocols (requires configured wallet agent server)
  • And more!

Quick Setup

To quickly set up the MCP server, use the following configuration in your MCP config file (typically in Claude Desktop or Cursor settings):

{
  "mcpServers": {
    "alchemy": {
      "command": "npx",
      "args": ["-y", "@alchemy/mcp-server"],
      "env": {
        "ALCHEMY_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

This configuration allows you to use the server without manually cloning the repository.

Environment Variables

The MCP server requires the following environment variable:

  • ALCHEMY_API_KEY - Your Alchemy API key (required for all blockchain data queries)

For transaction and swap functionality, you must also configure:

  • AGENT_WALLET_SERVER - URL of a configured wallet agent server that handles Smart Contract Account operations

⚠️ Important: The sendTransaction and swap methods will not function without a properly configured wallet agent server. These methods require external wallet infrastructure to handle signing and broadcasting transactions.

Available Methods

You can prompt your AI agent to use the following methods:

Token Price Methods

  1. fetchTokenPriceBySymbol
  2. Gets current price data for tokens by symbol
  3. Example: "What's the current price of ETH and BTC?"

  4. fetchTokenPriceByAddress

  5. Gets current price data for tokens by contract address
  6. Example: "What's the price of the token at address 0x1234...5678 on Ethereum mainnet?"

  7. fetchTokenPriceHistoryBySymbol

  8. Gets historical price data for tokens with specific date ranges
  9. Example: "Show me BTC price history from Jan 1 to Feb 1, 2023, with daily intervals"

  10. fetchTokenPriceHistoryByTimeFrame

  11. Gets historical price data using flexible time frames or natural language
  12. Example: "Show me ETH price for the last week" or "Get BTC price for the past 30 days"

Multichain Token Methods

  1. fetchTokensOwnedByMultichainAddresses
  2. Gets token balances for addresses across multiple networks
  3. Example: "What tokens does 0xabc...123 hold on Ethereum and Base?"

Transaction History Methods

  1. fetchAddressTransactionHistory
  2. Gets transaction history for addresses across multiple networks
  3. Example: "Show recent transactions for wallet 0xdef...456 on Ethereum"

  4. fetchTransfers

  5. Gets detailed asset transfer data with advanced filtering options
  6. Example: "Show me all ERC-20 transfers to or from 0xghi...789"

NFT Methods

  1. fetchNftsOwnedByMultichainAddresses
  2. Gets all NFTs owned by addresses with spam filtering
  3. Example: "What NFTs does 0xjkl...012 own?"

  4. fetchNftContractDataByMultichainAddress

  5. Gets NFT contract data for addresses
  6. Example: "What NFT collections does 0xmno...345 have tokens from?"

Transaction Methods

  1. sendTransaction
    • Sends transactions via Smart Contract Accounts
    • ⚠️ Important: Requires a configured wallet agent server with AGENT_WALLET_SERVER environment variable
    • Example: "Send 0.1 ETH to 0xpqr...678"

Swap Methods

  1. swap
    • Executes token swaps via DEX protocols (Uniswap)
    • ⚠️ Important: Requires a configured wallet agent server with AGENT_WALLET_SERVER environment variable
    • Example: "Swap 100 USDC for ETH"

Local Development and Open Source Contributions

Installation

  1. Clone the repository
git clone https://github.com/alchemyplatform/alchemy-mcp.git
cd alchemy-mcp
  1. Install dependencies
pnpm install

Development

pnpm watch

Building for Production

pnpm build

Using the MCP Inspector for Debugging

The MCP Inspector helps you debug your MCP server by providing a visual interface to test your methods:

pnpm inspector

This will start the MCP Inspector which you can access in your browser. It allows you to:

  • See all available methods
  • Test methods with different parameters
  • View the response data
  • Debug issues with your MCP server

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.

Example Prompts

Here are some example prompts you can use with your AI agent:

What's the current price of Bitcoin and Ethereum?

Show me the NFTs owned by the wallet 0x1234...5678 on Ethereum.

What tokens does wallet 0xabcd...6789 hold across Ethereum and Base?

Get me the transaction history for 0x9876...5432.

Show me the price history of Ethereum from January 1st to today with daily intervals.

Get me Bitcoin price data for the last week with hourly intervals.

Show me ETH price performance for the past month.

What ERC-20 transfers happened to address 0x1234...5678 in the last 100 blocks?

API Reference

For more information about Alchemy's APIs, refer to:

Extension points exported contracts — how you extend this code

TokenPriceBySymbol (Interface)
(no doc)
types/types.d.ts
TokenPriceByAddress (Interface)
(no doc)
types/types.d.ts
TokenPriceByAddressPair (Interface)
(no doc)
types/types.d.ts
TokenPriceHistoryBySymbol (Interface)
(no doc)
types/types.d.ts
MultiChainTokenByAddress (Interface)
(no doc)
types/types.d.ts

Core symbols most depended-on inside this repo

get
called by 126
api/client-providers.ts
handleToolCall
called by 96
api/registerTools.ts
callJsonRpc
called by 25
api/alchemyApi.ts
buildNftV3QueryString
called by 20
api/alchemyApi.ts
setupDi
called by 13
di/di-container.ts
callSolanaRpc
called by 12
api/alchemyApi.ts
buildBeaconQueryString
called by 7
api/alchemyApi.ts
symbolFor
called by 6
di/di-container.ts

Shape

Method 107
Interface 86
Function 27
Class 10

Languages

TypeScript100%

Modules by API surface

api/alchemyApi.ts102 symbols
types/types.d.ts86 symbols
api/client-providers.ts12 symbols
tests/e2e.test.ts10 symbols
api/registerTools.ts4 symbols
utils/dateUtils.ts3 symbols
tests/tool-behavior.test.ts3 symbols
di/modules/clients.module.ts3 symbols
utils/ethConversions.ts2 symbols
di/di-container.ts2 symbols
utils/convertTimestampToDate.ts1 symbols
utils/convertHexBalanceToDecimal.ts1 symbols

For agents

$ claude mcp add alchemy-mcp-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact