🧠 Build a minimal but scalable dashboard UI for a custom MCP (Model Context Protocol) server.
This is for developers to safely monitor, inspect, and control MCP modules in real time.
---
📂 File structure:
The project lives at `/Users/Jadaking/Desktop/bb` and uses this folder layout:
- `src/components/` contains all UI modules
- `lib/` contains `mcpApi.ts`, `types.ts`, and `constants.ts`
- `styles/` for Tailwind global CSS
- `.env.local` holds all environment variables like `MCP_API_URL`, `FIREBASE_API_KEY`, and `PINECONE_API_KEY`
---
🎯 Goals:
1. Show a list of MCP modules defined in `mcp.config.json`
2. Display real-time logs and filter them by level
3. Render safe JSON config viewer (`readonly` mode)
4. Show a list of declared functions and their parameters
5. Visualize usage via Chart.js or Recharts (optional)
6. Build a modular layout with sidebar and topbar
---
🎨 Design System:
- Use `Tailwind CSS` + `Shadcn UI`
- Base layout = Sidebar + Topbar + Main panel
- Use `SWR` or polling for real-time reactivity
- Status badges: 🟢 Active / 🟡 Pending / 🔴 Down
- Dark mode as default theme
---
📦 Pages & Components:
pages/
└── index.tsx # Entry to dashboard
components/
├── layout/
│ ├── Sidebar.tsx
│ └── Topbar.tsx
├── modules/
│ ├── ModuleCard.tsx
│ ├── ModuleList.tsx
│ └── ModuleControlPanel.tsx
├── config/
│ └── ConfigViewer.tsx
├── logs/
│ └── LogStream.tsx
├── functions/
│ └── FunctionList.tsx
├── charts/
│ └── AgentUsageChart.tsx (optional)
├── common/
│ └── StatusBadge.tsx
---
✅ Environment variables are preconfigured in `.env.local`.
Use `process.env.MCP_API_URL` for all API fetches.
---
This is for a developer-focused, real-time monitoring UI of a server backend.
Focus on **clarity, reusability, and modularity**.
Loading...
Loading...
좋아 형! 그럼 이제 v0에게 전달할 수 있도록, 환경 전환(Development/Production) 기능 전체 세트 📦 Topbar UI + API 유틸 + 상태 저장 + UI 표시를 한 번에 만들라고 요청하는 완성형 프롬프트를 줄게.
⸻
✅ v0.dev Prompt: 환경 전환 가능한 MCP 대시보드 구성 요청
🧠 Goal: Enhance the MCP Dashboard with dynamic environment switching between development and production MCP servers.
http://localhost:4000
https://mcp.dorandoran.link
These URLs are used for all API calls (modules, logs, config, functions).
The user should be able to switch environments via a topbar dropdown.
select
dropdown with options:
localStorage
// lib/env.ts
const ENVIRONMENTS = {
development: "http://localhost:4000",
production: "https://mcp.dorandoran.link"
};
export function getCurrentApiUrl(): string {
if (typeof window === "undefined") return ENVIRONMENTS.production;
const env = localStorage.getItem("mcp_env") || "development";
return ENVIRONMENTS[env] || ENVIRONMENTS.development;
}
export function setCurrentEnvironment(env: "development" | "production") {
localStorage.setItem("mcp_env", env);
}
export function getCurrentEnvironment(): "development" | "production" {
return (localStorage.getItem("mcp_env") as any) || "development";
}
⸻
3. 🌐 All API Calls
Update all API calls in lib/mcpApi.ts to use:
import { getCurrentApiUrl } from "./env";
const baseUrl = getCurrentApiUrl();
export async function fetchModules() {
return fetch(`${baseUrl}/modules`).then(res => res.json());
}
⸻
💾 Behavior:
• Environment is persisted in localStorage
• Dashboard always uses dynamic base URL
• Current environment is clearly visible in UI
• Switching is instant and global
⸻
✅ Benefits:
1. Develop and test locally, then switch to production for validation
2. No hardcoded API URLs
3. Ready for future expansion (e.g., staging, sandbox)
4. Developer clarity with ENV display in Topbar
⸻
This update ensures flexible, safe switching between multiple MCP server environments during development and deployment.
---
## 💡 이 프롬프트를 전달하면?
- `Topbar.tsx` 안에 ENV 드롭다운 UI 생성
- `lib/env.ts`에 환경 전환 함수 생성
- `lib/mcpApi.ts`에서 API 주소 자동 전환 구조로 리팩토링