| 1 | <html> |
| 2 | <head> |
| 3 | <title>A0 MCP Server</title> |
| 4 | </head> |
| 5 | |
| 6 | <body> |
| 7 | <div x-data="{ |
| 8 | get settings() { return $store.settings.settings }, |
| 9 | internalToolSearch: '', |
| 10 | internalTools: [ |
| 11 | { |
| 12 | name: 'send_message', |
| 13 | description: 'Send a message to this Agent Zero instance, start a chat, or continue a persistent chat.' |
| 14 | }, |
| 15 | { |
| 16 | name: 'finish_chat', |
| 17 | description: 'Finish a persistent chat that was started through the Agent Zero MCP server.' |
| 18 | } |
| 19 | ], |
| 20 | get filteredInternalTools() { |
| 21 | const query = this.internalToolSearch.trim().toLowerCase(); |
| 22 | if (!query) return this.internalTools; |
| 23 | return this.internalTools.filter((tool) => `${tool.name} ${tool.description}`.toLowerCase().includes(query)); |
| 24 | } |
| 25 | }"> |
| 26 | <template x-if="settings"> |
| 27 | <div> |
| 28 | <div class="section-title">A0 MCP Server</div> |
| 29 | <div class="section-description"> |
| 30 | Expose this Agent Zero instance as an MCP server for trusted clients. See <a href="javascript:openModal('settings/mcp/server/example.html')">connection example</a>. |
| 31 | </div> |
| 32 | |
| 33 | <div class="field"> |
| 34 | <div class="field-label"> |
| 35 | <div class="field-title">Enable A0 MCP Server</div> |
| 36 | <div class="field-description"> |
| 37 | Make Agent Zero available over SSE/HTTP to MCP-compatible tools. |
| 38 | </div> |
| 39 | </div> |
| 40 | <div class="field-control"> |
| 41 | <label class="toggle"> |
| 42 | <input type="checkbox" x-model="settings.mcp_server_enabled" /> |
| 43 | <span class="toggler"></span> |
| 44 | </label> |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <div class="field"> |
| 49 | <div class="field-label"> |
| 50 | <div class="field-title">Internal tools</div> |
| 51 | <div class="field-description"> |
| 52 | Tools exposed by this Agent Zero instance when the internal MCP server is enabled. |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
| 56 | |
| 57 | <div class="mcp-internal-tools"> |
| 58 | <label class="mcp-internal-search"> |
| 59 | <x-icon aria-hidden="true" name="search"></x-icon> |
| 60 | <input type="search" x-model.debounce.150ms="internalToolSearch" placeholder="Search internal tools" /> |
| 61 | <button type="button" x-show="internalToolSearch" @click="internalToolSearch = ''" title="Clear search"> |
| 62 | <x-icon aria-hidden="true" name="close"></x-icon> |
| 63 | </button> |
| 64 | </label> |
| 65 | |
| 66 | <div class="mcp-internal-tool-list"> |
| 67 | <template x-for="tool in filteredInternalTools" :key="tool.name"> |
| 68 | <article class="mcp-internal-tool"> |
| 69 | <div class="mcp-internal-tool-name" x-text="tool.name"></div> |
| 70 | <p x-text="tool.description"></p> |
| 71 | </article> |
| 72 | </template> |
| 73 | <div class="mcp-internal-empty" x-show="filteredInternalTools.length === 0"> |
| 74 | No internal tools match this search. |
| 75 | </div> |
| 76 | </div> |
| 77 | </div> |
| 78 | </div> |
| 79 | </template> |
| 80 | </div> |
| 81 | |
| 82 | <style> |
| 83 | .mcp-internal-tools { |
| 84 | display: flex; |
| 85 | flex-direction: column; |
| 86 | gap: 0.65rem; |
| 87 | margin-top: 0.75rem; |
| 88 | } |
| 89 | |
| 90 | .mcp-internal-search { |
| 91 | display: flex; |
| 92 | align-items: center; |
| 93 | gap: 0.35rem; |
| 94 | min-height: 2.25rem; |
| 95 | padding: 0.25rem 0.5rem; |
| 96 | border: 1px solid var(--color-border); |
| 97 | border-radius: 7px; |
| 98 | background: var(--color-input); |
| 99 | color: var(--color-text-muted); |
| 100 | } |
| 101 | |
| 102 | .mcp-internal-search input { |
| 103 | width: 100%; |
| 104 | min-width: 0; |
| 105 | border: 0; |
| 106 | background: transparent; |
| 107 | color: var(--color-text); |
| 108 | outline: none; |
| 109 | padding: 0.2rem; |
| 110 | } |
| 111 | |
| 112 | .mcp-internal-search input::-webkit-search-cancel-button, |
| 113 | .mcp-internal-search input::-webkit-search-decoration { |
| 114 | -webkit-appearance: none; |
| 115 | appearance: none; |
| 116 | display: none; |
| 117 | } |
| 118 | |
| 119 | .mcp-internal-search button { |
| 120 | display: inline-flex; |
| 121 | align-items: center; |
| 122 | justify-content: center; |
| 123 | width: 1.45rem; |
| 124 | height: 1.45rem; |
| 125 | border: 0; |
| 126 | border-radius: 5px; |
| 127 | background: transparent; |
| 128 | color: var(--color-text-muted); |
| 129 | cursor: pointer; |
| 130 | } |
| 131 | |
| 132 | .mcp-internal-tool-list { |
| 133 | display: flex; |
| 134 | flex-direction: column; |
| 135 | gap: 0.5rem; |
| 136 | } |
| 137 | |
| 138 | .mcp-internal-tool, |
| 139 | .mcp-internal-empty { |
| 140 | padding: 0.75rem; |
| 141 | border: 1px solid var(--color-border); |
| 142 | border-radius: 8px; |
| 143 | background: color-mix(in srgb, var(--color-panel) 88%, transparent); |
| 144 | } |
| 145 | |
| 146 | .mcp-internal-tool-name { |
| 147 | font-weight: 700; |
| 148 | overflow-wrap: anywhere; |
| 149 | } |
| 150 | |
| 151 | .mcp-internal-tool p, |
| 152 | .mcp-internal-empty { |
| 153 | margin: 0.25rem 0 0; |
| 154 | color: var(--color-text-muted); |
| 155 | font-size: 0.86rem; |
| 156 | line-height: 1.4; |
| 157 | } |
| 158 | |
| 159 | .mcp-internal-empty { |
| 160 | margin: 0; |
| 161 | text-align: center; |
| 162 | } |
| 163 | </style> |
| 164 | </body> |
| 165 | </html> |