MCPcopy Index your code
hub / github.com/modelcontextprotocol/inspector / App

Function App

client/src/App.tsx:145–1744  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143};
144
145const App = () => {
146 const [resources, setResources] = useState<Resource[]>([]);
147 const [resourceTemplates, setResourceTemplates] = useState<
148 ResourceTemplate[]
149 >([]);
150 const [resourceContent, setResourceContent] = useState<string>("");
151 const [resourceContentMap, setResourceContentMap] = useState<
152 Record<string, string>
153 >({});
154 const [fetchingResources, setFetchingResources] = useState<Set<string>>(
155 new Set(),
156 );
157 const [prompts, setPrompts] = useState<Prompt[]>([]);
158 const [promptContent, setPromptContent] = useState<string>("");
159 const [tools, setTools] = useState<Tool[]>([]);
160 const [tasks, setTasks] = useState<Task[]>([]);
161 const [toolResult, setToolResult] =
162 useState<CompatibilityCallToolResult | null>(null);
163 const [prefilledAppsToolCall, setPrefilledAppsToolCall] =
164 useState<PrefilledAppsToolCall | null>(null);
165 const [errors, setErrors] = useState<Record<string, string | null>>({
166 resources: null,
167 prompts: null,
168 tools: null,
169 tasks: null,
170 });
171 const [command, setCommand] = useState<string>(getInitialCommand);
172 const [args, setArgs] = useState<string>(getInitialArgs);
173
174 const [sseUrl, setSseUrl] = useState<string>(getInitialSseUrl);
175 const [transportType, setTransportType] = useState<
176 "stdio" | "sse" | "streamable-http"
177 >(getInitialTransportType);
178 const [connectionType, setConnectionType] = useState<"direct" | "proxy">(
179 () => {
180 return (
181 (localStorage.getItem("lastConnectionType") as "direct" | "proxy") ||
182 "proxy"
183 );
184 },
185 );
186 const [logLevel, setLogLevel] = useState<LoggingLevel>("debug");
187 const [notifications, setNotifications] = useState<ServerNotification[]>([]);
188 const [roots, setRoots] = useState<Root[]>([]);
189 const [env, setEnv] = useState<Record<string, string>>({});
190
191 const [config, setConfig] = useState<InspectorConfig>(() =>
192 initializeInspectorConfig(CONFIG_LOCAL_STORAGE_KEY),
193 );
194 const [bearerToken, setBearerToken] = useState<string>(() => {
195 return localStorage.getItem("lastBearerToken") || "";
196 });
197
198 const [headerName, setHeaderName] = useState<string>(() => {
199 return localStorage.getItem("lastHeaderName") || "";
200 });
201
202 const [oauthClientId, setOauthClientId] = useState<string>(() => {

Callers

nothing calls this directly

Calls 15

executeStepMethod · 0.95
migrateFromLegacyAuthFunction · 0.90
useDraggablePaneFunction · 0.90
useDraggableSidebarFunction · 0.90
useConnectionFunction · 0.90
saveInspectorConfigFunction · 0.90
createProxyFetchFunction · 0.90
getMCPProxyAuthTokenFunction · 0.90
getMCPProxyAddressFunction · 0.90
cacheToolOutputSchemasFunction · 0.90
filterReservedMetadataFunction · 0.85

Tested by

no test coverage detected