From 8d17ea4d3e96cd5236d4b7bb74d2aec27d2db1c5 Mon Sep 17 00:00:00 2001 From: samina Date: Mon, 24 Mar 2025 14:38:47 -0600 Subject: [PATCH] initial draft --- .../nebula/mcp-server/get-started/page.mdx | 93 ++++++++ .../integrations/claude-desktop/page.mdx | 32 +++ .../integrations/mcp-clients/page.mdx | 10 + apps/portal/src/app/nebula/sidebar.tsx | 206 +++++++++++------- apps/portal/src/app/nebula/tools/page.mdx | 2 + .../src/app/nebula/tools/python-sdk/page.mdx | 50 +++++ apps/portal/src/app/page.tsx | 2 +- 7 files changed, 321 insertions(+), 74 deletions(-) create mode 100644 apps/portal/src/app/nebula/mcp-server/get-started/page.mdx create mode 100644 apps/portal/src/app/nebula/mcp-server/integrations/claude-desktop/page.mdx create mode 100644 apps/portal/src/app/nebula/mcp-server/integrations/mcp-clients/page.mdx create mode 100644 apps/portal/src/app/nebula/tools/page.mdx create mode 100644 apps/portal/src/app/nebula/tools/python-sdk/page.mdx diff --git a/apps/portal/src/app/nebula/mcp-server/get-started/page.mdx b/apps/portal/src/app/nebula/mcp-server/get-started/page.mdx new file mode 100644 index 00000000000..198afeb9a38 --- /dev/null +++ b/apps/portal/src/app/nebula/mcp-server/get-started/page.mdx @@ -0,0 +1,93 @@ +import { OpenSourceCard, Callout } from "@doc"; + +# Get Started + +Learn how to get started with the thirdweb MCP server. + +### Prerequisites + +- Python 3.10 or higher +- uv + +### Run with uvx +```bash +THIRDWEB_SECRET_KEY=... \ + uvx thirdweb-mcp +``` + +### Install and run with pipx + +```bash +pipx install thirdweb-mcp + +THIRDWEB_SECRET_KEY=... \ + thirdweb-mcp +``` + +### Install from source + +```bash +git clone https://github.com/thirdweb-dev/ai.git thirdweb-ai +cd thirdweb-ai/python/thirdweb-mcp +uv sync +``` + +## Configuration + +The thirdweb MCP server requires configuration based on which services you want to enable: + +1. **thirdweb Secret Key**: Required for Nebula and Insight services. Obtain from the [thirdweb dashboard](https://thirdweb.com/dashboard). +2. **Chain IDs**: Blockchain network IDs to connect to (e.g., 1 for Ethereum mainnet, 137 for Polygon). +3. **Engine Configuration**: If using the Engine service, you'll need the Engine URL and authentication JWT. + +You can provide these through command-line options or environment variables. + +## Usage + +### Command-line options + +```bash +# Basic usage with default settings (stdio transport with Nebula and Insight) +THIRDWEB_SECRET_KEY=... thirdweb-mcp + +# Using SSE transport on a custom port +THIRDWEB_SECRET_KEY=... thirdweb-mcp --transport sse --port 8080 + +# Enabling all services with specific chain IDs +THIRDWEB_SECRET_KEY=... thirdweb-mcp --chain-id 1 --chain-id 137 \ + --engine-url YOUR_ENGINE_URL \ + --engine-auth-jwt YOUR_ENGINE_JWT \ + --engine-backend-wallet-address YOUR_ENGINE_BACKEND_WALLET_ADDRESS +``` + +### Environment variables + +You can also configure the MCP server using environment variables: + +- `THIRDWEB_SECRET_KEY`: Your thirdweb API secret key +- `THIRDWEB_ENGINE_URL`: URL endpoint for thirdweb Engine service +- `THIRDWEB_ENGINE_AUTH_JWT`: Authentication JWT token for Engine +- `THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS`: Wallet address for Engine backend + +## Available Services + +### Nebula + +Autonomous onchain execution and analysis: +- Analyze smart contract code +- Contract interactions and deployments +- Autonomous onchain tasks execution + +### Insight + +Offers blockchain data analysis capabilities: +- Query on-chain data across multiple networks +- Analyze transactions, blocks, and smart contract events +- Monitor wallet activities and token movements + +### Engine + +Integrates with thirdweb's backend infrastructure: +- Deploy smart contracts +- Interact with deployed contracts +- Manage wallet connections and transactions \ No newline at end of file diff --git a/apps/portal/src/app/nebula/mcp-server/integrations/claude-desktop/page.mdx b/apps/portal/src/app/nebula/mcp-server/integrations/claude-desktop/page.mdx new file mode 100644 index 00000000000..9ee860e633d --- /dev/null +++ b/apps/portal/src/app/nebula/mcp-server/integrations/claude-desktop/page.mdx @@ -0,0 +1,32 @@ +# Claude Desktop + + +Learn how to add the MCP server to Claude Desktop: + +1. Install the MCP: `pipx install thirdweb-mcp` + +2. Create or edit the Claude Desktop configuration file at: + - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` + - Windows: `%APPDATA%\Claude\claude_desktop_config.json` + - Linux: `~/.config/Claude/claude_desktop_config.json` + +3. Add the following configuration: + + ```json + { + "mcpServers": { + "thirdweb-mcp": { + "command": "thirdweb-mcp", + "args": [], // add `--chain-id` optionally + "env": { + "THIRDWEB_SECRET_KEY": "your thirdweb secret key from dashboard", + "THIRDWEB_ENGINE_URL": "(OPTIONAL) your engine url", + "THIRDWEB_ENGINE_AUTH_JWT": "(OPTIONAL) your engine auth jwt", + "THIRDWEB_ENGINE_BACKEND_WALLET_ADDRESS": "(OPTIONAL) your engine backend wallet address", + }, + } + } + } + ``` + +4. Restart Claude Desktop for the changes to take effect. \ No newline at end of file diff --git a/apps/portal/src/app/nebula/mcp-server/integrations/mcp-clients/page.mdx b/apps/portal/src/app/nebula/mcp-server/integrations/mcp-clients/page.mdx new file mode 100644 index 00000000000..59cd85df615 --- /dev/null +++ b/apps/portal/src/app/nebula/mcp-server/integrations/mcp-clients/page.mdx @@ -0,0 +1,10 @@ + +### MCP Clients + +Learn how to integrate the thirdweb MCP server with various clients. + +This server can be integrated with any client that supports the Model Context Protocol: + +1. Run the MCP server with the appropriate configuration +2. Connect your MCP client to the server using the selected transport (stdio or SSE) +3. Access thirdweb services through the exposed MCP tools \ No newline at end of file diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx index e7dead5a47c..5c34563124d 100644 --- a/apps/portal/src/app/nebula/sidebar.tsx +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -10,11 +10,12 @@ import { MessageCircleQuestion, PencilRuler, Rocket, + Workflow, Wrench, } from "lucide-react"; export const sidebar: SideBar = { - name: "Nebula", + name: "AI", links: [ { name: "Overview", @@ -32,117 +33,176 @@ export const sidebar: SideBar = { icon: , }, { - name: "Get Started", - href: "/nebula/get-started", - icon: , + separator: true, }, { - name: "Key Concepts", - icon: , + name: "Nebula (API)", + isCollapsible: false, links: [ { - name: "Chat & Execute", - href: "/nebula/key-concepts/chat-execute", + name: "Get Started", + href: "/nebula/get-started", + icon: , }, { - name: "Context Filters", - href: "/nebula/key-concepts/context-filters", - }, - { - name: "Execute Config", - href: "/nebula/key-concepts/execute-configuration", - }, - { - name: "Response Handling", - href: "/nebula/key-concepts/response-handling", - }, - { - name: "Sessions", - href: "/nebula/key-concepts/sessions", - }, - ], - }, - { - name: "API Reference", - href: "/nebula/api-reference", - icon: , - links: [ - { - name: "Chat", - expanded: true, + name: "Key Concepts", + icon: , links: [ { - name: "Send Message", - href: "/nebula/api-reference/chat", + name: "Chat & Execute", + href: "/nebula/key-concepts/chat-execute", }, { - name: "Execute Action", - href: "/nebula/api-reference/execute", + name: "Context Filters", + href: "/nebula/key-concepts/context-filters", + }, + { + name: "Execute Config", + href: "/nebula/key-concepts/execute-configuration", + }, + { + name: "Response Handling", + href: "/nebula/key-concepts/response-handling", + }, + { + name: "Sessions", + href: "/nebula/key-concepts/sessions", }, ], }, { - name: "Session", - expanded: true, + name: "API Reference", + href: "/nebula/api-reference", + icon: , links: [ { - name: "List Sessions", - href: "/nebula/api-reference/list-session", + name: "Chat", + expanded: true, + links: [ + { + name: "Send Message", + href: "/nebula/api-reference/chat", + }, + { + name: "Execute Action", + href: "/nebula/api-reference/execute", + }, + ], }, { - name: "Get Session", - href: "/nebula/api-reference/get-session", + name: "Session", + expanded: true, + links: [ + { + name: "List Sessions", + href: "/nebula/api-reference/list-session", + }, + { + name: "Get Session", + href: "/nebula/api-reference/get-session", + }, + { + name: "Create Session", + href: "/nebula/api-reference/create-session", + }, + { + name: "Update Session", + href: "/nebula/api-reference/update-session", + }, + { + name: "Clear Session", + href: "/nebula/api-reference/clear-session", + }, + { + name: "Delete Session", + href: "/nebula/api-reference/delete-session", + }, + ], }, + ], + }, + { + name: "SDK Reference", + icon: , + links: [ { - name: "Create Session", - href: "/nebula/api-reference/create-session", + name: "Typescript", + href: "/references/typescript/v5/chat", + icon: , }, { - name: "Update Session", - href: "/nebula/api-reference/update-session", + name: "Unity", + href: "/dotnet/nebula/quickstart", + icon: , }, + ], + }, + { + name: "Plugins & Integrations", + href: "/nebula/plugins", + icon: , + links: [ { - name: "Clear Session", - href: "/nebula/api-reference/clear-session", + name: "OpenAI", + href: "/nebula/plugins/openai", }, { - name: "Delete Session", - href: "/nebula/api-reference/delete-session", + name: "Eliza", + href: "/nebula/plugins/eliza", }, ], }, - ], + ] }, { - name: "SDK Reference", - icon: , + name: "MCP Server", + isCollapsible: false, links: [ { - name: "Typescript", - href: "/references/typescript/v5/chat", - icon: , + name: "Get Started", + href: "/nebula/mcp-server/get-started", + icon: , }, { - name: "Unity", - href: "/dotnet/nebula/quickstart", - icon: , - }, - ], + name: "Integrations", + icon: , + links: [ + { + name: "Claude Desktop", + href: "/nebula/mcp-server/integrations/claude-desktop", + }, + { + name: "MCP Server", + href: "/nebula/mcp-server/integrations/mcp-server", + } + ] + } + ] }, { - name: "Plugins & Integrations", - href: "/nebula/plugins", - icon: , + name: "Tools", + isCollapsible: false, links: [ { - name: "OpenAI", - href: "/nebula/plugins/openai", - }, - { - name: "Eliza", - href: "/nebula/plugins/eliza", - }, - ], + name: "Python SDK", + href: "/nebula/tools/python-sdk", + icon: , + links: [ + { + name: "Installation", + href: "/nebula/tools/python-sdk/installation", + }, + { + name: "Examples", + href: "/nebula/tools/python-sdk/examples", + }, + ] + } + + ] + }, + { + separator: true, }, { name: "Troubleshoot", diff --git a/apps/portal/src/app/nebula/tools/page.mdx b/apps/portal/src/app/nebula/tools/page.mdx new file mode 100644 index 00000000000..4026317a86c --- /dev/null +++ b/apps/portal/src/app/nebula/tools/page.mdx @@ -0,0 +1,2 @@ +# Installation + diff --git a/apps/portal/src/app/nebula/tools/python-sdk/page.mdx b/apps/portal/src/app/nebula/tools/python-sdk/page.mdx new file mode 100644 index 00000000000..f8151ce12ab --- /dev/null +++ b/apps/portal/src/app/nebula/tools/python-sdk/page.mdx @@ -0,0 +1,50 @@ +### Python SDK + +#### Installation + +```bash +# Install core package with all framework adapters +pip install "thirdweb-ai[all]" + +# Or install with specific framework adapters +pip install "thirdweb-ai[openai]" # For OpenAI Agents +pip install "thirdweb-ai[langchain]" # For LangChain +pip install "thirdweb-ai[agentkit]" # For Coinbase Agentkit +pip install "thirdweb-ai[goat]" # For GOAT SDK +# ... many more framework supported +``` + +See the list of [supported framework and installation guides](python/thirdweb-ai#install-with-framework-specific-adapters) + +#### Basic Usage + +```python +from thirdweb_ai import Engine, Insight, Nebula, Tool + +# Initialize services +insight = Insight(secret_key=...) +nebula = Nebula(secret_key=...) +engine = Engine(...) + +# Example: Create tools for AI agents +tools = [ + *insight.get_tools(), + *nebula.get_tools(), + *engine.get_tools(), + # Or pick an individual tool from the services +] + +# Example: Framework integration (LangChain) +from thirdweb_ai.adapters.langchain import get_langchain_tools +langchain_tools = get_langchain_tools(tools) +agent = create_tool_calling_agent(tools=langchain_tools, ...) + +# Example: Framework integration (OpenAI Agents) +from thirdweb_ai.adapters.openai import get_openai_tools +openai_tools = get_openai_tools(tools) +agent = Agent(name="thirdweb Assistant", tools=tools) + +# see python/examples for other framework integration +``` + +More [information](python/thirdweb-ai) \ No newline at end of file diff --git a/apps/portal/src/app/page.tsx b/apps/portal/src/app/page.tsx index ff5a03594c7..29c18906d8d 100644 --- a/apps/portal/src/app/page.tsx +++ b/apps/portal/src/app/page.tsx @@ -85,7 +85,7 @@ function BackendSection() { />