Skip to content

Commit 6989a7f

Browse files
authored
Add EW AI Integration documentation (#2767)
1 parent 2c5ec1e commit 6989a7f

12 files changed

Lines changed: 347 additions & 30 deletions

File tree

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const config = {
175175
],
176176
],
177177
plugins: [
178-
['./src/plugins/docusaurus-plugin-virtual-files', { rootDir: '.integrationBuilderCache' }],
178+
['./src/plugins/docusaurus-plugin-virtual-files', { rootDir: '.integrationBuilderCache', globalDataKeys: ['EW_AI_SKILL_MD'] }],
179179
'./src/plugins/docusaurus-plugin-tutorials',
180180
'docusaurus-plugin-sass',
181181
'./src/plugins/mm-scss-utils',

embedded-wallets/build-with-ai.mdx

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
---
2+
title: Build with AI
3+
sidebar_label: Build with AI
4+
toc_max_heading_level: 2
5+
description: 'Build MetaMask Embedded Wallets integrations faster using AI coding assistants — Cursor, Claude, Codex, Antigravity, OpenClaw, and more.'
6+
image: 'img/metamaskog.jpg'
7+
keywords:
8+
[
9+
ai,
10+
cursor,
11+
claude,
12+
codex,
13+
antigravity,
14+
openclaw,
15+
mcp,
16+
llm,
17+
coding assistant,
18+
embedded wallets,
19+
web3auth,
20+
]
21+
---
22+
23+
import SkillContent from '@site/src/components/SkillContent'
24+
25+
Speed up MetaMask Embedded Wallets integrations by giving your AI coding assistant access to the documentation and SDK reference information.
26+
27+
You'll set up the following:
28+
29+
- **Skill**: Guides your AI assistant on how to reason about the SDK (for example, architecture, framework-specific considerations, key derivation rules, and common pitfalls). There's no code in the skill; the MCP provides that.
30+
- **MCP server**: Provides real-time access to documentation search, code examples, and SDK types.
31+
32+
## Skill
33+
34+
The Skill guides your AI assistant by providing a mental model for MetaMask Embedded Wallets. It includes SDK selection logic,
35+
key derivation rules, authentication concepts, platform quirks, and common mistakes that aren't obvious from
36+
the docs alone. The Skill contains no code. The MCP server provides up-to-date code examples and implementation references.
37+
38+
:::tip
39+
For the best experience, use the MCP server alongside the skill so that your LLM can fetch live docs and examples rather than relying on static text.
40+
:::
41+
42+
### Cursor
43+
44+
Copy the skill into your project:
45+
46+
```bash
47+
npx degit Web3Auth/web3auth-mcp/skills/web3auth .cursor/skills/web3auth
48+
```
49+
50+
Cursor picks up any `SKILL.md` inside `.cursor/skills/` automatically and activates it when relevant.
51+
52+
### Claude Code CLI
53+
54+
Download the skill and append it to your project's `CLAUDE.md`:
55+
56+
```bash
57+
npx degit Web3Auth/web3auth-mcp/skills/web3auth /tmp/web3auth-skill
58+
cat /tmp/web3auth-skill/SKILL.md >> CLAUDE.md
59+
```
60+
61+
### Claude Desktop
62+
63+
Open **Claude Desktop → Settings → Custom Instructions** and paste the skill content below directly.
64+
65+
### Antigravity
66+
67+
Copy the skill into your project:
68+
69+
```bash
70+
npx degit Web3Auth/web3auth-mcp/skills/web3auth .agent/skills/web3auth
71+
```
72+
73+
Antigravity picks up skills inside `.agent/skills/` automatically. For global installation across all
74+
projects, use `~/.gemini/antigravity/skills/` instead.
75+
76+
### OpenClaw
77+
78+
Open your agent's configuration in the OpenClaw dashboard and paste the skill content below into the
79+
**Custom Instructions** field.
80+
81+
For self-hosted instances, add it to your `openclaw.json`:
82+
83+
```json
84+
{
85+
"agent": {
86+
"instructions": "<paste SKILL.md content here>"
87+
}
88+
}
89+
```
90+
91+
### Other tools
92+
93+
For any LLM tool with a system prompt or custom instructions field, paste the skill content below directly.
94+
95+
<details>
96+
<summary><strong>View `SKILL.md` file</strong></summary>
97+
98+
<SkillContent />
99+
100+
</details>
101+
102+
## MCP server
103+
104+
The [MetaMask Embedded Wallets MCP server](https://github.com/Web3Auth/web3auth-mcp) connects your AI coding
105+
assistant directly to the documentation. It provides five tools:
106+
107+
| Tool | What it does |
108+
| ------------------- | ---------------------------------------------------- |
109+
| `search_docs` | Search documentation and example projects |
110+
| `get_doc` | Fetch the full content of any doc page |
111+
| `get_example` | Fetch complete source code of an integration example |
112+
| `get_sdk_reference` | Fetch SDK types and hooks from the open-source repos |
113+
| `search_community` | Search the MetaMask Builder Hub for real user issues |
114+
115+
### Cursor
116+
117+
Select the following button to install the MCP server in Cursor automatically:
118+
119+
<p>
120+
<a
121+
href="https://cursor.com/en/install-mcp?name=web3auth&config=eyJ1cmwiOiJodHRwczovL21jcC53ZWIzYXV0aC5pbyJ9"
122+
target="_blank"
123+
rel="noopener noreferrer">
124+
<img
125+
src="https://cursor.com/deeplink/mcp-install-dark.svg"
126+
alt="Add MetaMask Embedded Wallets MCP to Cursor"
127+
height="32"
128+
/>
129+
</a>
130+
</p>
131+
132+
You can also add it manually. Open **Cursor Settings → Tools & Integrations → MCP** and add:
133+
134+
```json
135+
{
136+
"mcpServers": {
137+
"web3auth": {
138+
"url": "https://mcp.web3auth.io"
139+
}
140+
}
141+
}
142+
```
143+
144+
### Claude Code CLI
145+
146+
Run the following in your terminal:
147+
148+
```bash
149+
claude mcp add --transport http web3auth https://mcp.web3auth.io
150+
```
151+
152+
Or add manually to your project's `claude.json`:
153+
154+
```json
155+
{
156+
"mcpServers": {
157+
"web3auth": {
158+
"url": "https://mcp.web3auth.io"
159+
}
160+
}
161+
}
162+
```
163+
164+
### Claude Desktop
165+
166+
Open your Claude Desktop configuration file:
167+
168+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
169+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
170+
171+
Add the server to the `mcpServers` section:
172+
173+
```json
174+
{
175+
"mcpServers": {
176+
"web3auth": {
177+
"url": "https://mcp.web3auth.io"
178+
}
179+
}
180+
}
181+
```
182+
183+
Restart Claude Desktop and ask: _"Search MetaMask Embedded Wallets docs for React quick start"_ to verify the connection.
184+
185+
### Antigravity
186+
187+
Open your MCP configuration file:
188+
189+
- **macOS/Linux**: `~/.config/antigravity/mcp.json`
190+
- **Windows**: `%APPDATA%\antigravity\mcp.json`
191+
192+
Add the server to the `mcpServers` section:
193+
194+
```json
195+
{
196+
"mcpServers": {
197+
"web3auth": {
198+
"url": "https://mcp.web3auth.io"
199+
}
200+
}
201+
}
202+
```
203+
204+
Antigravity automatically reloads MCP configuration changes. You don't need to restart it.
205+
206+
### Codex CLI
207+
208+
For Codex CLI or any stdio-only agent, use [mcp-remote](https://github.com/modelcontextprotocol/mcp-remote) to bridge the HTTP endpoint:
209+
210+
```bash
211+
npm install -g mcp-remote
212+
```
213+
214+
Then add to your agent's configuration:
215+
216+
```json
217+
{
218+
"mcpServers": {
219+
"web3auth": {
220+
"command": "npx",
221+
"args": ["-y", "mcp-remote", "https://mcp.web3auth.io"]
222+
}
223+
}
224+
}
225+
```
226+
227+
### OpenClaw
228+
229+
For managed instances, go to your **OpenClaw dashboard → Skills → Add custom skill** and enter the MCP
230+
server URL:
231+
232+
```
233+
https://mcp.web3auth.io
234+
```
235+
236+
For self-hosted instances, add the server to your `openclaw.json`:
237+
238+
```json
239+
{
240+
"mcpServers": {
241+
"web3auth": {
242+
"url": "https://mcp.web3auth.io"
243+
}
244+
}
245+
}
246+
```
247+
248+
OpenClaw hot-reloads config changes — no restart required.
249+
250+
## Static docs (llms.txt)
251+
252+
If your AI tool doesn't support MCP yet, use the static documentation file instead. This gives your AI
253+
assistant the full MetaMask Embedded Wallets documentation as a single text file.
254+
255+
:::warning
256+
The static file is a snapshot and may not include the latest updates. Use the MCP server when possible
257+
for always-current docs.
258+
:::
259+
260+
Add the following URL as a custom doc source in your tool's settings, or paste it directly into your AI chat:
261+
262+
```
263+
https://docs.metamask.io/llms-embedded-wallets-full.txt
264+
```
265+
266+
For tools that support the [llms.txt spec](https://llmstxt.org/) and can index docs automatically, add:
267+
268+
```
269+
https://docs.metamask.io/llms-embedded-wallets.txt
270+
```
271+
272+
## Start building
273+
274+
Once the skill and MCP are set up, ask your AI assistant directly. Good starting prompts include:
275+
276+
- _"Add MetaMask Embedded Wallets to my React app with Google login."_
277+
- _"Set up social login wallets in my Next.js app using Wagmi."_
278+
- _"Integrate embedded wallets in my Flutter app."_
279+
- _"Why are my users getting different wallet addresses after I changed the login method?"_
280+
281+
The MCP server will search the docs and fetch real working examples. The skill will ensure the correct SDK is
282+
chosen and common pitfalls are avoided before a line of code is written.
283+
284+
:::tip
285+
286+
Use planning mode (where available) for your initial prompt. Review the plan before generating code — this
287+
catches architecture mistakes early and avoids config errors that would change wallet addresses in production.
288+
289+
:::

ew-sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const sidebar = {
128128
overview: [
129129
{ type: "doc", id: "README", label: "About" },
130130
{ type: "doc", id: "get-started", label: "Get Started" },
131+
"build-with-ai",
131132
{
132133
type: "category",
133134
label: "Choose your platform",
@@ -175,7 +176,7 @@ const sidebar = {
175176
"infrastructure/glossary",
176177
{
177178
type: "link",
178-
label: "Compliance, audits & trust",
179+
label: "Compliance, audits & trust",
179180
href: "https://trust.web3auth.io",
180181
},
181182
],

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"rehype-katex": "^7.0.1",
8585
"remark-codesandbox": "^0.10.1",
8686
"remark-docusaurus-tabs": "^0.2.0",
87+
"remark-gfm": "^4.0.1",
8788
"remark-math": "^6.0.0",
8889
"sass": "^1.93.0"
8990
},
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react'
2+
import { usePluginData } from '@docusaurus/useGlobalData'
3+
import CodeBlock from '@theme/CodeBlock'
4+
5+
const SKILL_KEY = 'Web3Auth/web3auth-mcp/refs/heads/main/skills/web3auth/SKILL.md'
6+
7+
export default function SkillContent(): JSX.Element {
8+
const files = usePluginData('docusaurus-plugin-virtual-files') as Record<string, string>
9+
const skill = files?.[SKILL_KEY] ?? ''
10+
11+
return (
12+
<CodeBlock language="markdown" title="SKILL.md">
13+
{skill}
14+
</CodeBlock>
15+
)
16+
}

src/plugins/docusaurus-plugin-virtual-files/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,19 @@ module.exports = (context, options) => ({
5959
return fileContents
6060
},
6161
async contentLoaded({ content, actions }) {
62-
const { createData, addRoute } = actions
62+
const { createData, addRoute, setGlobalData } = actions
63+
64+
// Only expose the explicitly opted-in keys as global data (loaded on every page).
65+
// All other files are served as per-route modules via addRoute below.
66+
const globalDataKeys = options.globalDataKeys ?? []
67+
const globalDataSubset = {}
68+
for (const shortKey of globalDataKeys) {
69+
const filename = qsFileLinks[shortKey]
70+
if (filename !== undefined && content[filename] !== undefined) {
71+
globalDataSubset[filename] = content[filename]
72+
}
73+
}
74+
setGlobalData(globalDataSubset)
6375

6476
// Create JSON data file
6577
const files = await createData('files.json', JSON.stringify(content))
@@ -90,6 +102,7 @@ module.exports.validateOptions = ({ options, validate }) =>
90102
validate(
91103
joi.object({
92104
rootDir: joi.string().required(),
105+
globalDataKeys: joi.array().items(joi.string()).default([]),
93106
}),
94107
options
95108
)

src/scss/custom.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,6 @@ ol {
328328
display: none !important;
329329
}
330330

331-
/* Code blocks */
332-
333-
.codeBlockTitle_Ktv7 {
334-
border-bottom: 1px solid var(--ifm-color-emphasis-500) !important;
335-
background-color: var(--general-black-light) !important;
336-
padding: 1rem 2rem !important;
337-
}
338-
339331
/* NavBar */
340332

341333
.colorModeToggle_DEke {

0 commit comments

Comments
 (0)