Prettier changes
This commit is contained in:
parent
b326e36ccc
commit
a225929ae2
11 changed files with 117 additions and 186 deletions
|
|
@ -19,10 +19,7 @@ export default tseslint.config(
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...reactHooks.configs.recommended.rules,
|
...reactHooks.configs.recommended.rules,
|
||||||
'react-refresh/only-export-components': [
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,19 @@
|
||||||
|
|
||||||
<!-- Primary Meta Tags -->
|
<!-- Primary Meta Tags -->
|
||||||
<title>MCP Inspector - use-mcp React Hook Demo</title>
|
<title>MCP Inspector - use-mcp React Hook Demo</title>
|
||||||
<meta name="description" content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library." />
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library."
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- Open Graph / Facebook -->
|
<!-- Open Graph / Facebook -->
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:site_name" content="MCP Inspector" />
|
<meta property="og:site_name" content="MCP Inspector" />
|
||||||
<meta property="og:title" content="MCP Inspector - use-mcp React Hook Demo" />
|
<meta property="og:title" content="MCP Inspector - use-mcp React Hook Demo" />
|
||||||
<meta property="og:description" content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library." />
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library."
|
||||||
|
/>
|
||||||
<meta property="og:image" content="https://inspector.use-mcp.dev/use-mcp-card.png" />
|
<meta property="og:image" content="https://inspector.use-mcp.dev/use-mcp-card.png" />
|
||||||
<meta property="og:image:width" content="1200" />
|
<meta property="og:image:width" content="1200" />
|
||||||
<meta property="og:image:height" content="630" />
|
<meta property="og:image:height" content="630" />
|
||||||
|
|
@ -23,7 +29,10 @@
|
||||||
<!-- Twitter -->
|
<!-- Twitter -->
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:title" content="MCP Inspector - use-mcp React Hook Demo" />
|
<meta name="twitter:title" content="MCP Inspector - use-mcp React Hook Demo" />
|
||||||
<meta name="twitter:description" content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library." />
|
<meta
|
||||||
|
name="twitter:description"
|
||||||
|
content="Interactive demo of the use-mcp React hook for Model Context Protocol (MCP) servers. Connect to MCP servers, explore available tools, and execute commands using the use-mcp library."
|
||||||
|
/>
|
||||||
<meta name="twitter:image" content="https://inspector.use-mcp.dev/use-mcp-card.png" />
|
<meta name="twitter:image" content="https://inspector.use-mcp.dev/use-mcp-card.png" />
|
||||||
|
|
||||||
<!-- Additional Meta Tags -->
|
<!-- Additional Meta Tags -->
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@ function App() {
|
||||||
<Router>
|
<Router>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/oauth/callback" element={<OAuthCallback />} />
|
<Route path="/oauth/callback" element={<OAuthCallback />} />
|
||||||
<Route path="/" element={
|
<Route
|
||||||
|
path="/"
|
||||||
|
element={
|
||||||
<div className="min-h-screen bg-gray-50 flex items-center justify-center p-4">
|
<div className="min-h-screen bg-gray-50 flex items-center justify-center p-4">
|
||||||
<div className="w-full max-w-2xl">
|
<div className="w-full max-w-2xl">
|
||||||
<div className="text-center mb-8">
|
<div className="text-center mb-8">
|
||||||
|
|
@ -28,7 +30,8 @@ function App() {
|
||||||
<McpServers />
|
<McpServers />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
} />
|
}
|
||||||
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Router>
|
</Router>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,8 @@ import { useState, useRef, useEffect } from 'react'
|
||||||
import { useMcp, type Tool } from 'use-mcp/react'
|
import { useMcp, type Tool } from 'use-mcp/react'
|
||||||
import { Info, X, ChevronRight, ChevronDown } from 'lucide-react'
|
import { Info, X, ChevronRight, ChevronDown } from 'lucide-react'
|
||||||
|
|
||||||
|
|
||||||
// MCP Connection wrapper that only renders when active
|
// MCP Connection wrapper that only renders when active
|
||||||
function McpConnection({
|
function McpConnection({ serverUrl, onConnectionUpdate }: { serverUrl: string; onConnectionUpdate: (data: any) => void }) {
|
||||||
serverUrl,
|
|
||||||
onConnectionUpdate,
|
|
||||||
}: {
|
|
||||||
serverUrl: string
|
|
||||||
onConnectionUpdate: (data: any) => void
|
|
||||||
}) {
|
|
||||||
// Use the MCP hook with the server URL
|
// Use the MCP hook with the server URL
|
||||||
const connection = useMcp({
|
const connection = useMcp({
|
||||||
url: serverUrl,
|
url: serverUrl,
|
||||||
|
|
@ -22,23 +15,13 @@ function McpConnection({
|
||||||
// Update parent component with connection data
|
// Update parent component with connection data
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onConnectionUpdate(connection)
|
onConnectionUpdate(connection)
|
||||||
}, [
|
}, [connection.state, connection.tools, connection.error, connection.log.length, connection.authUrl])
|
||||||
connection.state,
|
|
||||||
connection.tools,
|
|
||||||
connection.error,
|
|
||||||
connection.log.length,
|
|
||||||
connection.authUrl,
|
|
||||||
])
|
|
||||||
|
|
||||||
// Return null as this is just a hook wrapper
|
// Return null as this is just a hook wrapper
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
export function McpServers({
|
export function McpServers({ onToolsUpdate }: { onToolsUpdate?: (tools: Tool[]) => void }) {
|
||||||
onToolsUpdate,
|
|
||||||
}: {
|
|
||||||
onToolsUpdate?: (tools: Tool[]) => void
|
|
||||||
}) {
|
|
||||||
const [serverUrl, setServerUrl] = useState(() => {
|
const [serverUrl, setServerUrl] = useState(() => {
|
||||||
return sessionStorage.getItem('mcpServerUrl') || ''
|
return sessionStorage.getItem('mcpServerUrl') || ''
|
||||||
})
|
})
|
||||||
|
|
@ -53,8 +36,7 @@ export function McpServers({
|
||||||
retry: () => {},
|
retry: () => {},
|
||||||
disconnect: () => {},
|
disconnect: () => {},
|
||||||
authenticate: () => Promise.resolve(undefined),
|
authenticate: () => Promise.resolve(undefined),
|
||||||
callTool: (_name: string, _args?: Record<string, unknown>) =>
|
callTool: (_name: string, _args?: Record<string, unknown>) => Promise.resolve(undefined),
|
||||||
Promise.resolve(undefined),
|
|
||||||
clearStorage: () => {},
|
clearStorage: () => {},
|
||||||
})
|
})
|
||||||
const [toolForms, setToolForms] = useState<Record<string, Record<string, any>>>({})
|
const [toolForms, setToolForms] = useState<Record<string, Record<string, any>>>({})
|
||||||
|
|
@ -64,8 +46,7 @@ export function McpServers({
|
||||||
const executionLogRefs = useRef<Record<string, HTMLTextAreaElement | null>>({})
|
const executionLogRefs = useRef<Record<string, HTMLTextAreaElement | null>>({})
|
||||||
|
|
||||||
// Extract connection properties
|
// Extract connection properties
|
||||||
const { state, tools, log, authUrl, disconnect, authenticate } =
|
const { state, tools, log, authUrl, disconnect, authenticate } = connectionData
|
||||||
connectionData
|
|
||||||
|
|
||||||
// Notify parent component when tools change
|
// Notify parent component when tools change
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -73,9 +54,8 @@ export function McpServers({
|
||||||
onToolsUpdate(
|
onToolsUpdate(
|
||||||
tools.map((t: Tool) => ({
|
tools.map((t: Tool) => ({
|
||||||
...t,
|
...t,
|
||||||
callTool: (args: Record<string, unknown>) =>
|
callTool: (args: Record<string, unknown>) => connectionData.callTool(t.name, args),
|
||||||
connectionData.callTool(t.name, args),
|
}))
|
||||||
})),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, [tools, onToolsUpdate])
|
}, [tools, onToolsUpdate])
|
||||||
|
|
@ -99,8 +79,7 @@ export function McpServers({
|
||||||
retry: () => {},
|
retry: () => {},
|
||||||
disconnect: () => {},
|
disconnect: () => {},
|
||||||
authenticate: () => Promise.resolve(undefined),
|
authenticate: () => Promise.resolve(undefined),
|
||||||
callTool: (_name: string, _args?: Record<string, unknown>) =>
|
callTool: (_name: string, _args?: Record<string, unknown>) => Promise.resolve(undefined),
|
||||||
Promise.resolve(undefined),
|
|
||||||
clearStorage: () => {},
|
clearStorage: () => {},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -127,48 +106,20 @@ export function McpServers({
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 'discovering':
|
case 'discovering':
|
||||||
return (
|
return <span className={`${baseClasses} bg-blue-100 text-blue-800`}>Discovering</span>
|
||||||
<span className={`${baseClasses} bg-blue-100 text-blue-800`}>
|
|
||||||
Discovering
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'authenticating':
|
case 'authenticating':
|
||||||
return (
|
return <span className={`${baseClasses} bg-purple-100 text-purple-800`}>Authenticating</span>
|
||||||
<span className={`${baseClasses} bg-purple-100 text-purple-800`}>
|
|
||||||
Authenticating
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'connecting':
|
case 'connecting':
|
||||||
return (
|
return <span className={`${baseClasses} bg-yellow-100 text-yellow-800`}>Connecting</span>
|
||||||
<span className={`${baseClasses} bg-yellow-100 text-yellow-800`}>
|
|
||||||
Connecting
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'loading':
|
case 'loading':
|
||||||
return (
|
return <span className={`${baseClasses} bg-orange-100 text-orange-800`}>Loading</span>
|
||||||
<span className={`${baseClasses} bg-orange-100 text-orange-800`}>
|
|
||||||
Loading
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'ready':
|
case 'ready':
|
||||||
return (
|
return <span className={`${baseClasses} bg-green-100 text-green-800`}>Connected</span>
|
||||||
<span className={`${baseClasses} bg-green-100 text-green-800`}>
|
|
||||||
Connected
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'failed':
|
case 'failed':
|
||||||
return (
|
return <span className={`${baseClasses} bg-red-100 text-red-800`}>Failed</span>
|
||||||
<span className={`${baseClasses} bg-red-100 text-red-800`}>
|
|
||||||
Failed
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
case 'not-connected':
|
case 'not-connected':
|
||||||
default:
|
default:
|
||||||
return (
|
return <span className={`${baseClasses} bg-gray-100 text-gray-800`}>Not Connected</span>
|
||||||
<span className={`${baseClasses} bg-gray-100 text-gray-800`}>
|
|
||||||
Not Connected
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,28 +154,28 @@ export function McpServers({
|
||||||
|
|
||||||
// Handle form input changes
|
// Handle form input changes
|
||||||
const handleFormChange = (toolName: string, fieldName: string, value: any) => {
|
const handleFormChange = (toolName: string, fieldName: string, value: any) => {
|
||||||
setToolForms(prev => ({
|
setToolForms((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[toolName]: {
|
[toolName]: {
|
||||||
...prev[toolName],
|
...prev[toolName],
|
||||||
[fieldName]: value
|
[fieldName]: value,
|
||||||
}
|
},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function to clean and update execution log
|
// Helper function to clean and update execution log
|
||||||
const updateExecutionLog = (toolName: string, newContent: string) => {
|
const updateExecutionLog = (toolName: string, newContent: string) => {
|
||||||
setToolExecutionLogs(prev => {
|
setToolExecutionLogs((prev) => {
|
||||||
const currentLog = prev[toolName] || ''
|
const currentLog = prev[toolName] || ''
|
||||||
const updatedLog = currentLog + newContent
|
const updatedLog = currentLog + newContent
|
||||||
// Remove blank lines and rejoin
|
// Remove blank lines and rejoin
|
||||||
const cleanedLog = updatedLog
|
const cleanedLog = updatedLog
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(line => line.trim() !== '')
|
.filter((line) => line.trim() !== '')
|
||||||
.join('\n')
|
.join('\n')
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
[toolName]: cleanedLog + '\n'
|
[toolName]: cleanedLog + '\n',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -249,7 +200,7 @@ export function McpServers({
|
||||||
|
|
||||||
// Auto-scroll execution logs to bottom when they change
|
// Auto-scroll execution logs to bottom when they change
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Object.keys(toolExecutionLogs).forEach(toolName => {
|
Object.keys(toolExecutionLogs).forEach((toolName) => {
|
||||||
const textarea = executionLogRefs.current[toolName]
|
const textarea = executionLogRefs.current[toolName]
|
||||||
if (textarea) {
|
if (textarea) {
|
||||||
textarea.scrollTop = textarea.scrollHeight
|
textarea.scrollTop = textarea.scrollHeight
|
||||||
|
|
@ -259,17 +210,17 @@ export function McpServers({
|
||||||
|
|
||||||
// Clear execution log for specific tool
|
// Clear execution log for specific tool
|
||||||
const clearExecutionLog = (toolName: string) => {
|
const clearExecutionLog = (toolName: string) => {
|
||||||
setToolExecutionLogs(prev => ({
|
setToolExecutionLogs((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[toolName]: ''
|
[toolName]: '',
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle tool expanded state
|
// Toggle tool expanded state
|
||||||
const toggleTool = (toolName: string) => {
|
const toggleTool = (toolName: string) => {
|
||||||
setExpandedTools(prev => ({
|
setExpandedTools((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[toolName]: !prev[toolName]
|
[toolName]: !prev[toolName],
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -286,8 +237,8 @@ export function McpServers({
|
||||||
step={schema.type === 'integer' ? 1 : 'any'}
|
step={schema.type === 'integer' ? 1 : 'any'}
|
||||||
required={isRequired}
|
required={isRequired}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const newValue = e.target.value === '' ? '' :
|
const newValue =
|
||||||
(schema.type === 'integer' ? parseInt(e.target.value) || 0 : parseFloat(e.target.value) || 0)
|
e.target.value === '' ? '' : schema.type === 'integer' ? parseInt(e.target.value) || 0 : parseFloat(e.target.value) || 0
|
||||||
handleFormChange(toolName, fieldName, newValue)
|
handleFormChange(toolName, fieldName, newValue)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -324,8 +275,7 @@ export function McpServers({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-gray-500 text-xs mt-1 mb-3">
|
<p className="text-gray-500 text-xs mt-1 mb-3">
|
||||||
Connect to Model Context Protocol (MCP) servers to access additional AI
|
Connect to Model Context Protocol (MCP) servers to access additional AI capabilities.
|
||||||
capabilities.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
|
|
@ -343,8 +293,7 @@ export function McpServers({
|
||||||
disabled={isActive && state !== 'failed'}
|
disabled={isActive && state !== 'failed'}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{state === 'ready' ||
|
{state === 'ready' || (isActive && state !== 'not-connected' && state !== 'failed') ? (
|
||||||
(isActive && state !== 'not-connected' && state !== 'failed') ? (
|
|
||||||
<button
|
<button
|
||||||
className="px-4 py-2 bg-orange-100 hover:bg-orange-200 text-orange-900 rounded text-sm font-medium whitespace-nowrap"
|
className="px-4 py-2 bg-orange-100 hover:bg-orange-200 text-orange-900 rounded text-sm font-medium whitespace-nowrap"
|
||||||
onClick={handleDisconnect}
|
onClick={handleDisconnect}
|
||||||
|
|
@ -365,9 +314,7 @@ export function McpServers({
|
||||||
{/* Authentication Link if needed */}
|
{/* Authentication Link if needed */}
|
||||||
{authUrl && (
|
{authUrl && (
|
||||||
<div className="p-3 bg-orange-50 border border-orange-200 rounded">
|
<div className="p-3 bg-orange-50 border border-orange-200 rounded">
|
||||||
<p className="text-xs mb-2">
|
<p className="text-xs mb-2">Authentication required. Please click the link below:</p>
|
||||||
Authentication required. Please click the link below:
|
|
||||||
</p>
|
|
||||||
<a
|
<a
|
||||||
href={authUrl}
|
href={authUrl}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
@ -382,9 +329,7 @@ export function McpServers({
|
||||||
|
|
||||||
{/* Available Tools section - always present */}
|
{/* Available Tools section - always present */}
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-medium text-sm mb-3">
|
<h3 className="font-medium text-sm mb-3">Available Tools ({tools.length})</h3>
|
||||||
Available Tools ({tools.length})
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
{tools.length === 0 ? (
|
{tools.length === 0 ? (
|
||||||
<div className="border border-gray-200 rounded p-4 bg-gray-50 text-center text-gray-500 text-sm">
|
<div className="border border-gray-200 rounded p-4 bg-gray-50 text-center text-gray-500 text-sm">
|
||||||
|
|
@ -410,26 +355,16 @@ export function McpServers({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Tool name */}
|
{/* Tool name */}
|
||||||
<h4 className="font-bold text-base text-black flex-shrink-0">
|
<h4 className="font-bold text-base text-black flex-shrink-0">{tool.name}</h4>
|
||||||
{tool.name}
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
{/* Tool description when collapsed */}
|
{/* Tool description when collapsed */}
|
||||||
{!isExpanded && tool.description && (
|
{!isExpanded && tool.description && <p className="text-gray-600 text-sm truncate ml-2">{tool.description}</p>}
|
||||||
<p className="text-gray-600 text-sm truncate ml-2">
|
|
||||||
{tool.description}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Expanded content */}
|
{/* Expanded content */}
|
||||||
{isExpanded && (
|
{isExpanded && (
|
||||||
<div className="px-3 pb-3 border-t border-gray-100">
|
<div className="px-3 pb-3 border-t border-gray-100">
|
||||||
{tool.description && (
|
{tool.description && <p className="text-gray-600 mb-4 text-sm leading-relaxed mt-3">{tool.description}</p>}
|
||||||
<p className="text-gray-600 mb-4 text-sm leading-relaxed mt-3">
|
|
||||||
{tool.description}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Form for tool parameters */}
|
{/* Form for tool parameters */}
|
||||||
{tool.inputSchema && tool.inputSchema.properties && (
|
{tool.inputSchema && tool.inputSchema.properties && (
|
||||||
|
|
@ -440,9 +375,7 @@ export function McpServers({
|
||||||
return (
|
return (
|
||||||
<div key={fieldName} className={`space-y-1 ${isTextInput ? 'w-full' : ''}`}>
|
<div key={fieldName} className={`space-y-1 ${isTextInput ? 'w-full' : ''}`}>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<label className="text-xs font-medium text-gray-700">
|
<label className="text-xs font-medium text-gray-700">{fieldName}</label>
|
||||||
{fieldName}
|
|
||||||
</label>
|
|
||||||
{schema.description && (
|
{schema.description && (
|
||||||
<div className="relative group">
|
<div className="relative group">
|
||||||
<Info size={12} className="text-gray-400 cursor-help" />
|
<Info size={12} className="text-gray-400 cursor-help" />
|
||||||
|
|
@ -452,9 +385,7 @@ export function McpServers({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>{renderFormField(tool.name, fieldName, schema, isRequired)}</div>
|
||||||
{renderFormField(tool.name, fieldName, schema, isRequired)}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|
@ -484,7 +415,9 @@ export function McpServers({
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<textarea
|
<textarea
|
||||||
ref={(el) => { executionLogRefs.current[tool.name] = el }}
|
ref={(el) => {
|
||||||
|
executionLogRefs.current[tool.name] = el
|
||||||
|
}}
|
||||||
value={toolExecutionLogs[tool.name]}
|
value={toolExecutionLogs[tool.name]}
|
||||||
readOnly
|
readOnly
|
||||||
className="w-full h-32 p-2 border border-gray-200 rounded text-[10px] font-mono bg-gray-50 resize-none placeholder-gray-300"
|
className="w-full h-32 p-2 border border-gray-200 rounded text-[10px] font-mono bg-gray-50 resize-none placeholder-gray-300"
|
||||||
|
|
@ -504,10 +437,7 @@ export function McpServers({
|
||||||
{/* Debug Log */}
|
{/* Debug Log */}
|
||||||
<div>
|
<div>
|
||||||
<label className="font-medium text-xs block mb-2">Debug Log</label>
|
<label className="font-medium text-xs block mb-2">Debug Log</label>
|
||||||
<div
|
<div ref={logRef} className="border border-gray-200 rounded p-2 bg-gray-50 h-32 overflow-y-auto font-mono text-xs">
|
||||||
ref={logRef}
|
|
||||||
className="border border-gray-200 rounded p-2 bg-gray-50 h-32 overflow-y-auto font-mono text-xs"
|
|
||||||
>
|
|
||||||
{log.length > 0 ? (
|
{log.length > 0 ? (
|
||||||
log.map((entry: any, index: number) => (
|
log.map((entry: any, index: number) => (
|
||||||
<div
|
<div
|
||||||
|
|
@ -546,12 +476,7 @@ export function McpServers({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Only render the actual MCP connection when active */}
|
{/* Only render the actual MCP connection when active */}
|
||||||
{isActive && (
|
{isActive && <McpConnection serverUrl={serverUrl} onConnectionUpdate={setConnectionData} />}
|
||||||
<McpConnection
|
|
||||||
serverUrl={serverUrl}
|
|
||||||
onConnectionUpdate={setConnectionData}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
@plugin "@tailwindcss/typography";
|
@plugin "@tailwindcss/typography";
|
||||||
@config "../tailwind.config.js";
|
@config "../tailwind.config.js";
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ import App from './App.tsx'
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</StrictMode>,
|
</StrictMode>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
4
examples/inspector/src/vite-env.d.ts
vendored
4
examples/inspector/src/vite-env.d.ts
vendored
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
apiKeyModalResolve?: (value: boolean) => void;
|
apiKeyModalResolve?: (value: boolean) => void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {}
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@ module.exports = {
|
||||||
DEFAULT: {
|
DEFAULT: {
|
||||||
css: {
|
css: {
|
||||||
pre: {
|
pre: {
|
||||||
padding: "0",
|
padding: '0',
|
||||||
filter: "brightness(96%)",
|
filter: 'brightness(96%)',
|
||||||
border: "0",
|
border: '0',
|
||||||
backgroundColor: "transparent",
|
backgroundColor: 'transparent',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,5 @@
|
||||||
"noUnusedParameters": false
|
"noUnusedParameters": false
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
"references": [
|
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
|
||||||
{ "path": "./tsconfig.app.json" },
|
|
||||||
{ "path": "./tsconfig.node.json" }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from 'vite'
|
||||||
import react from "@vitejs/plugin-react";
|
import react from '@vitejs/plugin-react'
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
});
|
})
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
{
|
||||||
"pattern": "inspector.use-mcp.dev",
|
"pattern": "inspector.use-mcp.dev",
|
||||||
"custom_domain": true
|
"custom_domain": true,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
"workers_dev": true,
|
"workers_dev": true,
|
||||||
// "main": "api/index.ts",
|
// "main": "api/index.ts",
|
||||||
|
|
@ -19,11 +19,11 @@
|
||||||
// },
|
// },
|
||||||
"assets": {
|
"assets": {
|
||||||
"not_found_handling": "single-page-application",
|
"not_found_handling": "single-page-application",
|
||||||
"directory": "dist"
|
"directory": "dist",
|
||||||
},
|
},
|
||||||
"observability": {
|
"observability": {
|
||||||
"enabled": true
|
"enabled": true,
|
||||||
}
|
},
|
||||||
/**
|
/**
|
||||||
* Smart Placement
|
* Smart Placement
|
||||||
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue