37 |
44 |
48 | Prism.highlight(code, Prism.languages.json, "json")
49 | }
50 | padding={10}
51 | style={{
52 | fontFamily: '"Fira code", "Fira Mono", monospace',
53 | fontSize: 14,
54 | backgroundColor: "transparent",
55 | minHeight: "100px",
56 | }}
57 | className="w-full"
58 | />
59 |
60 | {displayError && (
61 |
{displayError}
62 | )}
63 |
64 | );
65 | };
66 |
67 | export default JsonEditor;
68 |
--------------------------------------------------------------------------------
/inspector/client/src/lib/constants.ts:
--------------------------------------------------------------------------------
1 | import { InspectorConfig } from "./configurationTypes";
2 |
3 | // OAuth-related session storage keys
4 | export const SESSION_KEYS = {
5 | CODE_VERIFIER: "mcp_code_verifier",
6 | SERVER_URL: "mcp_server_url",
7 | TOKENS: "mcp_tokens",
8 | CLIENT_INFORMATION: "mcp_client_information",
9 | SERVER_METADATA: "mcp_server_metadata",
10 | AUTH_DEBUGGER_STATE: "mcp_auth_debugger_state",
11 | } as const;
12 |
13 | // Generate server-specific session storage keys
14 | export const getServerSpecificKey = (
15 | baseKey: string,
16 | serverUrl?: string,
17 | ): string => {
18 | if (!serverUrl) return baseKey;
19 | return `[${serverUrl}] ${baseKey}`;
20 | };
21 |
22 | export type ConnectionStatus =
23 | | "disconnected"
24 | | "connected"
25 | | "error"
26 | | "error-connecting-to-proxy";
27 |
28 | export const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
29 |
30 | /**
31 | * Default configuration for the MCP Inspector, Currently persisted in local_storage in the Browser.
32 | * Future plans: Provide json config file + Browser local_storage to override default values
33 | **/
34 | export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
35 | MCP_SERVER_REQUEST_TIMEOUT: {
36 | label: "Request Timeout",
37 | description: "Timeout for requests to the MCP server (ms)",
38 | value: 10000,
39 | },
40 | MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
41 | label: "Reset Timeout on Progress",
42 | description: "Reset timeout on progress notifications",
43 | value: true,
44 | },
45 | MCP_REQUEST_MAX_TOTAL_TIMEOUT: {
46 | label: "Maximum Total Timeout",
47 | description:
48 | "Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",
49 | value: 60000,
50 | },
51 | MCP_PROXY_FULL_ADDRESS: {
52 | label: "Inspector Proxy Address",
53 | description:
54 | "Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
55 | value: "",
56 | },
57 | } as const;
58 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | node_modules/
3 | */node_modules/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 |
9 | # Build outputs
10 | dist/
11 | build/
12 | *.tsbuildinfo
13 |
14 | # Environment variables
15 | .env
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | # Python
22 | __pycache__/
23 | *.py[cod]
24 | *$py.class
25 | *.so
26 | .Python
27 | env/
28 | venv/
29 | ENV/
30 | env.bak/
31 | venv.bak/
32 | .venv/
33 | pip-log.txt
34 | pip-delete-this-directory.txt
35 |
36 | # Python virtual environments
37 | .conda/
38 | .pyenv/
39 |
40 | # Jupyter Notebook
41 | .ipynb_checkpoints
42 |
43 | # Docker
44 | .dockerignore
45 |
46 | # IDE and editors
47 | .vscode/
48 | .idea/
49 | *.swp
50 | *.swo
51 | *~
52 |
53 | # OS generated files
54 | .DS_Store
55 | .DS_Store?
56 | ._*
57 | .Spotlight-V100
58 | .Trashes
59 | ehthumbs.db
60 | Thumbs.db
61 |
62 | # Logs
63 | logs/
64 | *.log
65 |
66 | # Runtime data
67 | pids/
68 | *.pid
69 | *.seed
70 | *.pid.lock
71 |
72 | # Coverage directory used by tools like istanbul
73 | coverage/
74 | *.lcov
75 |
76 | # nyc test coverage
77 | .nyc_output
78 |
79 | # Test artifacts
80 | .jest/
81 |
82 | # Temporary folders
83 | tmp/
84 | temp/
85 |
86 | # Optional npm cache directory
87 | .npm
88 |
89 | # Optional eslint cache
90 | .eslintcache
91 |
92 | # Optional REPL history
93 | .node_repl_history
94 |
95 | # Output of 'npm pack'
96 | *.tgz
97 |
98 | # Yarn Integrity file
99 | .yarn-integrity
100 |
101 | # Compiled source
102 | *.com
103 | *.class
104 | *.dll
105 | *.exe
106 | *.o
107 | *.so
108 |
109 | # Packages
110 | *.7z
111 | *.dmg
112 | *.gz
113 | *.iso
114 | *.jar
115 | *.rar
116 | *.tar
117 | *.zip
118 |
119 | # Database
120 | *.db
121 | *.sqlite
122 | *.sqlite3
123 |
124 | # Config files with sensitive data
125 | config/local.json
126 | config/production.json
127 | secrets.json
128 |
129 | # MCP specific
130 | *.mcp
131 | mcp-data/
132 |
--------------------------------------------------------------------------------
/inspector/client/src/components/ui/tabs.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import * as TabsPrimitive from "@radix-ui/react-tabs";
3 |
4 | import { cn } from "@/lib/utils";
5 |
6 | const Tabs = TabsPrimitive.Root;
7 |
8 | const TabsList = React.forwardRef<
9 | React.ElementRef