Add MCP assistant panel to dashboard by Vivek1106-04 · Pull Request #52 · apache/asterixdb · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class QueryWebInterfaceServletRegistrant implements IQueryWebServerRegist

@Override
public void register(ICcApplicationContext appCtx, HttpServer webServer) {
// Same-origin MCP gateway proxy (off unless asterix.mcp.enabled is set).
// Registered before the static "/*" servlet so /mcp is matched first.
webServer.addServlet(new MCPProxyServlet(webServer.ctx(), "/mcp", "/mcp/*"));
webServer.addServlet(new QueryWebInterfaceServlet(appCtx, webServer.ctx(), "/*"));
}
}
11 changes: 11 additions & 0 deletions asterixdb/asterix-dashboard/src/node/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions asterixdb/asterix-dashboard/src/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
"@swimlane/ngx-charts": "23.1.0",
"@swimlane/ngx-graph": "11.0.0",
"codemirror": "5.65.18",
"dompurify": "^3.4.11",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other dependency in this file is pinned exactly (codemirror: 5.65.18, lodash: 4.17.23, and so on), and these two use caret ranges. Worth matching the convention. To be precise about why: bun.lock is committed, so installs are already reproducible. Pinning here is about following the file's existing convention and avoiding a silent minor or patch bump the next time the lockfile is regenerated.

Separate question while you are here, and not a blocker: could you confirm the generated third-party license inventory picked up DOMPurify and marked, and that their licenses are fine under the project's dependency policy? DOMPurify is Apache-2.0 or MPL-2.0 dual and marked is MIT, so I expect this is fine, but the 3rdpartylicenses.txt regeneration is 1302 lines of churn in this commit and it would be good to know that was a clean regeneration.

"file-saver": "2.0.5",
"lodash": "4.17.23",
"marked": "^18.0.5",
"roboto-fontface": "0.10.0",
"rxjs": "7.8.2",
"tslib": "2.8.1",
Expand All @@ -41,6 +43,7 @@
"@angular-devkit/build-angular": "21.2.3",
"@angular/cli": "21.2.3",
"@angular/compiler-cli": "21.2.3",
"@types/dompurify": "^3.2.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can just go. DOMPurify has shipped its own type definitions since v3, and @types/dompurify@3.2.0 is a deprecated stub package whose only content is a dependency back on dompurify. Removing it should not change anything at the type level.

"@types/file-saver": "2.0.7",
"@types/jasmine": "5.1.4",
"@types/node": "22.15.0",
Expand Down
7 changes: 7 additions & 0 deletions asterixdb/asterix-dashboard/src/node/proxy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const PROXY_CONFIG = {
"target": "http://localhost:19002",
"secure": false,
logLevel: "debug"
},
"/mcp": {
"target": "http://127.0.0.1:19200",
"secure": false,
"ws": true,
"changeOrigin": true,
logLevel: "debug"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@
limitations under the License.
*/-->
<awc-bar></awc-bar>
<awc-tab></awc-tab>
<div class="awc-body">
<div class="awc-main">
<awc-tab></awc-tab>
</div>
<awc-mcp-panel></awc-mcp-panel>
</div>
26 changes: 25 additions & 1 deletion asterixdb/asterix-dashboard/src/node/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,28 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Place holder for future expansion
// Fixed-height app shell: the viewport never scrolls as a whole; the main
// content scrolls internally and the MCP side panel fills the remaining height
// exactly (so its composer stays pinned at the bottom).
:host {
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}

// Main content and the MCP side panel sit side by side; the panel is in-flow
// (not floating) so it reflows the content rather than overlaying it.
.awc-body {
display: flex;
flex: 1 1 auto;
min-height: 0;
align-items: stretch;
}

.awc-main {
flex: 1 1 auto;
min-width: 0;
height: 100%;
overflow: auto;
}
14 changes: 12 additions & 2 deletions asterixdb/asterix-dashboard/src/node/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ import { PlanViewerComponent } from "./dashboard/query/plan-viewer.component";
import { TreeNodeComponent } from './dashboard/query/tree-node.component';
import { DialogExportPicker, TreeViewComponent } from './dashboard/query/tree-view.component';
import {SQLCancelEffects} from "./shared/effects/cancel.effects";
import { MCPEffects } from './shared/effects/mcp.effects';
import { MCPClientService } from './shared/services/mcp-client.service';
import { LLMService } from './shared/services/llm.service';
import { ChatHistoryService } from './shared/services/chat-history.service';
import { MCPPanelComponent } from './dashboard/mcp/mcp-panel.component';
import { MCPAssistantComponent } from './dashboard/mcp/mcp-assistant.component';
import { MarkdownPipe } from './shared/pipes/markdown.pipe';

@NgModule({
declarations: [
Expand All @@ -57,12 +64,15 @@ import {SQLCancelEffects} from "./shared/effects/cancel.effects";
TreeNodeComponent,
DialogExportPicker,
TreeViewComponent,
MCPPanelComponent,
MCPAssistantComponent,
MarkdownPipe,
],
imports: [
FormsModule,
BrowserModule,
BrowserAnimationsModule,
EffectsModule.forRoot([AppEffects, DataverseEffects, DatasetEffects, DatatypeEffects, IndexEffects, FunctionEffects, SQLQueryEffects, SQLCancelEffects]),
EffectsModule.forRoot([AppEffects, DataverseEffects, DatasetEffects, DatatypeEffects, IndexEffects, FunctionEffects, SQLQueryEffects, SQLCancelEffects, MCPEffects]),
HttpClientModule,
MaterialModule,
StoreModule.forRoot(reducers, {
Expand All @@ -80,7 +90,7 @@ import {SQLCancelEffects} from "./shared/effects/cancel.effects";
NgxChartsModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [SQLService],
providers: [SQLService, MCPClientService, LLMService, ChatHistoryService],
bootstrap: [AppComponent]
})
export class AppModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<a mat-button class="menu awc-button docs-navbar-hide-small" href="https://github.com/apache/asterixdb/" target="_blank" aria-label="GITHUB">
GITHUB
</a>
<button mat-button class="menu awc-button" (click)="openMCPPanel()" aria-label="MCP ASSISTANT">
MCP
</button>
</div>
</nav>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ limitations under the License.
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import * as appActions from '../shared/actions/app.actions'
import * as mcpActions from '../shared/actions/mcp.actions'

@Component({
standalone: false,
Expand All @@ -24,4 +25,9 @@ import * as appActions from '../shared/actions/app.actions'

export class AppBarComponent {
constructor(private store: Store <any> ) {}

/* Opens the MCP side panel (the gateway tool surface). */
openMCPPanel() {
this.store.dispatch(new mcpActions.TogglePanel(true));
}
}
Loading