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.
npx -y @python/thirdweb-mcpOverview
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
# run (stdio transport)
THIRDWEB_SECRET_KEY=your_thirdweb_secret_key \
Run with uvx:
THIRDWEB_SECRET_KEY=your_thirdweb_secret_key \
Install from source:
Common CLI examples:
# Use SSE transport on port 8080
THIRDWEB_SECRET_KEY=...
# Enable specific chains and Engine/EngineCloud options
THIRDWEB_SECRET_KEY=...
Recommended environment variables
| Env var | Purpose |
|---|---|
| THIRDWEB_SECRET_KEY | Required for Nebula, Insight, Storage, EngineCloud |
| THIRDWEB_ENGINE_URL | Optional Engine service URL |
| THIRDWEB_ENGINE_AUTH_JWT | Optional Engine authentication JWT |
| THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS | Optional engine backend wallet address |
| THIRDWEB_VAULT_ACCESS_TOKEN | Optional 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
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.
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.
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.
Decentralized asset storage
- Upload build artifacts or metadata via Storage, receive IPFS CIDs, and reference them in contract metadata.
Example quickstart (minimal):
THIRDWEB_SECRET_KEY=sk_live_...
# 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)