go-sdk/mcp: add mcp app example#847
Open
yurivish wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
go-sdk/mcp: add mcp app example#847yurivish wants to merge 1 commit intomodelcontextprotocol:mainfrom
yurivish wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Adds a simple example of an MCP server that can display a user interface using the MCP app extension.
Contributor
|
Thanks for the contribution @yurivish! I'm happy that you found some time to show how MCP Apps can be used to others. I agree with the concern about the embedded JS code. I'm not very familiar with front-end development, but it would be great if there was a way to not put all the code in the example. Isn't the Apps SDK hosted somewhere so that it could be included as an external script? I think the example could also use a small There are also some simple fixes needed as uncovered by the test runs. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a simple example of an MCP server that can display a user interface using the MCP app extension.
Fixes #815 (comment)
The tricky / somewhat inelegant bit is that the JS for the MCP Apps SDK is inlined into the HTML; it is possible to load other resources but they must be served from a web server, so I opted for simplicity to embed the required JS in
index.html. Thinking about it more, this may not have been a great choice for an example. In my slightly more real-world example, I actually bundle and inline the code dynamically using esbuild's Go API.