Skip to content

Commit 815c5c0

Browse files
committed
docs: clean up and resolve formatting/merge conflicts in MCP guides
Clean up and format MCP guides, resolve merge conflicts, and update the Vite configuration tip to use standard Markdown alert blocks.
1 parent 1b7ae5c commit 815c5c0

2 files changed

Lines changed: 34 additions & 60 deletions

File tree

docs/guides/a2ui-in-mcp-apps.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,29 @@ MCP Apps are typically delivered as a single HTML resource from the MCP Server.
104104
2. Use a post-build script (like the [`inline.js`](https://github.com/google/A2UI/blob/main/samples/mcp/a2ui-in-mcpapps/server/apps/src/inline.js) script in the sample) to read the `index.html` and replace external `<script src="...">` and `<link rel="stylesheet" href="...">` tags with inline `<script>` and `<style>` tags containing the actual file contents.
105105
3. This produces a self-contained HTML file that can be safely loaded via `srcdoc` in the restricted iframe.
106106

107-
!!! tip "Using Vite to inline "
108-
If your project uses Vite (common for React, Vue, or Lit), you can achieve the same single-file output automatically using plugins like `vite-plugin-singlefile`. This eliminates the need for a custom post-build script by handling the inlining during the build process itself.
109-
110-
**How to use it:**
111-
1. **Install the plugin**:
112-
```bash
113-
npm install -D vite-plugin-singlefile
114-
```
115-
2. **Configure Vite**: Add the plugin to your `vite.config.ts` (or `.js`):
116-
```typescript
117-
import { defineConfig } from 'vite'
118-
import { viteSingleFile } from 'vite-plugin-singlefile'
119-
120-
export default defineConfig({
121-
plugins: [viteSingleFile()],
122-
})
123-
```
124-
This will ensure that all JS and CSS assets are inlined into the `index.html` file on build, making it ready to be served by your MCP server as a single resource.
107+
> [!TIP]
108+
> **Using Vite to inline**
109+
>
110+
> If your project uses Vite (common for React, Vue, or Lit), you can achieve the same single-file output automatically using plugins like `vite-plugin-singlefile`. This eliminates the need for a custom post-build script by handling the inlining during the build process itself.
111+
>
112+
> **How to use it:**
113+
>
114+
> 1. **Install the plugin**:
115+
> ```bash
116+
> npm install -D vite-plugin-singlefile
117+
> ```
118+
> 2. **Configure Vite**: Add the plugin to your `vite.config.ts` (or `.js`):
119+
>
120+
> ```typescript
121+
> import {defineConfig} from 'vite';
122+
> import {viteSingleFile} from 'vite-plugin-singlefile';
123+
>
124+
> export default defineConfig({
125+
> plugins: [viteSingleFile()],
126+
> });
127+
> ```
128+
>
129+
> This will ensure that all JS and CSS assets are inlined into the `index.html` file on build, making it ready to be served by your MCP server as a single resource.
125130
126131
### Step 2: Leveraging A2UI-over-MCP
127132

docs/guides/mcp-apps-in-a2ui.md

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -138,42 +138,24 @@ There are two primary samples demonstrating MCP Apps integration. Each sample re
138138
139139
---
140140
141-
### 1. MCP App Standalone Sample (Lit & ADK Agent)
141+
### Sample 1: MCP App Standalone Sample (Lit Client & ADK Agent)
142142
143143
This sample verifies the sandbox with a Lit-based client and an ADK-based A2A agent.
144144
145-
- **A2A Agent Server**:
146-
- Path: [`samples/agent/adk/mcp-apps-in-a2ui-sample/`](https://github.com/google/A2UI/tree/main/samples/agent/adk/mcp-apps-in-a2ui-sample/)
147-
- Command: `uv run .` (requires `GEMINI_API_KEY` in `.env`)
148-
- **Lit Client App**:
149-
- Path: [`samples/client/lit/mcp-apps-in-a2ui-sample/`](https://github.com/google/A2UI/tree/main/samples/client/lit/mcp-apps-in-a2ui-sample/)
150-
- Command: `npm install && npm run dev` (requires building the Lit renderer first)
151-
- URL: `http://localhost:5173/`
145+
#### Step 1: Start the Agent
152146
153-
**What to expect**: A simple interface loading the MCP App, with a button to trigger an action handled by the agent.
154-
155-
### 2. MCP Apps (Calculator + Pong) (Angular)
156-
157-
#### Step 3: Open in Browser
158-
159-
Open your browser and navigate to `http://localhost:5173`. You should see the A2UI interface loading the MCP App.
160-
161-
**What to expect**: A page loading the MCP App in a sandboxed iframe. Clicking the "Call Agent Tool" button inside the iframe will trigger an action that is handled by the agent.
162-
163-
---
164-
165-
### Sample 2: MCP Apps (Calculator + Pong) (Angular Client + MCP Server + Proxy Agent)
166-
167-
This sample verifies the sandbox with an Angular-based client, an MCP Proxy Agent, and a remote MCP Server. It requires **three** backend processes.
168-
169-
#### Step 1: Start the MCP Server (Calculator)
147+
In a separate terminal, navigate to the agent directory and start the agent:
170148
171149
```bash
172-
cd samples/mcp/mcp-apps-calculator/
173-
uv run .
150+
cd samples/agent/adk/mcp-apps-in-a2ui-sample
151+
uv run agent.py
174152
```
175153
176-
=======
154+
The agent will run on `http://localhost:8000`.
155+
156+
#### Step 2: Start the Client
157+
158+
In a new terminal, navigate to the client directory and start the dev server (requires building the Lit renderer first):
177159

178160
```bash
179161
cd samples/client/lit/mcp-apps-in-a2ui-sample
@@ -183,20 +165,9 @@ npm run dev
183165

184166
The client starts at `http://localhost:5173/`.
185167

186-
#### Step 2: Start the Agent
187-
188-
In a separate terminal, navigate to the agent directory and start the agent:
189-
190-
```bash
191-
cd samples/agent/adk/mcp-apps-in-a2ui-sample
192-
uv run agent.py
193-
```
194-
195-
The agent will run on `http://localhost:8000`.
196-
197168
#### Step 3: Open in Browser
198169

199-
Open your browser and navigate to `http://localhost:5173`. You should see the A2UI interface loading the MCP App.
170+
Open your browser and navigate to `http://localhost:5173/`. You should see the A2UI interface loading the MCP App.
200171

201172
**What to expect**: A page loading the MCP App in a sandboxed iframe. Clicking the "Call Agent Tool" button inside the iframe will trigger an action that is handled by the agent.
202173

@@ -213,8 +184,6 @@ cd samples/mcp/mcp-apps-calculator/
213184
uv run .
214185
```
215186

216-
> > > > > > > e3c17f1f (docs: add npm install step to MCP guide)
217-
218187
The MCP server starts on `http://localhost:8000` using SSE transport.
219188

220189
#### Step 2: Start the MCP Apps Proxy Agent

0 commit comments

Comments
 (0)