@mcp-shark/mcp-shark 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +85 -0
- package/README.md +724 -0
- package/bin/mcp-shark.js +93 -0
- package/mcp-server/.editorconfig +15 -0
- package/mcp-server/.prettierignore +11 -0
- package/mcp-server/.prettierrc +12 -0
- package/mcp-server/README.md +280 -0
- package/mcp-server/commitlint.config.cjs +42 -0
- package/mcp-server/eslint.config.js +131 -0
- package/mcp-server/lib/auditor/audit.js +228 -0
- package/mcp-server/lib/common/error.js +15 -0
- package/mcp-server/lib/server/external/all.js +32 -0
- package/mcp-server/lib/server/external/config.js +59 -0
- package/mcp-server/lib/server/external/kv.js +102 -0
- package/mcp-server/lib/server/external/single/client.js +35 -0
- package/mcp-server/lib/server/external/single/request.js +49 -0
- package/mcp-server/lib/server/external/single/run.js +75 -0
- package/mcp-server/lib/server/external/single/transport.js +57 -0
- package/mcp-server/lib/server/internal/handlers/common.js +20 -0
- package/mcp-server/lib/server/internal/handlers/error.js +7 -0
- package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
- package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
- package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
- package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
- package/mcp-server/lib/server/internal/run.js +49 -0
- package/mcp-server/lib/server/internal/server.js +63 -0
- package/mcp-server/lib/server/internal/session.js +39 -0
- package/mcp-server/mcp-shark.js +72 -0
- package/mcp-server/package-lock.json +4784 -0
- package/mcp-server/package.json +30 -0
- package/package.json +103 -0
- package/ui/README.md +212 -0
- package/ui/index.html +16 -0
- package/ui/package-lock.json +3574 -0
- package/ui/package.json +12 -0
- package/ui/paths.js +282 -0
- package/ui/public/og-image.png +0 -0
- package/ui/server/routes/backups.js +251 -0
- package/ui/server/routes/composite.js +244 -0
- package/ui/server/routes/config.js +175 -0
- package/ui/server/routes/conversations.js +25 -0
- package/ui/server/routes/help.js +43 -0
- package/ui/server/routes/logs.js +32 -0
- package/ui/server/routes/playground.js +152 -0
- package/ui/server/routes/requests.js +235 -0
- package/ui/server/routes/sessions.js +27 -0
- package/ui/server/routes/smartscan/discover.js +117 -0
- package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
- package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
- package/ui/server/routes/smartscan/scans/createScan.js +42 -0
- package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
- package/ui/server/routes/smartscan/scans/getScan.js +41 -0
- package/ui/server/routes/smartscan/scans/listScans.js +24 -0
- package/ui/server/routes/smartscan/scans.js +13 -0
- package/ui/server/routes/smartscan/token.js +56 -0
- package/ui/server/routes/smartscan/transport.js +53 -0
- package/ui/server/routes/smartscan.js +24 -0
- package/ui/server/routes/statistics.js +83 -0
- package/ui/server/utils/config-update.js +212 -0
- package/ui/server/utils/config.js +98 -0
- package/ui/server/utils/paths.js +23 -0
- package/ui/server/utils/port.js +28 -0
- package/ui/server/utils/process.js +80 -0
- package/ui/server/utils/scan-cache/all-results.js +180 -0
- package/ui/server/utils/scan-cache/directory.js +35 -0
- package/ui/server/utils/scan-cache/file-operations.js +104 -0
- package/ui/server/utils/scan-cache/hash.js +47 -0
- package/ui/server/utils/scan-cache/server-operations.js +80 -0
- package/ui/server/utils/scan-cache.js +12 -0
- package/ui/server/utils/serialization.js +13 -0
- package/ui/server/utils/smartscan-token.js +42 -0
- package/ui/server.js +199 -0
- package/ui/src/App.jsx +153 -0
- package/ui/src/CompositeLogs.jsx +164 -0
- package/ui/src/CompositeSetup.jsx +285 -0
- package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
- package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
- package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
- package/ui/src/HelpGuide.jsx +65 -0
- package/ui/src/IntroTour.jsx +140 -0
- package/ui/src/LogDetail.jsx +122 -0
- package/ui/src/LogTable.jsx +242 -0
- package/ui/src/PacketDetail.jsx +190 -0
- package/ui/src/PacketFilters.jsx +222 -0
- package/ui/src/PacketList.jsx +183 -0
- package/ui/src/SmartScan.jsx +178 -0
- package/ui/src/TabNavigation.jsx +143 -0
- package/ui/src/components/App/HelpButton.jsx +64 -0
- package/ui/src/components/App/TrafficTab.jsx +69 -0
- package/ui/src/components/App/useAppState.js +163 -0
- package/ui/src/components/BackupList.jsx +192 -0
- package/ui/src/components/CollapsibleSection.jsx +82 -0
- package/ui/src/components/ConfigFileSection.jsx +84 -0
- package/ui/src/components/ConfigViewerModal.jsx +141 -0
- package/ui/src/components/ConfirmationModal.jsx +129 -0
- package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
- package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
- package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
- package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
- package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
- package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
- package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
- package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
- package/ui/src/components/DetailsTab.jsx +31 -0
- package/ui/src/components/DetectedPathsList.jsx +171 -0
- package/ui/src/components/FileInput.jsx +144 -0
- package/ui/src/components/GroupHeader.jsx +76 -0
- package/ui/src/components/GroupedByMcpView.jsx +103 -0
- package/ui/src/components/GroupedByServerView.jsx +134 -0
- package/ui/src/components/GroupedBySessionView.jsx +127 -0
- package/ui/src/components/GroupedViews.jsx +2 -0
- package/ui/src/components/HexTab.jsx +188 -0
- package/ui/src/components/LogsDisplay.jsx +93 -0
- package/ui/src/components/LogsToolbar.jsx +193 -0
- package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
- package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
- package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
- package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
- package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
- package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
- package/ui/src/components/McpPlayground.jsx +171 -0
- package/ui/src/components/MessageDisplay.jsx +28 -0
- package/ui/src/components/PacketDetailHeader.jsx +88 -0
- package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
- package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
- package/ui/src/components/RawTab.jsx +142 -0
- package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
- package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
- package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
- package/ui/src/components/RequestRow.jsx +70 -0
- package/ui/src/components/ServerControl.jsx +133 -0
- package/ui/src/components/ServiceSelector.jsx +209 -0
- package/ui/src/components/SetupHeader.jsx +30 -0
- package/ui/src/components/SharkLogo.jsx +21 -0
- package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
- package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
- package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
- package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
- package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
- package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
- package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
- package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
- package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
- package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
- package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
- package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
- package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
- package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
- package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
- package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
- package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
- package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
- package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
- package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
- package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
- package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
- package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
- package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
- package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
- package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
- package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
- package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
- package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
- package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
- package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
- package/ui/src/components/SmartScan/useSmartScan.js +72 -0
- package/ui/src/components/SmartScan/utils.js +19 -0
- package/ui/src/components/SmartScanIcons.jsx +58 -0
- package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
- package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
- package/ui/src/components/TabNavigation.jsx +97 -0
- package/ui/src/components/TabNavigationIcons.jsx +40 -0
- package/ui/src/components/TableHeader.jsx +164 -0
- package/ui/src/components/TourOverlay.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
- package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
- package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
- package/ui/src/components/TourTooltip.jsx +83 -0
- package/ui/src/components/ViewModeTabs.jsx +91 -0
- package/ui/src/components/WhatThisDoesSection.jsx +61 -0
- package/ui/src/config/tourSteps.jsx +141 -0
- package/ui/src/hooks/useAnimation.js +92 -0
- package/ui/src/hooks/useConfigManagement.js +124 -0
- package/ui/src/hooks/useServiceExtraction.js +51 -0
- package/ui/src/index.css +42 -0
- package/ui/src/main.jsx +10 -0
- package/ui/src/theme.js +65 -0
- package/ui/src/utils/animations.js +170 -0
- package/ui/src/utils/groupingUtils.js +93 -0
- package/ui/src/utils/hexUtils.js +24 -0
- package/ui/src/utils/mcpGroupingUtils.js +262 -0
- package/ui/src/utils/requestUtils.js +297 -0
- package/ui/vite.config.js +18 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import {
|
|
3
|
+
formatRelativeTime,
|
|
4
|
+
formatDateTime,
|
|
5
|
+
getSourceDest,
|
|
6
|
+
getEndpoint,
|
|
7
|
+
} from '../../utils/requestUtils.js';
|
|
8
|
+
|
|
9
|
+
export default function ResponseRow({ response, selected, firstRequestTime, onSelect, request }) {
|
|
10
|
+
const isSelected = selected?.frame_number === response.frame_number;
|
|
11
|
+
const { source, dest } = getSourceDest(response);
|
|
12
|
+
const relativeTime = formatRelativeTime(response.timestamp_iso, firstRequestTime);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<tr
|
|
16
|
+
onClick={() => onSelect(response)}
|
|
17
|
+
style={{
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
background:
|
|
20
|
+
isSelected && selected?.frame_number === response.frame_number
|
|
21
|
+
? colors.bgSelected
|
|
22
|
+
: colors.bgTertiary,
|
|
23
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
24
|
+
fontFamily: fonts.body,
|
|
25
|
+
transition: 'background-color 0.15s ease',
|
|
26
|
+
}}
|
|
27
|
+
onMouseEnter={(e) => {
|
|
28
|
+
if (!(isSelected && selected?.frame_number === response.frame_number)) {
|
|
29
|
+
e.currentTarget.style.background = colors.bgSecondary;
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
onMouseLeave={(e) => {
|
|
33
|
+
if (!(isSelected && selected?.frame_number === response.frame_number)) {
|
|
34
|
+
e.currentTarget.style.background = colors.bgTertiary;
|
|
35
|
+
}
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<td
|
|
39
|
+
style={{
|
|
40
|
+
padding: '16px',
|
|
41
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
42
|
+
color: colors.textPrimary,
|
|
43
|
+
textAlign: 'right',
|
|
44
|
+
fontFamily: fonts.mono,
|
|
45
|
+
fontSize: '12px',
|
|
46
|
+
paddingLeft: '40px',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<span style={{ color: colors.accentGreen, fontWeight: '500' }}>
|
|
50
|
+
#{response.frame_number}
|
|
51
|
+
</span>
|
|
52
|
+
</td>
|
|
53
|
+
<td
|
|
54
|
+
style={{
|
|
55
|
+
padding: '16px',
|
|
56
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
57
|
+
color: colors.textPrimary,
|
|
58
|
+
fontFamily: fonts.mono,
|
|
59
|
+
fontSize: '12px',
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
{relativeTime}
|
|
63
|
+
</td>
|
|
64
|
+
<td
|
|
65
|
+
style={{
|
|
66
|
+
padding: '16px',
|
|
67
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
68
|
+
color: colors.textPrimary,
|
|
69
|
+
fontFamily: fonts.body,
|
|
70
|
+
fontSize: '12px',
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{formatDateTime(response.timestamp_iso)}
|
|
74
|
+
</td>
|
|
75
|
+
<td
|
|
76
|
+
style={{
|
|
77
|
+
padding: '16px',
|
|
78
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
79
|
+
color: colors.accentGreen,
|
|
80
|
+
fontFamily: fonts.mono,
|
|
81
|
+
fontSize: '12px',
|
|
82
|
+
fontWeight: '500',
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{source}
|
|
86
|
+
</td>
|
|
87
|
+
<td
|
|
88
|
+
style={{
|
|
89
|
+
padding: '16px',
|
|
90
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
91
|
+
color: colors.accentGreen,
|
|
92
|
+
fontFamily: fonts.mono,
|
|
93
|
+
fontSize: '12px',
|
|
94
|
+
fontWeight: '500',
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
{dest}
|
|
98
|
+
</td>
|
|
99
|
+
<td
|
|
100
|
+
style={{
|
|
101
|
+
padding: '16px',
|
|
102
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
103
|
+
color: colors.textPrimary,
|
|
104
|
+
fontFamily: fonts.mono,
|
|
105
|
+
fontSize: '12px',
|
|
106
|
+
fontWeight: '500',
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
{response.protocol || 'HTTP'}
|
|
110
|
+
</td>
|
|
111
|
+
<td
|
|
112
|
+
style={{
|
|
113
|
+
padding: '16px',
|
|
114
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
115
|
+
color: colors.textSecondary,
|
|
116
|
+
fontFamily: fonts.mono,
|
|
117
|
+
fontSize: '12px',
|
|
118
|
+
fontWeight: '500',
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
-
|
|
122
|
+
</td>
|
|
123
|
+
<td
|
|
124
|
+
style={{
|
|
125
|
+
padding: '16px',
|
|
126
|
+
borderRight: `1px solid ${colors.borderLight}`,
|
|
127
|
+
fontFamily: fonts.mono,
|
|
128
|
+
fontSize: '12px',
|
|
129
|
+
fontWeight: '500',
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
<div
|
|
133
|
+
style={{
|
|
134
|
+
color:
|
|
135
|
+
response.status_code >= 400
|
|
136
|
+
? colors.error
|
|
137
|
+
: response.status_code >= 300
|
|
138
|
+
? colors.warning
|
|
139
|
+
: colors.success,
|
|
140
|
+
fontWeight: '600',
|
|
141
|
+
}}
|
|
142
|
+
>
|
|
143
|
+
{response.status_code || '-'}
|
|
144
|
+
</div>
|
|
145
|
+
</td>
|
|
146
|
+
<td
|
|
147
|
+
style={{
|
|
148
|
+
padding: '16px',
|
|
149
|
+
color: colors.textPrimary,
|
|
150
|
+
fontFamily: fonts.mono,
|
|
151
|
+
fontSize: '12px',
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
{getEndpoint(response)}
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import OrphanedResponseRow from './RequestRow/OrphanedResponseRow';
|
|
2
|
+
import RequestRowMain from './RequestRow/RequestRowMain';
|
|
3
|
+
import ResponseRow from './RequestRow/ResponseRow';
|
|
4
|
+
|
|
5
|
+
function RequestRow({
|
|
6
|
+
pair,
|
|
7
|
+
request: requestProp,
|
|
8
|
+
selected,
|
|
9
|
+
firstRequestTime,
|
|
10
|
+
onSelect,
|
|
11
|
+
isExpanded = false,
|
|
12
|
+
onToggleExpand = () => {},
|
|
13
|
+
}) {
|
|
14
|
+
// Support both pair prop (new) and request prop (legacy for grouped views)
|
|
15
|
+
let request, response;
|
|
16
|
+
if (pair) {
|
|
17
|
+
request = pair.request;
|
|
18
|
+
response = pair.response;
|
|
19
|
+
} else if (requestProp) {
|
|
20
|
+
request = requestProp;
|
|
21
|
+
response = null;
|
|
22
|
+
} else {
|
|
23
|
+
return null; // No valid data
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Check if this is an unpaired request or response
|
|
27
|
+
const isUnpaired = !request || !response;
|
|
28
|
+
|
|
29
|
+
// Handle orphaned response (response without request)
|
|
30
|
+
if (!request && response) {
|
|
31
|
+
return (
|
|
32
|
+
<OrphanedResponseRow
|
|
33
|
+
response={response}
|
|
34
|
+
selected={selected}
|
|
35
|
+
firstRequestTime={firstRequestTime}
|
|
36
|
+
onSelect={onSelect}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!request) return null; // Only show rows that have a request
|
|
42
|
+
|
|
43
|
+
const hasResponse = !!response;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<RequestRowMain
|
|
48
|
+
request={request}
|
|
49
|
+
response={response}
|
|
50
|
+
selected={selected}
|
|
51
|
+
firstRequestTime={firstRequestTime}
|
|
52
|
+
onSelect={onSelect}
|
|
53
|
+
isExpanded={isExpanded}
|
|
54
|
+
onToggleExpand={onToggleExpand}
|
|
55
|
+
isUnpaired={isUnpaired}
|
|
56
|
+
/>
|
|
57
|
+
{hasResponse && isExpanded && (
|
|
58
|
+
<ResponseRow
|
|
59
|
+
response={response}
|
|
60
|
+
selected={selected}
|
|
61
|
+
firstRequestTime={firstRequestTime}
|
|
62
|
+
onSelect={onSelect}
|
|
63
|
+
request={request}
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default RequestRow;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
|
|
3
|
+
function ServerControl({ status, loading, onStart, onStop, canStart }) {
|
|
4
|
+
return (
|
|
5
|
+
<div
|
|
6
|
+
style={{
|
|
7
|
+
background: colors.bgCard,
|
|
8
|
+
border: `1px solid ${colors.borderLight}`,
|
|
9
|
+
borderRadius: '12px',
|
|
10
|
+
padding: '24px',
|
|
11
|
+
marginBottom: '20px',
|
|
12
|
+
boxShadow: `0 2px 4px ${colors.shadowSm}`,
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<div style={{ marginBottom: '16px' }}>
|
|
16
|
+
<h3
|
|
17
|
+
style={{
|
|
18
|
+
fontSize: '15px',
|
|
19
|
+
fontWeight: '600',
|
|
20
|
+
marginBottom: '8px',
|
|
21
|
+
color: colors.textPrimary,
|
|
22
|
+
fontFamily: fonts.body,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
Server Control
|
|
26
|
+
</h3>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div style={{ display: 'flex', gap: '12px', alignItems: 'center', flexWrap: 'wrap' }}>
|
|
30
|
+
{status.running ? (
|
|
31
|
+
<button
|
|
32
|
+
onClick={onStop}
|
|
33
|
+
disabled={loading}
|
|
34
|
+
style={{
|
|
35
|
+
padding: '10px 20px',
|
|
36
|
+
background: colors.buttonDanger,
|
|
37
|
+
border: `1px solid ${colors.buttonDanger}`,
|
|
38
|
+
color: colors.textInverse,
|
|
39
|
+
cursor: loading ? 'not-allowed' : 'pointer',
|
|
40
|
+
fontSize: '13px',
|
|
41
|
+
fontFamily: fonts.body,
|
|
42
|
+
fontWeight: '500',
|
|
43
|
+
borderRadius: '8px',
|
|
44
|
+
opacity: loading ? 0.5 : 1,
|
|
45
|
+
transition: 'all 0.2s',
|
|
46
|
+
boxShadow: `0 2px 4px ${colors.shadowSm}`,
|
|
47
|
+
}}
|
|
48
|
+
onMouseEnter={(e) => {
|
|
49
|
+
if (!loading) {
|
|
50
|
+
e.currentTarget.style.background = colors.buttonDangerHover;
|
|
51
|
+
e.currentTarget.style.transform = 'translateY(-1px)';
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
onMouseLeave={(e) => {
|
|
55
|
+
e.currentTarget.style.background = colors.buttonDanger;
|
|
56
|
+
e.currentTarget.style.transform = 'translateY(0)';
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{loading ? 'Stopping...' : 'Stop MCP Shark'}
|
|
60
|
+
</button>
|
|
61
|
+
) : (
|
|
62
|
+
<button
|
|
63
|
+
data-tour="start-button"
|
|
64
|
+
onClick={onStart}
|
|
65
|
+
disabled={loading || !canStart}
|
|
66
|
+
style={{
|
|
67
|
+
padding: '10px 20px',
|
|
68
|
+
background: colors.buttonPrimary,
|
|
69
|
+
border: `1px solid ${colors.buttonPrimary}`,
|
|
70
|
+
color: colors.textInverse,
|
|
71
|
+
cursor: loading || !canStart ? 'not-allowed' : 'pointer',
|
|
72
|
+
fontSize: '13px',
|
|
73
|
+
fontFamily: fonts.body,
|
|
74
|
+
fontWeight: '500',
|
|
75
|
+
borderRadius: '8px',
|
|
76
|
+
opacity: loading || !canStart ? 0.5 : 1,
|
|
77
|
+
transition: 'all 0.2s',
|
|
78
|
+
boxShadow: `0 2px 4px ${colors.shadowSm}`,
|
|
79
|
+
}}
|
|
80
|
+
onMouseEnter={(e) => {
|
|
81
|
+
if (!loading && canStart) {
|
|
82
|
+
e.currentTarget.style.background = colors.buttonPrimaryHover;
|
|
83
|
+
e.currentTarget.style.transform = 'translateY(-1px)';
|
|
84
|
+
}
|
|
85
|
+
}}
|
|
86
|
+
onMouseLeave={(e) => {
|
|
87
|
+
e.currentTarget.style.background = colors.buttonPrimary;
|
|
88
|
+
e.currentTarget.style.transform = 'translateY(0)';
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{loading ? 'Processing...' : 'Start MCP Shark'}
|
|
92
|
+
</button>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
<div
|
|
96
|
+
style={{
|
|
97
|
+
marginLeft: 'auto',
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: '10px',
|
|
101
|
+
padding: '8px 16px',
|
|
102
|
+
background: colors.bgPrimary,
|
|
103
|
+
border: `1px solid ${colors.borderLight}`,
|
|
104
|
+
borderRadius: '8px',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
style={{
|
|
109
|
+
width: '10px',
|
|
110
|
+
height: '10px',
|
|
111
|
+
borderRadius: '50%',
|
|
112
|
+
background: status.running ? colors.success : colors.textTertiary,
|
|
113
|
+
boxShadow: status.running ? `0 0 8px ${colors.success}80` : 'none',
|
|
114
|
+
transition: 'all 0.3s',
|
|
115
|
+
}}
|
|
116
|
+
/>
|
|
117
|
+
<span
|
|
118
|
+
style={{
|
|
119
|
+
color: colors.textPrimary,
|
|
120
|
+
fontSize: '13px',
|
|
121
|
+
fontWeight: '500',
|
|
122
|
+
fontFamily: fonts.body,
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
{status.running ? `Running (PID: ${status.pid})` : 'Stopped'}
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export default ServerControl;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { colors, fonts, withOpacity } from '../theme';
|
|
2
|
+
|
|
3
|
+
function ServiceSelector({ services, selectedServices, onSelectionChange }) {
|
|
4
|
+
if (services.length === 0) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<div style={{ marginTop: '16px' }}>
|
|
10
|
+
<div style={{ marginBottom: '12px' }}>
|
|
11
|
+
<h3
|
|
12
|
+
style={{
|
|
13
|
+
fontSize: '15px',
|
|
14
|
+
fontWeight: '600',
|
|
15
|
+
marginBottom: '8px',
|
|
16
|
+
color: colors.textPrimary,
|
|
17
|
+
fontFamily: fonts.body,
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
Select Services
|
|
21
|
+
</h3>
|
|
22
|
+
<p
|
|
23
|
+
style={{
|
|
24
|
+
fontSize: '13px',
|
|
25
|
+
color: colors.textSecondary,
|
|
26
|
+
lineHeight: '1.5',
|
|
27
|
+
fontFamily: fonts.body,
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
Choose which services to include in the MCP Shark server. Only selected services will be
|
|
31
|
+
available.
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
display: 'flex',
|
|
37
|
+
gap: '8px',
|
|
38
|
+
marginBottom: '12px',
|
|
39
|
+
flexWrap: 'wrap',
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<button
|
|
43
|
+
onClick={() => {
|
|
44
|
+
onSelectionChange(new Set(services.map((s) => s.name)));
|
|
45
|
+
}}
|
|
46
|
+
style={{
|
|
47
|
+
padding: '4px 12px',
|
|
48
|
+
background: 'transparent',
|
|
49
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
50
|
+
color: colors.textSecondary,
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
fontSize: '12px',
|
|
53
|
+
borderRadius: '8px',
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
Select All
|
|
57
|
+
</button>
|
|
58
|
+
<button
|
|
59
|
+
onClick={() => {
|
|
60
|
+
onSelectionChange(new Set());
|
|
61
|
+
}}
|
|
62
|
+
style={{
|
|
63
|
+
padding: '4px 12px',
|
|
64
|
+
background: 'transparent',
|
|
65
|
+
border: `1px solid ${colors.borderMedium}`,
|
|
66
|
+
color: colors.textSecondary,
|
|
67
|
+
cursor: 'pointer',
|
|
68
|
+
fontSize: '12px',
|
|
69
|
+
borderRadius: '8px',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
Deselect All
|
|
73
|
+
</button>
|
|
74
|
+
<div
|
|
75
|
+
style={{
|
|
76
|
+
marginLeft: 'auto',
|
|
77
|
+
fontSize: '12px',
|
|
78
|
+
color: colors.textSecondary,
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
{selectedServices.size} of {services.length} selected
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div
|
|
87
|
+
style={{
|
|
88
|
+
display: 'flex',
|
|
89
|
+
flexDirection: 'column',
|
|
90
|
+
gap: '8px',
|
|
91
|
+
maxHeight: '300px',
|
|
92
|
+
overflowY: 'auto',
|
|
93
|
+
padding: '8px',
|
|
94
|
+
background: colors.bgPrimary,
|
|
95
|
+
borderRadius: '4px',
|
|
96
|
+
border: `1px solid ${colors.borderLight}`,
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{services.map((service) => {
|
|
100
|
+
const isSelected = selectedServices.has(service.name);
|
|
101
|
+
return (
|
|
102
|
+
<label
|
|
103
|
+
key={service.name}
|
|
104
|
+
style={{
|
|
105
|
+
display: 'flex',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
gap: '12px',
|
|
108
|
+
padding: '10px',
|
|
109
|
+
background: isSelected ? colors.bgSelected : 'transparent',
|
|
110
|
+
border: `1px solid ${isSelected ? colors.accentBlue : colors.borderMedium}`,
|
|
111
|
+
borderRadius: '8px',
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
transition: 'all 0.2s',
|
|
114
|
+
}}
|
|
115
|
+
onMouseEnter={(e) => {
|
|
116
|
+
if (!isSelected) {
|
|
117
|
+
e.currentTarget.style.background = colors.bgHover;
|
|
118
|
+
}
|
|
119
|
+
}}
|
|
120
|
+
onMouseLeave={(e) => {
|
|
121
|
+
if (!isSelected) {
|
|
122
|
+
e.currentTarget.style.background = 'transparent';
|
|
123
|
+
}
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
<input
|
|
127
|
+
type="checkbox"
|
|
128
|
+
checked={isSelected}
|
|
129
|
+
onChange={(e) => {
|
|
130
|
+
const newSelected = new Set(selectedServices);
|
|
131
|
+
if (e.target.checked) {
|
|
132
|
+
newSelected.add(service.name);
|
|
133
|
+
} else {
|
|
134
|
+
newSelected.delete(service.name);
|
|
135
|
+
}
|
|
136
|
+
onSelectionChange(newSelected);
|
|
137
|
+
}}
|
|
138
|
+
style={{
|
|
139
|
+
width: '18px',
|
|
140
|
+
height: '18px',
|
|
141
|
+
cursor: 'pointer',
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
<div style={{ flex: 1 }}>
|
|
145
|
+
<div
|
|
146
|
+
style={{
|
|
147
|
+
fontWeight: '500',
|
|
148
|
+
color: colors.textPrimary,
|
|
149
|
+
fontSize: '13px',
|
|
150
|
+
marginBottom: '4px',
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
{service.name}
|
|
154
|
+
</div>
|
|
155
|
+
<div
|
|
156
|
+
style={{
|
|
157
|
+
fontSize: '11px',
|
|
158
|
+
color: colors.textSecondary,
|
|
159
|
+
display: 'flex',
|
|
160
|
+
gap: '12px',
|
|
161
|
+
flexWrap: 'wrap',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<span
|
|
165
|
+
style={{
|
|
166
|
+
padding: '2px 6px',
|
|
167
|
+
background: service.type === 'http' ? '#0e639c' : '#4a9e5f',
|
|
168
|
+
color: colors.textInverse,
|
|
169
|
+
borderRadius: '6px',
|
|
170
|
+
fontSize: '10px',
|
|
171
|
+
fontWeight: '500',
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
{service.type.toUpperCase()}
|
|
175
|
+
</span>
|
|
176
|
+
{service.url && (
|
|
177
|
+
<span style={{ fontFamily: 'monospace', fontSize: '11px' }}>{service.url}</span>
|
|
178
|
+
)}
|
|
179
|
+
{service.command && (
|
|
180
|
+
<span style={{ fontFamily: 'monospace', fontSize: '11px' }}>
|
|
181
|
+
{service.command} {service.args?.join(' ') || ''}
|
|
182
|
+
</span>
|
|
183
|
+
)}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</label>
|
|
187
|
+
);
|
|
188
|
+
})}
|
|
189
|
+
</div>
|
|
190
|
+
{selectedServices.size === 0 && (
|
|
191
|
+
<div
|
|
192
|
+
style={{
|
|
193
|
+
marginTop: '8px',
|
|
194
|
+
padding: '8px 12px',
|
|
195
|
+
background: withOpacity(colors.error, 0.15),
|
|
196
|
+
border: `1px solid ${colors.error}`,
|
|
197
|
+
borderRadius: '8px',
|
|
198
|
+
color: colors.error,
|
|
199
|
+
fontSize: '12px',
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
⚠️ Please select at least one service to start the server
|
|
203
|
+
</div>
|
|
204
|
+
)}
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export default ServiceSelector;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { colors, fonts } from '../theme';
|
|
2
|
+
|
|
3
|
+
export default function SetupHeader() {
|
|
4
|
+
return (
|
|
5
|
+
<div style={{ marginBottom: '24px' }}>
|
|
6
|
+
<h2
|
|
7
|
+
style={{
|
|
8
|
+
fontSize: '24px',
|
|
9
|
+
fontWeight: '700',
|
|
10
|
+
marginBottom: '12px',
|
|
11
|
+
color: colors.textPrimary,
|
|
12
|
+
fontFamily: fonts.body,
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
MCP Shark Server Setup
|
|
16
|
+
</h2>
|
|
17
|
+
<p
|
|
18
|
+
style={{
|
|
19
|
+
fontSize: '15px',
|
|
20
|
+
color: colors.textSecondary,
|
|
21
|
+
lineHeight: '1.6',
|
|
22
|
+
fontFamily: fonts.body,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
Convert your MCP configuration file and start the MCP Shark server to aggregate multiple MCP
|
|
26
|
+
servers into a single endpoint.
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Shark Logo Component
|
|
2
|
+
// Uses the og-image.png logo
|
|
3
|
+
|
|
4
|
+
export const SharkLogo = ({ size = 32, className = '', style = {} }) => {
|
|
5
|
+
return (
|
|
6
|
+
<img
|
|
7
|
+
src="/og-image.png"
|
|
8
|
+
alt="MCP Shark Logo"
|
|
9
|
+
width={size}
|
|
10
|
+
height={size}
|
|
11
|
+
className={className}
|
|
12
|
+
style={{
|
|
13
|
+
width: `${size}px`,
|
|
14
|
+
height: `${size}px`,
|
|
15
|
+
objectFit: 'contain',
|
|
16
|
+
...style,
|
|
17
|
+
}}
|
|
18
|
+
aria-label="MCP Shark Logo"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import ExpandableSection from './ExpandableSection';
|
|
3
|
+
import FindingsTable from './FindingsTable';
|
|
4
|
+
import OverallSummarySection from './OverallSummarySection';
|
|
5
|
+
import RecommendationsSection from './RecommendationsSection';
|
|
6
|
+
import NotablePatternsSection from './NotablePatternsSection';
|
|
7
|
+
|
|
8
|
+
export default function AnalysisResult({ analysis }) {
|
|
9
|
+
if (!analysis) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
style={{
|
|
13
|
+
padding: '12px',
|
|
14
|
+
background: colors.bgTertiary + '80',
|
|
15
|
+
borderRadius: '6px',
|
|
16
|
+
border: `1px solid ${colors.borderLight}`,
|
|
17
|
+
fontSize: '12px',
|
|
18
|
+
color: colors.textSecondary,
|
|
19
|
+
fontFamily: fonts.body,
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
No analysis data available.
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const toolFindings = analysis.tool_findings || [];
|
|
28
|
+
const promptFindings = analysis.prompt_findings || [];
|
|
29
|
+
const resourceFindings = analysis.resource_findings || [];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
|
33
|
+
<OverallSummarySection
|
|
34
|
+
overallRiskLevel={analysis.overall_risk_level}
|
|
35
|
+
overallReason={analysis.overall_reason}
|
|
36
|
+
/>
|
|
37
|
+
{toolFindings.length > 0 && (
|
|
38
|
+
<ExpandableSection title="Tool Findings" count={toolFindings.length} defaultExpanded={true}>
|
|
39
|
+
<FindingsTable findings={toolFindings} type="tool" />
|
|
40
|
+
</ExpandableSection>
|
|
41
|
+
)}
|
|
42
|
+
{promptFindings.length > 0 && (
|
|
43
|
+
<ExpandableSection
|
|
44
|
+
title="Prompt Findings"
|
|
45
|
+
count={promptFindings.length}
|
|
46
|
+
defaultExpanded={true}
|
|
47
|
+
>
|
|
48
|
+
<FindingsTable findings={promptFindings} type="prompt" />
|
|
49
|
+
</ExpandableSection>
|
|
50
|
+
)}
|
|
51
|
+
{resourceFindings.length > 0 && (
|
|
52
|
+
<ExpandableSection
|
|
53
|
+
title="Resource Findings"
|
|
54
|
+
count={resourceFindings.length}
|
|
55
|
+
defaultExpanded={true}
|
|
56
|
+
>
|
|
57
|
+
<FindingsTable findings={resourceFindings} type="resource" />
|
|
58
|
+
</ExpandableSection>
|
|
59
|
+
)}
|
|
60
|
+
<RecommendationsSection recommendations={analysis.recommendations} />
|
|
61
|
+
<NotablePatternsSection patterns={analysis.notable_patterns} />
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|