Skip to content

Commit 666d826

Browse files
Merge pull request #474 from dreamfactorysoftware/develop
Ability to turn on/off mcp tools
2 parents f007b27 + 20cf6e3 commit 666d826

File tree

7 files changed

+475
-2
lines changed

7 files changed

+475
-2
lines changed

dist/7846.aeb0ae4823b8f56f.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/7846.ec7ac8023cd7c3fa.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
<body class="mat-typography">
1111
<df-root></df-root>
1212
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
13-
<script src="runtime.88f333db19f023f3.js" type="module"></script><script src="polyfills.cb64ea9d35bc0a9e.js" type="module"></script><script src="main.a54e1010cb4191bc.js" type="module"></script></body>
13+
<script src="runtime.80f033498e05fea4.js" type="module"></script><script src="polyfills.cb64ea9d35bc0a9e.js" type="module"></script><script src="main.ad26fc0e021d9867.js" type="module"></script></body>
1414
</html>

dist/runtime.80f033498e05fea4.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/adf-services/df-service-details/df-service-details.component.html

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,121 @@ <h4 class="text-center" style="color: black !important">
877877
</ng-container>
878878
</ng-container>
879879
</ng-container>
880+
881+
<!-- MCP Available Services & Tools -->
882+
<ng-container *ngIf="isMcp && edit">
883+
<mat-accordion class="full-width">
884+
<mat-expansion-panel [expanded]="true">
885+
<mat-expansion-panel-header> MCP Tools </mat-expansion-panel-header>
886+
<div class="details-section" *ngIf="!mcpServicesLoaded">
887+
<p>Loading services...</p>
888+
</div>
889+
<div
890+
class="details-section"
891+
*ngIf="
892+
mcpServicesLoaded &&
893+
mcpServices.length === 0 &&
894+
mcpGlobalTools.length === 0
895+
">
896+
<p>No database or file services found.</p>
897+
</div>
898+
<div *ngIf="mcpServicesLoaded" class="mcp-tools-container">
899+
<mat-accordion multi>
900+
<!-- Global (cross-service) tools -->
901+
<mat-expansion-panel>
902+
<mat-expansion-panel-header>
903+
<mat-panel-title class="mcp-service-header">
904+
<mat-slide-toggle
905+
color="primary"
906+
[checked]="isAllGlobalToolsEnabled()"
907+
(change)="toggleAllGlobalTools($event.checked)"
908+
(click)="$event.stopPropagation()">
909+
</mat-slide-toggle>
910+
<span>Global Tools</span>
911+
</mat-panel-title>
912+
<mat-panel-description>
913+
Cross-service &middot; {{ mcpGlobalTools.length }} tools
914+
</mat-panel-description>
915+
</mat-expansion-panel-header>
916+
<table class="mcp-services-table full-width">
917+
<thead>
918+
<tr>
919+
<th class="toggle-col"></th>
920+
<th>Tool Name</th>
921+
<th>Description</th>
922+
</tr>
923+
</thead>
924+
<tbody>
925+
<tr
926+
*ngFor="let tool of mcpGlobalTools"
927+
[class.disabled-row]="!isToolEnabled(tool.name)">
928+
<td class="toggle-col">
929+
<mat-slide-toggle
930+
color="primary"
931+
[checked]="isToolEnabled(tool.name)"
932+
(change)="toggleTool(tool.name, $event.checked)">
933+
</mat-slide-toggle>
934+
</td>
935+
<td>
936+
<code>{{ tool.name }}</code>
937+
</td>
938+
<td>{{ tool.description }}</td>
939+
</tr>
940+
</tbody>
941+
</table>
942+
</mat-expansion-panel>
943+
944+
<!-- Per-service tools -->
945+
<mat-expansion-panel
946+
*ngFor="let svc of mcpServices"
947+
[expanded]="svc.expanded">
948+
<mat-expansion-panel-header>
949+
<mat-panel-title class="mcp-service-header">
950+
<mat-slide-toggle
951+
color="primary"
952+
[checked]="isServiceEnabled(svc)"
953+
(change)="toggleService(svc, $event.checked)"
954+
(click)="$event.stopPropagation()">
955+
</mat-slide-toggle>
956+
<span>{{ svc.label }}</span>
957+
</mat-panel-title>
958+
<mat-panel-description>
959+
{{ svc.category }} &middot; {{ svc.tools.length }} tools
960+
</mat-panel-description>
961+
</mat-expansion-panel-header>
962+
<table class="mcp-services-table full-width">
963+
<thead>
964+
<tr>
965+
<th class="toggle-col"></th>
966+
<th>Tool Name</th>
967+
<th>Description</th>
968+
</tr>
969+
</thead>
970+
<tbody>
971+
<tr
972+
*ngFor="let tool of svc.tools"
973+
[class.disabled-row]="!isToolEnabled(tool.name)">
974+
<td class="toggle-col">
975+
<mat-slide-toggle
976+
color="primary"
977+
[checked]="isToolEnabled(tool.name)"
978+
(change)="toggleTool(tool.name, $event.checked)">
979+
</mat-slide-toggle>
980+
</td>
981+
<td>
982+
<code>{{ tool.name }}</code>
983+
</td>
984+
<td>{{ tool.description }}</td>
985+
</tr>
986+
</tbody>
987+
</table>
988+
</mat-expansion-panel>
989+
</mat-accordion>
990+
</div>
991+
</mat-expansion-panel>
992+
</mat-accordion>
993+
</ng-container>
994+
880995
<div class="full-width action-bar" *ngIf="!subscriptionRequired">
881996
<button
882997
mat-flat-button

src/app/adf-services/df-service-details/df-service-details.component.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,55 @@ mat-icon {
579579
}
580580
}
581581

582+
.mcp-tools-container {
583+
padding: 8px 0;
584+
585+
code {
586+
font-size: 12px;
587+
padding: 2px 6px;
588+
background: rgba(0, 0, 0, 0.06);
589+
border-radius: 4px;
590+
white-space: nowrap;
591+
}
592+
}
593+
594+
.mcp-service-header {
595+
display: flex;
596+
align-items: center;
597+
gap: 12px;
598+
}
599+
600+
.toggle-col {
601+
width: 60px;
602+
}
603+
604+
.disabled-row {
605+
opacity: 0.5;
606+
}
607+
608+
.mcp-services-table {
609+
width: 100%;
610+
border-collapse: collapse;
611+
612+
th,
613+
td {
614+
text-align: left;
615+
padding: 8px 12px;
616+
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
617+
}
618+
619+
th {
620+
font-weight: 500;
621+
color: rgba(0, 0, 0, 0.6);
622+
font-size: 12px;
623+
text-transform: uppercase;
624+
}
625+
626+
td {
627+
font-size: 14px;
628+
}
629+
}
630+
582631
.basic-fields-section {
583632
margin-bottom: 2rem;
584633

0 commit comments

Comments
 (0)