-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement various improvements to A2UI and the editor application, in… #1363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
samples/mcp/a2ui-in-mcpapps/server/apps/editor/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # A2UI-Powered Document Editor Micro-App | ||
|
|
||
| This directory contains the source code for the generative document editor micro-app based on Angular and Editor.js. | ||
|
|
||
| It is built as a standalone static bundle and served by the MCP server as an isolated resource to be rendered securely within the host container. | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### 1. Node.js | ||
|
|
||
| Ensure you have Node.js installed (LTS v20 or v22 is recommended). | ||
|
|
||
| If Node.js is missing from your PATH, consider installing it via NVM (Node Version Manager): | ||
|
|
||
| ```bash | ||
| # Download and install NVM | ||
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash | ||
|
|
||
| # Refresh terminal | ||
| source ~/.bashrc | ||
|
|
||
| # Install LTS Node.js | ||
| nvm install --lts | ||
| ``` | ||
|
|
||
| ### 2. Build Core A2UI Libraries | ||
|
|
||
| This application has file-based dependencies on the core A2UI packages which reside elsewhere in this repository. You **must build these packages first** in specific order before this application's `npm install` will succeed. | ||
|
|
||
| Run the following commands from the **root of the repository**: | ||
|
|
||
| ```bash | ||
| # 1. Build Web Core | ||
| cd renderers/web_core | ||
| npm install | ||
| npm run build | ||
|
|
||
| # 2. Build Markdown Utilities | ||
| cd renderers/markdown/markdown-it | ||
| npm install | ||
| npm run build | ||
|
|
||
| # 3. Build Angular Renderer | ||
| cd renderers/angular | ||
| npm install | ||
| npm run build | ||
|
|
||
| cd ../../ | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Local Execution Workflow | ||
|
|
||
| To execute and run this application locally, you need to build the application bundle, ensure the host environment assets are ready, and then boot the services. | ||
|
|
||
| ### Step 1: Build the Editor App Bundle | ||
|
|
||
| From inside this directory (`samples/mcp/a2ui-in-mcpapps/server/apps/editor`): | ||
|
|
||
| ```bash | ||
| # Install local package dependencies | ||
| npm install --legacy-peer-deps | ||
|
|
||
| # Build Angular project AND generate the single self-contained HTML file | ||
| npm run build:all | ||
| ``` | ||
|
|
||
| _This outputs the final static artifact into `../public/editor.html` which the Python server reads._ | ||
|
|
||
| ### Step 2: Build the Client Host Bridge (Required Once) | ||
|
|
||
| Navigate to the client host directory and build its security-sandbox bridge: | ||
|
|
||
| ```bash | ||
| cd ../../../client | ||
| npm install | ||
| npm run build:sandbox | ||
| ``` | ||
|
|
||
| ### Step 3: Run the Full Local Environment | ||
|
|
||
| Open two terminals to start the stack: | ||
|
|
||
| #### Terminal A: Run MCP Server (Python) | ||
|
|
||
| ```bash | ||
| cd samples/mcp/a2ui-in-mcpapps/server | ||
| uv sync | ||
| uv run python server.py --transport sse --port 8000 | ||
| ``` | ||
|
|
||
| #### Terminal B: Run Host Web App (Angular) | ||
|
|
||
| ```bash | ||
| cd samples/mcp/a2ui-in-mcpapps/client | ||
| npm run start | ||
| ``` | ||
|
|
||
| #### Access the Application | ||
|
|
||
| Visit **[http://localhost:4200](http://localhost:4200)** in your browser to load the host container, which will automatically load this Editor app via the MCP server connection. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.