mcp-app-resource.view.stub 552 B

1234567891011121314151617
  1. <x-mcp::app :title="$title">
  2. <x-slot:head>
  3. <script type="module">
  4. createMcpApp(async (app) => {
  5. document.getElementById('run-btn').addEventListener('click', async () => {
  6. const result = await app.callServerTool('tool-name', {});
  7. document.getElementById('output').textContent = result.content[0]?.text ?? '';
  8. });
  9. });
  10. </script>
  11. </x-slot:head>
  12. <div id="app">
  13. <button id="run-btn">Run</button>
  14. <p id="output"></p>
  15. </div>
  16. </x-mcp::app>