Skip to content

Commit 148e843

Browse files
Merge pull request modelcontextprotocol#46 from modelcontextprotocol/justin/oss-prep
Add license and package metadata
2 parents 171b59b + 6147640 commit 148e843

File tree

8 files changed

+225
-28
lines changed

8 files changed

+225
-28
lines changed

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2024 Anthropic, PBC.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bin/cli.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
3+
import { join, dirname } from "path";
4+
import { fileURLToPath } from "url";
5+
import concurrently from "concurrently";
6+
7+
const __dirname = dirname(fileURLToPath(import.meta.url));
8+
9+
// Paths to the server and client entry points
10+
const serverPath = join(__dirname, "../server/build/index.js");
11+
const clientPath = join(__dirname, "../client/bin/cli.js");
12+
13+
console.log("Starting MCP inspector...");
14+
15+
const { result } = concurrently(
16+
[
17+
{
18+
command: `node ${serverPath}`,
19+
name: "server",
20+
},
21+
{
22+
command: `node ${clientPath}`,
23+
name: "client",
24+
},
25+
],
26+
{
27+
prefix: "name",
28+
killOthers: ["failure", "success"],
29+
restartTries: 3,
30+
},
31+
);
32+
33+
result.catch((err) => {
34+
console.error("An error occurred:", err);
35+
process.exit(1);
36+
});

client/bin/cli.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
3+
import { join, dirname } from "path";
4+
import { fileURLToPath } from "url";
5+
import handler from "serve-handler";
6+
import http from "http";
7+
8+
const __dirname = dirname(fileURLToPath(import.meta.url));
9+
const distPath = join(__dirname, "../dist");
10+
11+
const server = http.createServer((request, response) => {
12+
return handler(request, response, { public: distPath });
13+
});
14+
15+
const port = process.env.PORT || 5173;
16+
server.listen(port, () => {
17+
console.log(`MCP inspector client running at http://localhost:${port}`);
18+
});

client/package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
{
2-
"name": "client",
2+
"name": "@modelcontextprotocol/inspector-client",
3+
"version": "0.1.0",
34
"private": true,
4-
"version": "0.0.0",
5+
"description": "Client-side application for the Model Context Protocol inspector",
6+
"license": "MIT",
7+
"author": "Anthropic, PBC (https://anthropic.com)",
8+
"homepage": "https://modelcontextprotocol.github.io",
9+
"bugs": "https://github.com/modelcontextprotocol/inspector/issues",
510
"type": "module",
11+
"bin": {
12+
"mcp-inspector-client": "./bin/cli.js"
13+
},
14+
"files": [
15+
"bin",
16+
"dist"
17+
],
618
"scripts": {
719
"dev": "vite",
820
"build": "tsc -b && vite build",
@@ -21,6 +33,7 @@
2133
"lucide-react": "^0.447.0",
2234
"react": "^18.3.1",
2335
"react-dom": "^18.3.1",
36+
"serve-handler": "^6.1.6",
2437
"tailwind-merge": "^2.5.3",
2538
"tailwindcss-animate": "^1.0.7",
2639
"zod": "^3.23.8"
@@ -30,6 +43,7 @@
3043
"@types/node": "^22.7.5",
3144
"@types/react": "^18.3.10",
3245
"@types/react-dom": "^18.3.0",
46+
"@types/serve-handler": "^6.1.4",
3347
"@vitejs/plugin-react": "^4.3.2",
3448
"autoprefixer": "^10.4.20",
3549
"eslint": "^9.11.1",

package-lock.json

Lines changed: 109 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
{
2-
"name": "mcp-inspector",
2+
"name": "@modelcontextprotocol/inspector",
3+
"version": "0.1.0",
34
"private": true,
4-
"version": "0.0.1",
5+
"description": "Model Context Protocol inspector",
6+
"license": "MIT",
7+
"author": "Anthropic, PBC (https://anthropic.com)",
8+
"homepage": "https://modelcontextprotocol.github.io",
9+
"bugs": "https://github.com/modelcontextprotocol/inspector/issues",
510
"type": "module",
11+
"bin": {
12+
"mcp-inspector": "./bin/cli.js"
13+
},
14+
"files": [
15+
"bin",
16+
"client/bin",
17+
"client/dist",
18+
"server/build"
19+
],
620
"workspaces": [
721
"client",
822
"server"
@@ -14,11 +28,15 @@
1428
"build": "npm run build-server && npm run build-client",
1529
"start-server": "cd server && npm run start",
1630
"start-client": "cd client && npm run preview",
17-
"start": "concurrently \"npm run start-server\" \"npm run start-client\"",
31+
"start": "./bin/cli.js",
32+
"prepare": "npm run build",
1833
"prettier-fix": "prettier --write ."
1934
},
35+
"dependencies": {
36+
"concurrently": "^9.0.1"
37+
},
2038
"devDependencies": {
21-
"concurrently": "^9.0.1",
22-
"prettier": "3.3.3"
39+
"prettier": "3.3.3",
40+
"@types/node": "^22.7.5"
2341
}
2442
}

0 commit comments

Comments
 (0)