iflow-mcp_thirdweb-dev-thirdweb-mcp 0.1.24__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: iflow-mcp_thirdweb-dev-thirdweb-mcp
3
+ Version: 0.1.24
4
+ Summary: thirdweb MCP
5
+ Author-email: thirdweb <support@thirdweb.com>
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Python: ~=3.10
9
+ Requires-Dist: click<9,>=8.1.8
10
+ Requires-Dist: mcp<2,>=1.3.0
11
+ Requires-Dist: thirdweb-ai[mcp]==0.1.24
12
+ Description-Content-Type: text/markdown
13
+
14
+ # thirdweb MCP Server
15
+
16
+ A Model Context Protocol (MCP) server implementation for thirdweb services integration. This server allows you to integrate thirdweb's tools with any MCP-compatible client.
17
+
18
+ ## Overview
19
+
20
+ thirdweb MCP provides a unified interface to access thirdweb's suite of blockchain tools and services through the standardized Model Context Protocol. It supports multiple communication transports and can be integrated with various thirdweb services:
21
+
22
+ - **Nebula**: Autonomous onchain execution - real-time on-chain analysis, code generation and contract interactions
23
+ - **Insight**: Blockchain data analysis capabilities for real-time on-chain data
24
+ - **Engine**: Integration with thirdweb's backend infrastructure for contract deployments and interactions
25
+ - **EngineCloud**: Cloud-based engine operations for server wallets, contract interactions, and transaction management
26
+ - **Storage**: Decentralized storage capabilities for uploading and retrieving data via IPFS
27
+
28
+ ## Installation
29
+
30
+ ### Prerequisites
31
+
32
+ - Python 3.10 or higher
33
+ - uv
34
+
35
+ ### Run with uvx
36
+ ```bash
37
+ THIRDWEB_SECRET_KEY=... \
38
+ uvx thirdweb-mcp
39
+ ```
40
+
41
+ ### Install and run with pipx
42
+
43
+ ```bash
44
+ pipx install thirdweb-mcp
45
+
46
+ THIRDWEB_SECRET_KEY=... \
47
+ thirdweb-mcp
48
+ ```
49
+
50
+ ### Install from source
51
+
52
+ ```bash
53
+ git clone https://github.com/thirdweb-dev/ai.git thirdweb-ai
54
+ cd thirdweb-ai/python/thirdweb-mcp
55
+ uv sync
56
+ ```
57
+
58
+ ## Configuration
59
+
60
+ The thirdweb MCP server requires configuration based on which services you want to enable:
61
+
62
+ 1. **thirdweb Secret Key**: Required for Nebula, Insight, Storage, and EngineCloud services. Obtain from the [thirdweb dashboard](https://thirdweb.com/dashboard).
63
+ 2. **Chain IDs**: Blockchain network IDs to connect to (e.g., 1 for Ethereum mainnet, 137 for Polygon).
64
+ 3. **Engine Configuration**: If using the Engine service, you'll need the Engine URL and authentication JWT.
65
+ 4. **EngineCloud Configuration**: For EngineCloud operations, you may need the Vault Access Token for server wallet operations.
66
+
67
+ You can provide these through command-line options or environment variables.
68
+
69
+ ## Usage
70
+
71
+ ### Command-line options
72
+
73
+ ```bash
74
+ # Basic usage with default settings (stdio transport with Nebula and Insight)
75
+ THIRDWEB_SECRET_KEY=... thirdweb-mcp
76
+
77
+ # Using SSE transport on a custom port
78
+ THIRDWEB_SECRET_KEY=... thirdweb-mcp --transport sse --port 8080
79
+
80
+ # Enabling all services with specific chain IDs
81
+ THIRDWEB_SECRET_KEY=... thirdweb-mcp --chain-id 1 --chain-id 137 \
82
+ --engine-url YOUR_ENGINE_URL \
83
+ --engine-auth-jwt YOUR_ENGINE_JWT \
84
+ --engine-backend-wallet-address YOUR_ENGINE_BACKEND_WALLET_ADDRESS \
85
+ --vault-access-token YOUR_VAULT_ACCESS_TOKEN
86
+ ```
87
+
88
+ ### Environment variables
89
+
90
+ You can also configure the MCP server using environment variables:
91
+
92
+ - `THIRDWEB_SECRET_KEY`: Your thirdweb API secret key
93
+ - `THIRDWEB_ENGINE_URL`: URL endpoint for thirdweb Engine service
94
+ - `THIRDWEB_ENGINE_AUTH_JWT`: Authentication JWT token for Engine
95
+ - `THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS`: Wallet address for Engine backend
96
+ - `THIRDWEB_VAULT_ACCESS_TOKEN`: Vault access token for EngineCloud server wallet operations
97
+
98
+ ### Integration with Claude Desktop
99
+ To add this MCP server to Claude Desktop:
100
+
101
+ 1. Install the MCP: `pipx install thirdweb-mcp`
102
+
103
+ 2. Create or edit the Claude Desktop configuration file at:
104
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
105
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
106
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
107
+
108
+ 3. Add the following configuration:
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "thirdweb-mcp": {
114
+ "command": "thirdweb-mcp",
115
+ "args": [], // add `--chain-id` optionally
116
+ "env": {
117
+ "THIRDWEB_SECRET_KEY": "your thirdweb secret key from dashboard",
118
+ "THIRDWEB_ENGINE_URL": "(OPTIONAL) your engine url",
119
+ "THIRDWEB_ENGINE_AUTH_JWT": "(OPTIONAL) your engine auth jwt",
120
+ "THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS": "(OPTIONAL) your engine backend wallet address",
121
+ "THIRDWEB_VAULT_ACCESS_TOKEN": "(OPTIONAL) your vault access token for EngineCloud"
122
+ },
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ 4. Restart Claude Desktop for the changes to take effect.
129
+
130
+ Read more on [MCP Quickstart](https://modelcontextprotocol.io/quickstart/user)
131
+
132
+ ### Integration with MCP clients
133
+
134
+ This server can be integrated with any client that supports the Model Context Protocol:
135
+
136
+ 1. Run the MCP server with the appropriate configuration
137
+ 2. Connect your MCP client to the server using the selected transport (stdio or SSE)
138
+ 3. Access thirdweb services through the exposed MCP tools
139
+
140
+ ## Available Services
141
+
142
+ ### Nebula
143
+
144
+ Autonomous onchain execution and analysis:
145
+ - Analyze smart contract code
146
+ - Contract interactions and deployments
147
+ - Autonomous onchain tasks execution
148
+
149
+ ### Insight
150
+
151
+ Offers blockchain data analysis capabilities:
152
+ - Query on-chain data across multiple networks
153
+ - Analyze transactions, blocks, and smart contract events
154
+ - Monitor wallet activities and token movements
155
+
156
+ ### Engine
157
+
158
+ Integrates with thirdweb's backend infrastructure:
159
+ - Deploy smart contracts
160
+ - Interact with deployed contracts
161
+ - Manage wallet connections and transactions
162
+
163
+ ### EngineCloud
164
+
165
+ Cloud-based engine operations with advanced capabilities:
166
+ - Create and manage server wallets with KMS integration
167
+ - Read from and write to smart contracts
168
+ - Send transactions and query transaction history
169
+ - Check native token balances on various chains
170
+
171
+ ### Storage
172
+
173
+ Provides decentralized storage functionality:
174
+ - Upload files, directories, and JSON data to IPFS
175
+ - Retrieve content from IPFS using thirdweb gateway
176
+ - Preserve directory structures when uploading
177
+
178
+ ## License
179
+
180
+ [Apache-2.0 License](LICENSE)
181
+
182
+ ## Support
183
+
184
+ For questions or support, please contact [support@thirdweb.com](mailto:support@thirdweb.com) or visit [thirdweb.com](https://thirdweb.com).
@@ -0,0 +1,8 @@
1
+ src/__init__.py,sha256=4PYVeY0YTynjdkloQVo6Ggt4bSCoXpb24IY8jSJMFgA,53
2
+ src/_version.py,sha256=NZN0luBxCmPiCtSzeOxN7o9obFRFtpd64z1zzoQ95So,19
3
+ src/mcp.py,sha256=4vAFCGtUPBP0bnBQXcx8dtXJJ6R6JmRrVCZRHP3nD9I,4592
4
+ iflow_mcp_thirdweb_dev_thirdweb_mcp-0.1.24.dist-info/METADATA,sha256=Iw8eTdWW1A8DSAyM_BX-zMkjU7e9RL37IOVl7a5_paM,6224
5
+ iflow_mcp_thirdweb_dev_thirdweb_mcp-0.1.24.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
6
+ iflow_mcp_thirdweb_dev_thirdweb_mcp-0.1.24.dist-info/entry_points.txt,sha256=GRis3unFNDWxu2IMz2ad707MYg21UVGz2CzH03ACWI4,69
7
+ iflow_mcp_thirdweb_dev_thirdweb_mcp-0.1.24.dist-info/licenses/LICENSE,sha256=10O-qrryPfpQFWiQJVswU2Jjo--EbWO3u4Fs78N-Ljs,10941
8
+ iflow_mcp_thirdweb_dev_thirdweb_mcp-0.1.24.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ iflow-mcp_thirdweb-dev-thirdweb-mcp = src.mcp:main
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2021 Non-Fungible Labs, Inc
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
src/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from ._version import version
2
+
3
+ __version__ = version
src/_version.py ADDED
@@ -0,0 +1 @@
1
+ version = "0.1.24"
src/mcp.py ADDED
@@ -0,0 +1,125 @@
1
+ import os
2
+ from typing import Literal
3
+
4
+ import click
5
+ from thirdweb_ai import Engine, EngineCloud, Insight, Nebula, Storage
6
+ from thirdweb_ai.adapters.mcp import add_fastmcp_tools
7
+
8
+ from mcp.server.fastmcp import FastMCP
9
+
10
+
11
+ @click.command()
12
+ @click.option(
13
+ "--transport",
14
+ type=click.Choice(["stdio", "sse"]),
15
+ default="stdio",
16
+ help="Communication protocol for the MCP server. Use 'stdio' for standard input/output (default, suitable for CLI integrations) or 'sse' for Server-Sent Events (web-based applications).",
17
+ )
18
+ @click.option(
19
+ "-p",
20
+ "--port",
21
+ type=int,
22
+ default=8000,
23
+ help="Port number for the MCP SSE server when using the 'sse' transport. Only relevant when transport is set to 'sse'. Default is 8000.",
24
+ )
25
+ @click.option(
26
+ "-k",
27
+ "--secret-key",
28
+ type=str,
29
+ default=lambda: os.getenv("THIRDWEB_SECRET_KEY"),
30
+ help="Your thirdweb API secret key for authentication. Required for nebula, insight, and storage services. Can be obtained from the thirdweb dashboard. Falls back to THIRDWEB_SECRET_KEY environment variable if not specified.",
31
+ )
32
+ @click.option(
33
+ "--chain-id",
34
+ type=int,
35
+ multiple=True,
36
+ required=False,
37
+ default=lambda: os.getenv("THIRDWEB_CHAIN_ID"),
38
+ help="Blockchain network IDs to connect to (e.g., 1 for Ethereum mainnet, 137 for Polygon). Multiple chain IDs can be specified to support cross-chain operations. Required for insight when querying blockchain data.",
39
+ )
40
+ @click.option(
41
+ "--engine-url",
42
+ type=str,
43
+ default=lambda: os.getenv("THIRDWEB_ENGINE_URL"),
44
+ help="URL endpoint for thirdweb Engine service. Required when the 'engine' service is enabled. Falls back to THIRDWEB_ENGINE_URL environment variable if not specified.",
45
+ )
46
+ @click.option(
47
+ "--engine-auth-jwt",
48
+ type=str,
49
+ default=lambda: os.getenv("THIRDWEB_ENGINE_AUTH_JWT"),
50
+ help="Authentication JWT token for accessing thirdweb Engine service. Required when the 'engine' service is enabled. Falls back to THIRDWEB_ENGINE_AUTH_JWT environment variable if not specified.",
51
+ )
52
+ @click.option(
53
+ "--engine-backend-wallet-address",
54
+ type=str,
55
+ default=lambda: os.getenv("THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS"),
56
+ help="Wallet address used by the Engine backend for transactions. Optional for the 'engine' service. Falls back to THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS environment variable if not specified.",
57
+ )
58
+ @click.option(
59
+ "--vault-access-token",
60
+ type=str,
61
+ default=lambda: os.getenv("THIRDWEB_VAULT_ACCESS_TOKEN"),
62
+ help="Access token for the vault service, required for certain EngineCloud operations like creating server wallets. Falls back to THIRDWEB_VAULT_ACCESS_TOKEN environment variable if not specified.",
63
+ )
64
+ def main(
65
+ port: int,
66
+ transport: Literal["stdio", "sse"],
67
+ secret_key: str,
68
+ chain_id: list[int],
69
+ engine_url: str,
70
+ engine_auth_jwt: str,
71
+ engine_backend_wallet_address: str | None,
72
+ vault_access_token: str | None,
73
+ ):
74
+ mcp = FastMCP("thirdweb MCP", port=port)
75
+
76
+ chain_ids = [int(chain_id) for chain_id in chain_id]
77
+
78
+ # determine which services to enable based on the provided options
79
+ services = []
80
+ if secret_key:
81
+ services.extend(["nebula", "insight", "storage", "engine_cloud"])
82
+
83
+ if engine_url and engine_auth_jwt:
84
+ services.append("engine")
85
+
86
+ if not services:
87
+ raise ValueError(
88
+ "Please provide a thirdweb secret key through the THIRDWEB_SECRET_KEY environment variable."
89
+ )
90
+
91
+ # enable the tools for each service
92
+ if "nebula" in services:
93
+ nebula = Nebula(secret_key=secret_key)
94
+ add_fastmcp_tools(mcp, nebula.get_tools())
95
+
96
+ if "insight" in services:
97
+ insight = Insight(secret_key=secret_key, chain_id=chain_ids)
98
+ add_fastmcp_tools(mcp, insight.get_tools())
99
+
100
+ if "storage" in services:
101
+ storage = Storage(secret_key=secret_key)
102
+ add_fastmcp_tools(mcp, storage.get_tools())
103
+
104
+ if "engine" in services:
105
+ engine = Engine(
106
+ engine_url=engine_url,
107
+ engine_auth_jwt=engine_auth_jwt,
108
+ backend_wallet_address=engine_backend_wallet_address,
109
+ chain_id=next(iter(chain_ids)) if chain_ids else None,
110
+ secret_key=secret_key or "",
111
+ )
112
+ add_fastmcp_tools(mcp, engine.get_tools())
113
+
114
+ if "engine_cloud" in services:
115
+ engine_cloud = EngineCloud(
116
+ secret_key=secret_key,
117
+ vault_access_token=vault_access_token or "",
118
+ )
119
+ add_fastmcp_tools(mcp, engine_cloud.get_tools())
120
+
121
+ mcp.run(transport)
122
+
123
+
124
+ if __name__ == "__main__":
125
+ main()