TH

Thirdweb MCP Server for Client Integration

Integrate thirdweb tools with any MCP-compatible client using this MCP server implementation for seamless Model Context Protocol connectivity.

Quick Install
npx -y @python/thirdweb-mcp

Overview

The Thirdweb MCP Server implements the Model Context Protocol (MCP) to expose thirdweb services to any MCP-compatible client. It translates MCP tool requests into thirdweb service calls (Nebula, Insight, Engine, EngineCloud, Storage), so LLMs, desktop assistants, or other MCP clients can access on-chain analysis, contract deployment, storage, and transaction workflows through a single, standardized interface.

This server supports multiple transport modes (stdio and SSE) and can run locally or in production. It is intended for developers who want to integrate thirdweb capabilities into chat assistants, local LLM apps, automation agents, or custom tooling without writing bespoke service adapters for each thirdweb product.

Features

  • MCP-compliant server exposing thirdweb tools (Nebula, Insight, Engine, EngineCloud, Storage)
  • Multiple transport options: stdio (default) and SSE for networked MCP clients
  • Support for multiple chain IDs and per-service configuration
  • Command-line and environment variable configuration
  • Upload/retrieve content to IPFS via thirdweb Storage
  • Deploy contracts, invoke transactions, and query on-chain data
  • Optional EngineCloud server wallet and KMS integration for server-side transactions

Installation / Configuration

Prerequisites:

  • Python 3.10+
  • pipx or uvx (optional)

Install and run with pipx:

# install
pipx install thirdweb-mcp

# run (stdio transport)
THIRDWEB_SECRET_KEY=your_thirdweb_secret_key \
  thirdweb-mcp

Run with uvx:

THIRDWEB_SECRET_KEY=your_thirdweb_secret_key \
  uvx thirdweb-mcp

Install from source:

git clone https://github.com/thirdweb-dev/ai.git thirdweb-ai
cd thirdweb-ai/python/thirdweb-mcp
uv sync

Common CLI examples:

# Use SSE transport on port 8080
THIRDWEB_SECRET_KEY=... thirdweb-mcp --transport sse --port 8080

# Enable specific chains and Engine/EngineCloud options
THIRDWEB_SECRET_KEY=... thirdweb-mcp \
  --chain-id 1 --chain-id 137 \
  --engine-url https://engine.thirdweb.com \
  --engine-auth-jwt YOUR_ENGINE_JWT \
  --engine-backend-wallet-address 0x123... \
  --vault-access-token YOUR_VAULT_TOKEN

Recommended environment variables

Env varPurpose
THIRDWEB_SECRET_KEYRequired for Nebula, Insight, Storage, EngineCloud
THIRDWEB_ENGINE_URLOptional Engine service URL
THIRDWEB_ENGINE_AUTH_JWTOptional Engine authentication JWT
THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESSOptional engine backend wallet address
THIRDWEB_VAULT_ACCESS_TOKENOptional Vault token for EngineCloud server wallets

Configuration can be supplied via flags or environment variables; flags override environment values.

Available Tools

The MCP server exposes the following tool categories to clients:

  • Nebula
    • Autonomous on-chain execution
    • Real-time contract analysis and code generation
    • Contract interactions and simulations
  • Insight
    • Cross-chain on-chain data queries
    • Transaction, block, and event analysis
    • Wallet and token activity monitoring
  • Engine
    • Contract deployment and management
    • Transaction sending and contract interactions via thirdweb Engine
  • EngineCloud
    • Server wallet creation and KMS-backed signing
    • Cloud transaction flow and history queries
    • Native balance checks and server-side operations
  • Storage
    • Upload files, directories, and JSON to IPFS
    • Retrieve content via thirdweb IPFS gateway
    • Preserve directory structure on upload

These tools are surfaced to MCP clients as discrete MCP tool descriptions and actions consistent with the MCP spec.

Use Cases

  1. Integrate with a local LLM or assistant (e.g., Claude Desktop)

    • Install the MCP server via pipx.
    • Add an MCP server entry to the client configuration (command + env).
    • Restart the client; the assistant can now query on-chain data, call contracts, or upload artifacts to IPFS.
  2. Automate contract deployment and verification

    • Use Engine tool to deploy a contract programmatically from an MCP client.
    • Run post-deploy verification and ledger checks via Insight.
  3. Autonomous on-chain agents

    • Use Nebula to generate and execute on-chain actions (e.g., monitoring and reactive transactions).
    • Combine with EngineCloud server wallet for automated signed transactions from a server KMS.
  4. Decentralized asset storage

    • Upload build artifacts or metadata via Storage, receive IPFS CIDs, and reference them in contract metadata.

Example quickstart (minimal):

pipx install thirdweb-mcp
THIRDWEB_SECRET_KEY=sk_live_... thirdweb-mcp --transport stdio
# Connect your MCP-compatible client to the server (stdio or SSE as configured)

Resources

  • Repository: https://github.com/thirdweb-dev/ai/tree/main/python/thirdweb-mcp
  • MCP quickstart and spec: https://modelcontextprotocol.io/quickstart/user
  • Support: [email protected]

License: Apache-2.0 (see repository LICENSE file)