Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit 4d0d018

Browse files
committed
refactor(inspector): update package.json and tsconfig, enhance build scripts, and remove unused index.ts
1 parent 75ad75f commit 4d0d018

45 files changed

Lines changed: 15228 additions & 484 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/inspector/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-manager-strict=false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll": "always",
4+
"source.fixAll.eslint": "always",
5+
"source.organizeImports": "always"
6+
},
7+
"eslint.validate": [
8+
"javascript",
9+
"javascriptreact",
10+
"typescript",
11+
"typescriptreact"
12+
],
13+
"editor.formatOnSave": true,
14+
"editor.defaultFormatter": "esbenp.prettier-vscode",
15+
"npm.packageManager": "auto",
16+
"yarn.packageManager": "auto",
17+
"pnpm.packageManager": "auto",
18+
"typescript.preferences.includePackageJsonAutoImports": "auto",
19+
"typescript.suggest.autoImports": true
20+
}

packages/inspector/.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+
packageManager: yarn

packages/inspector/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# MCP Inspector
2+
3+
A web-based interface for connecting to and managing MCP (Model Context Protocol) servers.
4+
5+
## Features
6+
7+
- **Server Management**: Add, connect to, and manage MCP servers
8+
- **Real-time Connection**: Test connections before adding servers
9+
- **Browser-Compatible**: Works entirely in the browser using the MCP client
10+
- **Multiple Connection Types**: Support for HTTP/SSE and WebSocket connections
11+
12+
## Usage
13+
14+
### Adding a New Server
15+
16+
1. Click the server selection dropdown in the top-left corner
17+
2. Click "Add Server" button
18+
3. Fill in the server details:
19+
- **Server Name**: A friendly name for your server
20+
- **Connection Type**: Choose between HTTP/SSE or WebSocket
21+
- **Server URL**: The URL to connect to (e.g., `http://localhost:3000` or `ws://localhost:3000`)
22+
- **Description** (optional): Brief description of the server
23+
4. Click "Add Server" to test the connection and add the server
24+
25+
### Connecting to Servers
26+
27+
1. Select a server from the dropdown
28+
2. The system will automatically attempt to connect
29+
3. Once connected, you'll see a "Connected" badge
30+
31+
## Example Server Configurations
32+
33+
### Linear Server
34+
35+
For connecting to a Linear MCP server:
36+
37+
- **Server Name**: Linear
38+
- **Connection Type**: HTTP/SSE
39+
- **Server URL**: `https://your-linear-mcp-server.com`
40+
- **Description**: Linear project management integration
41+
42+
### Local Development Server
43+
44+
For local development:
45+
46+
- **Server Name**: Local Dev
47+
- **Connection Type**: HTTP/SSE
48+
- **Server URL**: `http://localhost:3000`
49+
- **Description**: Local development server
50+
51+
### WebSocket Server
52+
53+
For WebSocket-based servers:
54+
55+
- **Server Name**: WebSocket Server
56+
- **Connection Type**: WebSocket
57+
- **Server URL**: `ws://localhost:8080`
58+
- **Description**: WebSocket-based MCP server
59+
60+
## Technical Details
61+
62+
The inspector uses the browser-compatible MCP client from `mcp-use/browser`, which supports:
63+
64+
- HTTP/SSE connections
65+
- WebSocket connections
66+
- OAuth authentication (when configured)
67+
68+
The client automatically handles:
69+
70+
- Connection testing before adding servers
71+
- Session management
72+
- Error handling and reporting
73+
74+
## Development
75+
76+
To run the inspector in development mode:
77+
78+
```bash
79+
cd inspector
80+
yarn install
81+
yarn dev
82+
```
83+
84+
The inspector will be available at `http://localhost:5173`.

packages/inspector/components.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/client/index.css",
9+
"baseColor": "zinc",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {}
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu({
4+
formatters: true,
5+
typescript: true,
6+
react: false,
7+
rules: {
8+
'node/prefer-global/process': 'off',
9+
},
10+
})

packages/inspector/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link rel="preconnect" href="https://fonts.googleapis.com">
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9+
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap" rel="stylesheet">
10+
<title>MCP Inspector</title>
11+
</head>
12+
<body>
13+
<div id="root"></div>
14+
<script type="module" src="/src/client/main.tsx"></script>
15+
</body>
16+
</html>

packages/inspector/package.json

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,71 @@
11
{
22
"name": "@mcp-use/inspector",
3+
"type": "module",
34
"version": "0.1.0",
4-
"description": "MCP Inspector package for debugging and inspecting MCP servers",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
5+
"description": "MCP Inspector - A tool for inspecting and debugging MCP servers",
6+
"author": "",
7+
"license": "MIT",
8+
"keywords": [
9+
"mcp",
10+
"inspector",
11+
"debug",
12+
"tools"
13+
],
714
"scripts": {
8-
"build": "tsc",
9-
"dev": "tsc --watch",
10-
"test": "vitest"
15+
"dev": "concurrently \"npm run dev:client\" \"npm run dev:server\"",
16+
"dev:client": "vite",
17+
"dev:server": "tsx watch src/server/index.ts",
18+
"build": "npm run build:client && npm run build:server",
19+
"build:client": "vite build",
20+
"build:server": "tsc -p tsconfig.server.json",
21+
"preview": "vite preview",
22+
"type-check": "tsc --noEmit",
23+
"lint": "eslint .",
24+
"lint:fix": "eslint . --fix",
25+
"install:yarn": "yarn install",
26+
"install:pnpm": "pnpm install",
27+
"install:npm": "npm install",
28+
"lint:yarn": "yarn eslint . --fix",
29+
"lint:npm": "npm run lint:fix",
30+
"lint:pnpm": "pnpm lint:fix"
1131
},
1232
"dependencies": {
13-
"mcp-use": "workspace:*"
33+
"@radix-ui/react-alert-dialog": "^1.1.15",
34+
"@radix-ui/react-dialog": "^1.1.15",
35+
"@radix-ui/react-dropdown-menu": "^2.1.16",
36+
"@radix-ui/react-label": "^2.1.7",
37+
"@radix-ui/react-select": "^2.2.6",
38+
"@radix-ui/react-tooltip": "^1.2.8",
39+
"@tailwindcss/cli": "^4.1.14",
40+
"@tailwindcss/vite": "^4.1.14",
41+
"class-variance-authority": "^0.7.1",
42+
"clsx": "^2.1.1",
43+
"framer-motion": "^12.23.22",
44+
"hono": "^4.0.0",
45+
"lucide-react": "^0.545.0",
46+
"mcp-use": "^0.2.0",
47+
"motion": "^12.23.22",
48+
"react": "^19.2.0",
49+
"react-dom": "^19.2.0",
50+
"react-router-dom": "^7.9.3",
51+
"tailwind-merge": "^3.3.1"
1452
},
1553
"devDependencies": {
16-
"@types/node": "^20.0.0",
17-
"typescript": "^5.0.0",
18-
"vitest": "^1.0.0"
19-
},
20-
"publishConfig": {
21-
"access": "public"
54+
"@antfu/eslint-config": "^5.4.1",
55+
"@eslint-react/eslint-plugin": "^1.38.4",
56+
"@radix-ui/react-slot": "^1.2.3",
57+
"@types/node": "^24.7.0",
58+
"@types/react": "^19.2.2",
59+
"@types/react-dom": "^19.2.1",
60+
"@vitejs/plugin-react": "^5.0.4",
61+
"concurrently": "^9.2.1",
62+
"eslint": "^9.36.0",
63+
"eslint-plugin-react-hooks": "^5.2.0",
64+
"eslint-plugin-react-refresh": "^0.4.0",
65+
"tailwindcss": "^4.1.14",
66+
"tsx": "^4.6.0",
67+
"tw-animate-css": "^1.4.0",
68+
"typescript": "^5.9.3",
69+
"vite": "^7.1.9"
2270
}
2371
}

0 commit comments

Comments
 (0)