@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.
Files changed (212) hide show
  1. package/LICENSE +85 -0
  2. package/README.md +724 -0
  3. package/bin/mcp-shark.js +93 -0
  4. package/mcp-server/.editorconfig +15 -0
  5. package/mcp-server/.prettierignore +11 -0
  6. package/mcp-server/.prettierrc +12 -0
  7. package/mcp-server/README.md +280 -0
  8. package/mcp-server/commitlint.config.cjs +42 -0
  9. package/mcp-server/eslint.config.js +131 -0
  10. package/mcp-server/lib/auditor/audit.js +228 -0
  11. package/mcp-server/lib/common/error.js +15 -0
  12. package/mcp-server/lib/server/external/all.js +32 -0
  13. package/mcp-server/lib/server/external/config.js +59 -0
  14. package/mcp-server/lib/server/external/kv.js +102 -0
  15. package/mcp-server/lib/server/external/single/client.js +35 -0
  16. package/mcp-server/lib/server/external/single/request.js +49 -0
  17. package/mcp-server/lib/server/external/single/run.js +75 -0
  18. package/mcp-server/lib/server/external/single/transport.js +57 -0
  19. package/mcp-server/lib/server/internal/handlers/common.js +20 -0
  20. package/mcp-server/lib/server/internal/handlers/error.js +7 -0
  21. package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
  22. package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
  23. package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
  24. package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
  25. package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
  26. package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
  27. package/mcp-server/lib/server/internal/run.js +49 -0
  28. package/mcp-server/lib/server/internal/server.js +63 -0
  29. package/mcp-server/lib/server/internal/session.js +39 -0
  30. package/mcp-server/mcp-shark.js +72 -0
  31. package/mcp-server/package-lock.json +4784 -0
  32. package/mcp-server/package.json +30 -0
  33. package/package.json +103 -0
  34. package/ui/README.md +212 -0
  35. package/ui/index.html +16 -0
  36. package/ui/package-lock.json +3574 -0
  37. package/ui/package.json +12 -0
  38. package/ui/paths.js +282 -0
  39. package/ui/public/og-image.png +0 -0
  40. package/ui/server/routes/backups.js +251 -0
  41. package/ui/server/routes/composite.js +244 -0
  42. package/ui/server/routes/config.js +175 -0
  43. package/ui/server/routes/conversations.js +25 -0
  44. package/ui/server/routes/help.js +43 -0
  45. package/ui/server/routes/logs.js +32 -0
  46. package/ui/server/routes/playground.js +152 -0
  47. package/ui/server/routes/requests.js +235 -0
  48. package/ui/server/routes/sessions.js +27 -0
  49. package/ui/server/routes/smartscan/discover.js +117 -0
  50. package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
  51. package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
  52. package/ui/server/routes/smartscan/scans/createScan.js +42 -0
  53. package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
  54. package/ui/server/routes/smartscan/scans/getScan.js +41 -0
  55. package/ui/server/routes/smartscan/scans/listScans.js +24 -0
  56. package/ui/server/routes/smartscan/scans.js +13 -0
  57. package/ui/server/routes/smartscan/token.js +56 -0
  58. package/ui/server/routes/smartscan/transport.js +53 -0
  59. package/ui/server/routes/smartscan.js +24 -0
  60. package/ui/server/routes/statistics.js +83 -0
  61. package/ui/server/utils/config-update.js +212 -0
  62. package/ui/server/utils/config.js +98 -0
  63. package/ui/server/utils/paths.js +23 -0
  64. package/ui/server/utils/port.js +28 -0
  65. package/ui/server/utils/process.js +80 -0
  66. package/ui/server/utils/scan-cache/all-results.js +180 -0
  67. package/ui/server/utils/scan-cache/directory.js +35 -0
  68. package/ui/server/utils/scan-cache/file-operations.js +104 -0
  69. package/ui/server/utils/scan-cache/hash.js +47 -0
  70. package/ui/server/utils/scan-cache/server-operations.js +80 -0
  71. package/ui/server/utils/scan-cache.js +12 -0
  72. package/ui/server/utils/serialization.js +13 -0
  73. package/ui/server/utils/smartscan-token.js +42 -0
  74. package/ui/server.js +199 -0
  75. package/ui/src/App.jsx +153 -0
  76. package/ui/src/CompositeLogs.jsx +164 -0
  77. package/ui/src/CompositeSetup.jsx +285 -0
  78. package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
  79. package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
  80. package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
  81. package/ui/src/HelpGuide.jsx +65 -0
  82. package/ui/src/IntroTour.jsx +140 -0
  83. package/ui/src/LogDetail.jsx +122 -0
  84. package/ui/src/LogTable.jsx +242 -0
  85. package/ui/src/PacketDetail.jsx +190 -0
  86. package/ui/src/PacketFilters.jsx +222 -0
  87. package/ui/src/PacketList.jsx +183 -0
  88. package/ui/src/SmartScan.jsx +178 -0
  89. package/ui/src/TabNavigation.jsx +143 -0
  90. package/ui/src/components/App/HelpButton.jsx +64 -0
  91. package/ui/src/components/App/TrafficTab.jsx +69 -0
  92. package/ui/src/components/App/useAppState.js +163 -0
  93. package/ui/src/components/BackupList.jsx +192 -0
  94. package/ui/src/components/CollapsibleSection.jsx +82 -0
  95. package/ui/src/components/ConfigFileSection.jsx +84 -0
  96. package/ui/src/components/ConfigViewerModal.jsx +141 -0
  97. package/ui/src/components/ConfirmationModal.jsx +129 -0
  98. package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
  99. package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
  100. package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
  101. package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
  102. package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
  103. package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
  104. package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
  105. package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
  106. package/ui/src/components/DetailsTab.jsx +31 -0
  107. package/ui/src/components/DetectedPathsList.jsx +171 -0
  108. package/ui/src/components/FileInput.jsx +144 -0
  109. package/ui/src/components/GroupHeader.jsx +76 -0
  110. package/ui/src/components/GroupedByMcpView.jsx +103 -0
  111. package/ui/src/components/GroupedByServerView.jsx +134 -0
  112. package/ui/src/components/GroupedBySessionView.jsx +127 -0
  113. package/ui/src/components/GroupedViews.jsx +2 -0
  114. package/ui/src/components/HexTab.jsx +188 -0
  115. package/ui/src/components/LogsDisplay.jsx +93 -0
  116. package/ui/src/components/LogsToolbar.jsx +193 -0
  117. package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
  118. package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
  119. package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
  120. package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
  121. package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
  122. package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
  123. package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
  124. package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
  125. package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
  126. package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
  127. package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
  128. package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
  129. package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
  130. package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
  131. package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
  132. package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
  133. package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
  134. package/ui/src/components/McpPlayground.jsx +171 -0
  135. package/ui/src/components/MessageDisplay.jsx +28 -0
  136. package/ui/src/components/PacketDetailHeader.jsx +88 -0
  137. package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
  138. package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
  139. package/ui/src/components/RawTab.jsx +142 -0
  140. package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
  141. package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
  142. package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
  143. package/ui/src/components/RequestRow.jsx +70 -0
  144. package/ui/src/components/ServerControl.jsx +133 -0
  145. package/ui/src/components/ServiceSelector.jsx +209 -0
  146. package/ui/src/components/SetupHeader.jsx +30 -0
  147. package/ui/src/components/SharkLogo.jsx +21 -0
  148. package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
  149. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
  150. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
  151. package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
  152. package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
  153. package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
  154. package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
  155. package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
  156. package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
  157. package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
  158. package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
  159. package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
  160. package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
  161. package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
  162. package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
  163. package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
  164. package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
  165. package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
  166. package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
  167. package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
  168. package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
  169. package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
  170. package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
  171. package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
  172. package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
  173. package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
  174. package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
  175. package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
  176. package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
  177. package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
  178. package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
  179. package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
  180. package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
  181. package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
  182. package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
  183. package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
  184. package/ui/src/components/SmartScan/useSmartScan.js +72 -0
  185. package/ui/src/components/SmartScan/utils.js +19 -0
  186. package/ui/src/components/SmartScanIcons.jsx +58 -0
  187. package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
  188. package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
  189. package/ui/src/components/TabNavigation.jsx +97 -0
  190. package/ui/src/components/TabNavigationIcons.jsx +40 -0
  191. package/ui/src/components/TableHeader.jsx +164 -0
  192. package/ui/src/components/TourOverlay.jsx +117 -0
  193. package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
  194. package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
  195. package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
  196. package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
  197. package/ui/src/components/TourTooltip.jsx +83 -0
  198. package/ui/src/components/ViewModeTabs.jsx +91 -0
  199. package/ui/src/components/WhatThisDoesSection.jsx +61 -0
  200. package/ui/src/config/tourSteps.jsx +141 -0
  201. package/ui/src/hooks/useAnimation.js +92 -0
  202. package/ui/src/hooks/useConfigManagement.js +124 -0
  203. package/ui/src/hooks/useServiceExtraction.js +51 -0
  204. package/ui/src/index.css +42 -0
  205. package/ui/src/main.jsx +10 -0
  206. package/ui/src/theme.js +65 -0
  207. package/ui/src/utils/animations.js +170 -0
  208. package/ui/src/utils/groupingUtils.js +93 -0
  209. package/ui/src/utils/hexUtils.js +24 -0
  210. package/ui/src/utils/mcpGroupingUtils.js +262 -0
  211. package/ui/src/utils/requestUtils.js +297 -0
  212. package/ui/vite.config.js +18 -0
package/README.md ADDED
@@ -0,0 +1,724 @@
1
+ <div align="center">
2
+
3
+ <img src="https://smart.mcpshark.sh/icon_512x512.png" alt="MCP Shark Logo" width="128" height="128">
4
+
5
+ <h1>@mcp-shark/mcp-shark</h1>
6
+
7
+ <p>Aggregate multiple Model Context Protocol (MCP) servers into a single unified interface with a powerful monitoring UI</p>
8
+
9
+ </div>
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@mcp-shark/mcp-shark.svg)](https://www.npmjs.com/package/@mcp-shark/mcp-shark)
12
+ [![License: Non-Commercial](https://img.shields.io/badge/License-Non--Commercial-red.svg)](LICENSE)
13
+
14
+ ## 📦 Download Desktop App
15
+
16
+ Prefer a desktop application? Download the native desktop app:
17
+
18
+ | Platform | Download |
19
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
20
+ | **macOS** | [Download (ARM64)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/MCP.Shark-1.3.0-arm64-mac.zip) |
21
+ | **Windows** | [Download (Installer)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/MCP.Shark.Setup.1.3.0.exe) |
22
+ | **Linux** | [Download (ARM64 DEB)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/mcp-shark-app_1.3.0_arm64.deb) |
23
+
24
+ > **⚠️ ALPHA VERSION - STILL TESTING**
25
+ > This is an alpha version of MCP Shark. The software is still under active development and testing. Features may change, and there may be bugs or incomplete functionality. Use at your own risk.
26
+
27
+ ## 📦 npm Package
28
+
29
+ ### Installation
30
+
31
+ **Install globally (recommended):**
32
+
33
+ ```bash
34
+ npm install -g @mcp-shark/mcp-shark
35
+ ```
36
+
37
+ **Install locally in your project:**
38
+
39
+ ```bash
40
+ npm install @mcp-shark/mcp-shark
41
+ ```
42
+
43
+ **Use npx (no installation required):**
44
+
45
+ ```bash
46
+ npx @mcp-shark/mcp-shark
47
+ ```
48
+
49
+ ### Usage
50
+
51
+ After global installation, simply run:
52
+
53
+ ```bash
54
+ mcp-shark
55
+ ```
56
+
57
+ Or with npx:
58
+
59
+ ```bash
60
+ npx @mcp-shark/mcp-shark
61
+ ```
62
+
63
+ Or if installed locally:
64
+
65
+ ```bash
66
+ npx @mcp-shark/mcp-shark
67
+ ```
68
+
69
+ The UI will automatically:
70
+
71
+ - Install dependencies if needed
72
+ - Build the frontend if needed
73
+ - Start the server on `http://localhost:9853`
74
+
75
+ Open your browser to `http://localhost:9853` to access the MCP Shark interface.
76
+
77
+ ### Package Information
78
+
79
+ - **Package Name**: `@mcp-shark/mcp-shark`
80
+ - **npm Registry**: [https://www.npmjs.com/package/@mcp-shark/mcp-shark](https://www.npmjs.com/package/@mcp-shark/mcp-shark)
81
+ - **Version**: Check latest version on npm
82
+ - **License**: Source-Available Non-Commercial (see [LICENSE](LICENSE) for details)
83
+ - **Node.js**: Requires Node.js 18+
84
+
85
+ ## 📖 Table of Contents
86
+
87
+ - [npm Package](#-npm-package)
88
+ - [Installation](#installation)
89
+ - [Usage](#usage)
90
+ - [Package Information](#package-information)
91
+ - [About](#about)
92
+ - [Key Features](#-key-features)
93
+ - [Multi-Server Aggregation](#-multi-server-aggregation)
94
+ - [Real-Time Monitoring & Analysis](#-real-time-monitoring--analysis)
95
+ - [MCP Playground](#-mcp-playground)
96
+ - [Smart Scan](#-smart-scan)
97
+ - [IDE Integration](#-ide-integration)
98
+ - [Analytics & Statistics](#-analytics--statistics)
99
+ - [Data Management](#-data-management)
100
+ - [Modern UI/UX](#-modern-uiux)
101
+ - [Configuration Management](#-configuration-management)
102
+ - [User Guide](#-user-guide)
103
+ - [Getting Started](#getting-started)
104
+ - [UI Tabs Overview](#ui-tabs-overview)
105
+ - [Traffic Capture](#traffic-capture)
106
+ - [MCP Playground](#mcp-playground-1)
107
+ - [Smart Scan](#smart-scan-1)
108
+ - [MCP Shark Logs](#mcp-shark-logs)
109
+ - [MCP Server Setup](#mcp-server-setup)
110
+ - [Advanced Features](#advanced-features)
111
+ - [Exporting Data](#exporting-data)
112
+ - [Backup Management](#backup-management)
113
+ - [Session Management](#session-management-1)
114
+ - [Performance Analysis](#performance-analysis)
115
+ - [Architecture](#-architecture)
116
+ - [Supported MCP Methods](#-supported-mcp-methods)
117
+ - [Audit Logging](#-audit-logging)
118
+ - [Configuration](#-configuration)
119
+ - [Use Cases](#-use-cases)
120
+ - [Requirements](#-requirements)
121
+ - [Troubleshooting](#-troubleshooting)
122
+ - [Contributing](#-contributing)
123
+ - [Related Projects](#-related-projects)
124
+ - [License](#-license)
125
+
126
+ ## About
127
+
128
+ MCP Shark is a complete solution for aggregating multiple MCP servers (both HTTP and stdio-based) into one cohesive endpoint, with a real-time web interface for monitoring and inspecting all communications. Think of it as **Wireshark for MCP** - providing deep visibility into every request and response.
129
+
130
+ ![MCP Shark Architecture](images/architecture.svg)
131
+
132
+ ## 📦 Desktop App
133
+
134
+ Prefer a desktop application? Download the native desktop app:
135
+
136
+ | Platform | Download |
137
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
138
+ | **macOS** | [Download (ARM64)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/MCP.Shark-1.3.0-arm64-mac.zip) |
139
+ | **Windows** | [Download (Installer)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/MCP.Shark.Setup.1.3.0.exe) |
140
+ | **Linux** | [Download (ARM64 DEB)](https://github.com/mcp-shark/mcp-shark-app/releases/download/v1.3.0/mcp-shark-app_1.3.0_arm64.deb) |
141
+
142
+ ## ✨ Key Features
143
+
144
+ ### 🔗 Multi-Server Aggregation
145
+
146
+ - Connect to multiple MCP servers simultaneously (HTTP and stdio)
147
+ - Unified API for tools, prompts, and resources from all servers
148
+ - Service selection — choose which servers to activate
149
+ - Automatic load balancing and failover
150
+ - Support for both HTTP and stdio-based MCP servers
151
+
152
+ ### 📊 Real-Time Monitoring & Analysis
153
+
154
+ **Wireshark-like Interface** — Detailed packet inspection with frame numbers, timestamps, and protocol information
155
+
156
+ ![Traffic General List View](images/traffic-general-list.png)
157
+
158
+ **Multiple View Modes:**
159
+
160
+ - **General List View** — Flat chronological view of all traffic
161
+ - **Grouped by Session & Server** — Organize by conversation sessions
162
+ - **Grouped by Server & Session** — Organize by server activity
163
+ - **Protocol View** — View traffic by protocol type
164
+
165
+ ![Traffic Protocol View](images/traffic-protocol-view.png)
166
+
167
+ **Advanced Features:**
168
+
169
+ - **Live Traffic Capture** — WebSocket-powered real-time updates
170
+ - **Advanced Filtering** — Filter by method, status, protocol, session, server, direction, and more
171
+ - **Full-Text Search** — Search across all fields including URLs, endpoints, and JSON-RPC methods
172
+ - **Detailed Packet Inspection** — Click any packet to see full headers, request/response body, timing information, and JSON-RPC details
173
+
174
+ ![Traffic Detail View](images/traffic-detail-view.png)
175
+
176
+ ### 🎮 MCP Playground
177
+
178
+ **Interactive testing environment for exploring and testing MCP servers** — one of MCP Shark's standout features.
179
+
180
+ ![MCP Playground - Tools](images/playground-tools.png)
181
+
182
+ **Interactive Tool Testing:**
183
+
184
+ - Browse all available tools from all servers in one place
185
+ - See tool descriptions, parameters, and schemas
186
+ - Call tools with custom JSON arguments
187
+ - View results in real-time with formatted output
188
+ - Test edge cases and different parameter combinations
189
+
190
+ **Prompt Exploration:**
191
+
192
+ - List all prompts from all connected servers
193
+ - View prompt descriptions and argument schemas
194
+ - Test prompts with different arguments
195
+ - See formatted prompt results
196
+ - Understand how prompts work across different servers
197
+
198
+ **Resource Browsing:**
199
+
200
+ - Discover all available resources across all servers
201
+ - Read resource contents directly in the UI
202
+ - Explore resource URIs and metadata
203
+ - Understand resource structure and format
204
+
205
+ **Session Management:**
206
+
207
+ - Automatic session tracking
208
+ - Maintains context across multiple tool calls
209
+ - Test stateful workflows and conversations
210
+ - Debug session-related issues
211
+
212
+ **Use Cases:**
213
+
214
+ - **Development**: Test tools before integrating them into your code
215
+ - **Debugging**: Verify tool behavior and troubleshoot issues
216
+ - **Exploration**: Discover what tools and resources are available
217
+ - **Learning**: Understand how different MCP servers work
218
+ - **Documentation**: Generate examples and test cases
219
+
220
+ ### 🔍 Smart Scan
221
+
222
+ **AI-powered security analysis for MCP servers** — automatically scan and analyze your MCP servers for potential security risks and vulnerabilities.
223
+
224
+ ![Smart Scan Main](images/smart-scan-main.png)
225
+
226
+ **AI-Powered Security Analysis:**
227
+
228
+ - **Automated Scanning** — Discover and scan multiple MCP servers automatically
229
+ - **Security Risk Assessment** — Get overall risk levels (LOW, MEDIUM, HIGH) for each server
230
+ - **Detailed Findings** — View comprehensive security analysis including:
231
+ - Tool security analysis
232
+ - Prompt injection risks
233
+ - Resource access patterns
234
+ - Overall security recommendations
235
+ - **Cached Results** — Results are cached for quick access without re-scanning
236
+
237
+ **Batch Scanning:**
238
+
239
+ - **Server Discovery** — Automatically discover MCP servers from your configuration
240
+ - **Selective Scanning** — Choose which servers to scan
241
+ - **Batch Processing** — Scan multiple servers in parallel
242
+ - **Progress Tracking** — Monitor scan progress in real-time
243
+
244
+ **Risk Assessment:**
245
+
246
+ - **Overall Risk Level** — Quick visual indicator of security posture
247
+ - **Detailed Findings** — Comprehensive list of security concerns
248
+ - **Recommendations** — Actionable security recommendations
249
+ - **Full Report Access** — View complete analysis reports with detailed findings
250
+ - Click "view results" button in the scan results to open full reports
251
+ - Reports are available at [https://smart.mcpshark.sh](https://smart.mcpshark.sh)
252
+ - Each scan result includes a direct link to its detailed analysis page
253
+
254
+ ![Smart Scan Results](images/smart-scan-results.png)
255
+
256
+ ### 🔌 IDE Integration
257
+
258
+ **Seamless integration with popular IDEs and editors:**
259
+
260
+ - **Cursor** — Automatically detects and uses `~/.cursor/mcp.json`
261
+ - **Windsurf** — Automatically detects and uses `~/.codeium/windsurf/mcp_config.json`
262
+ - **Custom Configurations** — Upload and use any MCP configuration file
263
+
264
+ **Automatic Configuration:**
265
+
266
+ - Detects your IDE's MCP configuration files
267
+ - Converts IDE-specific config formats to MCP Shark format
268
+ - Creates backups before making any changes
269
+ - Updates your IDE config to point to MCP Shark server
270
+ - Restores original configuration when you stop the server
271
+
272
+ **Zero-Configuration Setup:**
273
+
274
+ 1. Start MCP Shark UI
275
+ 2. Select your IDE from the detected list (or upload your config)
276
+ 3. Choose which servers to enable (optional)
277
+ 4. Click "Start MCP Shark"
278
+ 5. Your IDE is now using MCP Shark automatically
279
+
280
+ No manual configuration editing required - MCP Shark handles everything for you.
281
+
282
+ ![MCP Server Setup](images/server-setup.png)
283
+
284
+ ### 📈 Analytics & Statistics
285
+
286
+ - **Traffic Statistics** — View request counts, unique sessions, and server activity
287
+ - **Performance Metrics** — Duration, latency, and timing information for each request
288
+ - **Error Tracking** — Comprehensive error logging with stack traces
289
+ - **Session Analytics** — Track conversations and stateful interactions
290
+
291
+ ### 💾 Data Management
292
+
293
+ - **Export Capabilities** — Export captured traffic in JSON, CSV, or TXT formats
294
+ - **Backup Management** — Automatic backups of configuration files with restore functionality
295
+ - **Log Export** — Export server logs as text files
296
+ - **SQLite Database** — Efficient storage with direct database access for advanced analysis
297
+
298
+ ### 🎨 Modern UI/UX
299
+
300
+ - **Dark Theme** — Developer-friendly dark interface
301
+ - **Interactive Tour** — Built-in onboarding guide for first-time users
302
+ - **Responsive Design** — Works seamlessly across different screen sizes
303
+ - **Adaptive Navigation** — Dropdown menu for smaller windows (< 1200px)
304
+ - **Compact Views** — Optimized layouts for mobile and tablet devices
305
+ - **Animated Transitions** — Smooth animations for better user experience
306
+ - **Hex View** — Binary data inspection with hex viewer
307
+ - **Raw/JSON View** — Multiple payload viewing modes (Raw, JSON, Hex)
308
+ - **Compact Scan Results** — Single-row display for scan results with quick access to full reports
309
+
310
+ ### ⚙️ Configuration Management
311
+
312
+ - **Auto-Detection** — Automatically detects IDE configuration files
313
+ - **Config Conversion** — Converts IDE config format to MCP Shark format
314
+ - **Backup & Restore** — Automatic backups before making changes
315
+ - **Config Viewer** — View and inspect configuration files and backups
316
+ - **Service Filtering** — Selectively enable/disable specific servers
317
+
318
+ ## 📚 User Guide
319
+
320
+ ### Getting Started
321
+
322
+ 1. **Install MCP Shark:**
323
+
324
+ ```bash
325
+ npm install -g @mcp-shark/mcp-shark
326
+ ```
327
+
328
+ 2. **Start MCP Shark:**
329
+
330
+ ```bash
331
+ mcp-shark
332
+ ```
333
+
334
+ 3. **Open your browser:**
335
+ Navigate to `http://localhost:9853`
336
+
337
+ 4. **Interactive Tour**: On first launch, you'll see an interactive tour - follow it to get started
338
+
339
+ 5. **Configure Servers**: Go to the "MCP Server Setup" tab
340
+
341
+ 6. **Select Configuration**: Choose from detected editors or upload your own config file
342
+
343
+ 7. **Start Monitoring**: Click "Start MCP Shark" to begin capturing traffic
344
+
345
+ ### UI Tabs Overview
346
+
347
+ #### Traffic Capture
348
+
349
+ The main monitoring interface with Wireshark-like capabilities:
350
+
351
+ - **Real-time Updates**: See requests and responses as they happen
352
+ - **Multiple Views**:
353
+ - **General List**: Flat chronological view of all traffic
354
+ - **Grouped by Session & Server**: Organize by conversation sessions
355
+ - **Grouped by Server & Session**: Organize by server activity
356
+ - **Protocol View**: View traffic by protocol type
357
+ - **Advanced Filters**:
358
+ - Search across all fields
359
+ - Filter by HTTP method (GET, POST, etc.)
360
+ - Filter by status code
361
+ - Filter by protocol
362
+ - Filter by direction (Request/Response)
363
+ - Filter by session ID
364
+ - Filter by server name
365
+ - **Packet Details**: Click any packet to see:
366
+ - Full headers
367
+ - Request/response body
368
+ - Timing information
369
+ - JSON-RPC details
370
+ - Raw, JSON, and Hex views
371
+ - **Export**: Export filtered results in JSON, CSV, or TXT formats
372
+ - **Statistics**: View traffic statistics including request counts and unique sessions
373
+
374
+ #### MCP Playground
375
+
376
+ Interactive testing environment for MCP servers:
377
+
378
+ - **Tools Section**:
379
+ - Browse all available tools from all servers
380
+ - Call tools with custom arguments
381
+ - View results in real-time
382
+ - See tool descriptions and parameters
383
+ - **Prompts Section**:
384
+ - List all prompts from all servers
385
+ - Test prompts with different arguments
386
+ - View prompt results
387
+ - **Resources Section**:
388
+ - Browse available resources
389
+ - Read resource contents
390
+ - Explore resource URIs
391
+ - **Session Management**: Maintains session state for stateful interactions
392
+
393
+ This is the perfect place to explore your MCP servers, test tools, and understand what capabilities are available.
394
+
395
+ #### Smart Scan
396
+
397
+ AI-powered security analysis for your MCP servers:
398
+
399
+ - **Server Discovery** — Automatically discover MCP servers from your configuration
400
+ - **Batch Scanning** — Scan multiple servers simultaneously
401
+ - **Risk Assessment** — Get overall risk levels (LOW, MEDIUM, HIGH) for each server
402
+ - **Compact Results View** — Single-row display showing:
403
+ - Server name
404
+ - Risk level badge (e.g., "medium risk", "low risk")
405
+ - Quick "view results" button to access full reports
406
+ - Status indicators (Cached, Success)
407
+ - **Detailed Analysis** — View comprehensive security findings including:
408
+ - Tool security analysis
409
+ - Prompt injection risks
410
+ - Resource access patterns
411
+ - Security recommendations
412
+ - **Cached Results** — Results are cached for quick access without re-scanning
413
+ - **Full Report Access** — Click "view results" to see complete analysis with detailed findings
414
+ - Opens full reports in a new tab at [https://smart.mcpshark.sh](https://smart.mcpshark.sh)
415
+ - View comprehensive security analysis, findings, and recommendations
416
+ - Access historical scan results and compare scans over time
417
+
418
+ Smart Scan helps you identify potential security issues in your MCP servers before they become problems. View detailed scan reports and analysis at [https://smart.mcpshark.sh](https://smart.mcpshark.sh).
419
+
420
+ #### MCP Shark Logs
421
+
422
+ Server console output and debugging:
423
+
424
+ - **Real-time Logs**: See server output as it happens
425
+ - **Log Filtering**: Filter by log type (stdout, stderr, error)
426
+ - **Export Logs**: Export logs as text files
427
+ - **Auto-scroll**: Automatically scrolls to latest logs
428
+ - **Color-coded**: Different colors for different log types
429
+
430
+ #### MCP Server Setup
431
+
432
+ Configuration and server management:
433
+
434
+ - **Config Detection** — Automatically detects config files from:
435
+ - Cursor: `~/.cursor/mcp.json`
436
+ - Windsurf: `~/.codeium/windsurf/mcp_config.json`
437
+ - **File Upload** — Upload your own MCP configuration file
438
+ - **Service Selection** — Choose which servers to enable
439
+ - **Config Viewer** — View and inspect configuration files
440
+ - **Start/Stop Server** — Control the MCP Shark server
441
+ - **Backup Management**:
442
+ - View all backups with timestamps
443
+ - Restore any backup
444
+ - Delete backups
445
+ - View backup contents
446
+
447
+ ### Advanced Features
448
+
449
+ #### Exporting Data
450
+
451
+ **Traffic Export:**
452
+
453
+ 1. Go to **Traffic Capture** tab
454
+ 2. Apply any filters (optional)
455
+ 3. Click **Export** button
456
+ 4. Choose format:
457
+ - **JSON**: Full structured data with all metadata
458
+ - **CSV**: Spreadsheet-friendly format
459
+ - **TXT**: Human-readable text format
460
+
461
+ **Log Export:**
462
+
463
+ 1. Go to **MCP Shark Logs** tab
464
+ 2. Click **Export Logs** button
465
+ 3. Logs are exported as a text file
466
+
467
+ #### Backup Management
468
+
469
+ MCP Shark automatically creates backups before modifying your configuration:
470
+
471
+ 1. Go to **MCP Server Setup** tab
472
+ 2. Scroll to **"Backed Up Configuration Files"** section
473
+ 3. View all backups with:
474
+ - Original file path
475
+ - Backup location
476
+ - Creation timestamp
477
+ - File size
478
+ 4. Actions available:
479
+ - **View**: Inspect backup contents
480
+ - **Restore**: Restore backup to original location
481
+ - **Delete**: Remove backup file
482
+
483
+ #### Session Management
484
+
485
+ - **Automatic Session Tracking** — Sessions are automatically tracked and displayed
486
+ - **Session Filtering** — Filter traffic by specific session IDs
487
+ - **Session Grouping** — View traffic grouped by session for conversation analysis
488
+ - **Session Persistence** — Sessions are maintained across requests
489
+
490
+ #### Performance Analysis
491
+
492
+ Each request/response includes:
493
+
494
+ - **Duration** — Total request/response time
495
+ - **Latency** — Network latency measurements
496
+ - **Payload Size** — Request and response sizes
497
+ - **Status Codes** — HTTP status codes
498
+ - **Timing Breakdown** — Detailed timing information
499
+
500
+ ## 🏗️ Architecture
501
+
502
+ ![MCP Shark Architecture](images/architecture.svg)
503
+
504
+ The diagram above illustrates how MCP Shark works:
505
+
506
+ 1. **Your IDE** (Cursor, Windsurf, etc.) connects to MCP Shark Server via HTTP
507
+ 2. **MCP Shark Server** (Port 9851) acts as a gateway, aggregating multiple MCP servers
508
+ 3. **MCP Servers** (GitHub, Filesystem, Database, Custom) handle the actual requests
509
+ 4. **SQLite Database** stores all traffic for audit logging
510
+ 5. **MCP Shark UI** (Port 9853) reads from the database and provides real-time monitoring
511
+
512
+ **Data Flow:**
513
+
514
+ - Requests flow from IDE → MCP Shark Server → MCP Servers
515
+ - Responses flow back through the same path
516
+ - All traffic is logged to SQLite Database
517
+ - UI reads from database and can control the server
518
+
519
+ ## 🔧 Supported MCP Methods
520
+
521
+ MCP Shark supports all standard MCP methods:
522
+
523
+ - **`tools/list`** - List all tools from all servers
524
+ - **`tools/call`** - Call a tool from any server (with server prefix: `server:tool_name`)
525
+ - **`prompts/list`** - List all prompts from all servers
526
+ - **`prompts/get`** - Get a specific prompt
527
+ - **`resources/list`** - List all resources from all servers
528
+ - **`resources/read`** - Read a specific resource
529
+
530
+ ### Tool Naming Convention
531
+
532
+ When calling tools, prefix with the server name:
533
+
534
+ - `github:search_repositories` - Calls `search_repositories` from the `github` server
535
+ - `@21st-dev/magic:create_component` - Calls `create_component` from the `@21st-dev/magic` server
536
+
537
+ ## 📝 Audit Logging
538
+
539
+ All MCP communications are logged to SQLite (default location: `~/.mcp-shark/db/mcp-shark.sqlite`) with:
540
+
541
+ - **Request/Response Tracking**: Full payload logging with correlation IDs
542
+ - **Performance Metrics**: Duration, latency, and timing information
543
+ - **Error Tracking**: Comprehensive error logging with stack traces
544
+ - **Session Management**: Session ID tracking for stateful interactions
545
+ - **Server Identification**: Track which external server handled each request
546
+ - **Request Correlation**: Match requests with their responses
547
+
548
+ ### Database Schema
549
+
550
+ The database includes:
551
+
552
+ - **`mcp_communications`**: All request/response communications
553
+ - **`mcp_request_response_pairs`**: Correlated request/response pairs
554
+ - **Sessions**: Automatic session tracking
555
+
556
+ The database can be accessed directly for advanced analysis or exported through the UI in JSON, CSV, or TXT formats.
557
+
558
+ ## ⚙️ Configuration
559
+
560
+ ### Automatic Configuration
561
+
562
+ MCP Shark automatically detects and converts configuration files from:
563
+
564
+ - **Cursor** — `~/.cursor/mcp.json`
565
+ - **Windsurf** — `~/.codeium/windsurf/mcp_config.json`
566
+
567
+ ### Manual Configuration
568
+
569
+ If you need to configure manually, create a file at `~/.mcp-shark/mcps.json`:
570
+
571
+ **HTTP Server:**
572
+
573
+ ```json
574
+ {
575
+ "servers": {
576
+ "github": {
577
+ "type": "http",
578
+ "url": "https://api.githubcopilot.com/mcp/",
579
+ "headers": {
580
+ "Authorization": "Bearer YOUR_TOKEN"
581
+ }
582
+ }
583
+ }
584
+ }
585
+ ```
586
+
587
+ **stdio Server:**
588
+
589
+ ```json
590
+ {
591
+ "servers": {
592
+ "@21st-dev/magic": {
593
+ "type": "stdio",
594
+ "command": "npx",
595
+ "args": ["-y", "@21st-dev/magic@latest", "API_KEY=\"your-api-key\""]
596
+ }
597
+ }
598
+ }
599
+ ```
600
+
601
+ ## 🎯 Use Cases
602
+
603
+ ### Development & Debugging
604
+
605
+ - Debug MCP server interactions
606
+ - Inspect request/response payloads
607
+ - Analyze performance bottlenecks
608
+ - Track down errors and issues
609
+
610
+ ### Testing & QA
611
+
612
+ - Test MCP tools, prompts, and resources using the Playground
613
+ - Verify server responses
614
+ - Validate configuration changes
615
+ - Test with different arguments
616
+
617
+ ### Monitoring & Analytics
618
+
619
+ - Monitor MCP server usage
620
+ - Track API call patterns
621
+ - Analyze traffic statistics
622
+ - Export data for reporting
623
+
624
+ ### Learning & Exploration
625
+
626
+ - Understand MCP protocol
627
+ - Explore available tools and resources using the Playground
628
+ - Learn how different servers work
629
+ - Experiment with MCP capabilities
630
+
631
+ ### Security Analysis
632
+
633
+ - Scan MCP servers for security risks
634
+ - Identify potential vulnerabilities
635
+ - Get security recommendations
636
+ - Track security posture over time
637
+
638
+ ## 📋 Requirements
639
+
640
+ - **Node.js** 18+ and npm
641
+ - **Git** (for installing dependencies from GitHub, if needed)
642
+
643
+ ## 🔍 Troubleshooting
644
+
645
+ ### Server Won't Start
646
+
647
+ - Check if port 9851 is already in use
648
+ - Verify configuration file is valid JSON
649
+ - Check logs in the "MCP Shark Logs" tab
650
+ - Ensure all required dependencies are installed
651
+
652
+ ### No Traffic Appearing
653
+
654
+ - Verify MCP Shark server is running (check status in Setup tab)
655
+ - Ensure your IDE is configured to use `http://localhost:9851/mcp`
656
+ - Check that your original config file was updated correctly
657
+ - Restart the MCP Shark server
658
+
659
+ ### Configuration Issues
660
+
661
+ - Verify your config file is valid JSON
662
+ - Check that server URLs are accessible
663
+ - Ensure stdio commands are available in PATH
664
+ - Review backup files if original config was modified
665
+
666
+ ### Installation Issues
667
+
668
+ If you encounter issues with npm installation:
669
+
670
+ ```bash
671
+ # Clear npm cache
672
+ npm cache clean --force
673
+
674
+ # Try installing again
675
+ npm install -g @mcp-shark/mcp-shark
676
+ ```
677
+
678
+ For npx issues:
679
+
680
+ ```bash
681
+ # Ensure you have the latest npm
682
+ npm install -g npm@latest
683
+
684
+ # Try running again
685
+ npx @mcp-shark/mcp-shark
686
+ ```
687
+
688
+ ## 🤝 Contributing
689
+
690
+ We welcome contributions! Please see:
691
+
692
+ - **[CONTRIBUTING.md](./CONTRIBUTING.md)**: Guidelines for contributing
693
+ - **[DEVELOPERS.md](./DEVELOPERS.md)**: Developer guide and setup
694
+ - **[SETUP.md](./SETUP.md)**: Initial setup instructions
695
+
696
+ ## 🔗 Related Projects
697
+
698
+ - **[mcp-shark-app](https://github.com/mcp-shark/mcp-shark-app)**: Electron desktop application wrapper
699
+ - **[mcp-shark-site](https://github.com/mcp-shark/mcp-shark-site)**: Official website and documentation
700
+ - **[smart-scan-web-app](https://github.com/mcp-shark/smart-scan-web-app)**: Smart Scan web interface
701
+
702
+ ## 📄 License
703
+
704
+ Source-Available Non-Commercial License
705
+
706
+ > **Note**: This is **not** an OSI-approved open source license. The source code is available, but **commercial use is prohibited** without a separate commercial agreement.
707
+
708
+ **Summary:**
709
+
710
+ - ✅ **Allowed**: View, fork, modify, and run the code for personal, educational, or internal company use
711
+ - ❌ **Not Allowed**:
712
+ - Sell this project or resell hosted versions
713
+ - Integrate it into a paid product/service without written permission
714
+ - Use the name, logo, or branding to imply endorsement
715
+
716
+ **Commercial Use**: Commercial use requires a separate written commercial license agreement. To inquire about a commercial license, please contact the project maintainers.
717
+
718
+ See the [LICENSE](LICENSE) file for full terms and conditions.
719
+
720
+ ---
721
+
722
+ **Built with ❤️ for the MCP community**
723
+
724
+ For more information, visit [https://mcpshark.sh](https://mcpshark.sh)