MCP Developer Playground
Interactive MCP-powered developer assistant with LLM-driven workspace analysis tools and intelligent reasoning
Share this project:
Project Overview
MCP Developer Workspace
An AI-powered developer assistant that safely exposes project context through standardized MCP (Model Context Protocol) tools.
This system demonstrates how LLMs can interact with real-world codebases through a clean client-server architecture, providing transparency, safety, and extensibility.
๐ฏ Features
- 6 MCP Tools: Read files, list files, search content, file metadata, directory tree, workspace statistics
- Safety-First Design: Sandboxed workspace, path traversal protection, rate limiting
- Transparent Tool Invocation: Visual timeline showing every tool call with inputs and outputs
- Modern Web UI: React + TypeScript interface with dark mode and professional design
- Simple Reasoning: Intent classification that maps natural language to tool invocations
- Developer-Focused: Designed for understanding project context, not executing arbitrary commands
๐๏ธ Architecture
โโโโโโโโโโโโโโโ
โ Web UI โ โ React + TypeScript + Vite
โ (Port 5173)โ
โโโโโโโโฌโโโโโโโ
โ HTTP
โโโโโโโโผโโโโโโโ
โ MCP Client โ โ Intent Classification + Tool Selection
โ (Browser) โ
โโโโโโโโฌโโโโโโโ
โ HTTP POST /invoke
โโโโโโโโผโโโโโโโ
โ MCP Server โ โ Express + Tool Registry
โ (Port 3000)โ
โโโโโโโโฌโโโโโโโ
โ Sandboxed Access
โโโโโโโโผโโโโโโโ
โ Workspace โ โ ./workspace/* (read-only)
โ Directory โ
โโโโโโโโโโโโโโโ
๐ Available MCP Tools
| Tool | Description | Input | Safety |
|---|---|---|---|
read_file |
Read file content | { path: string } |
1MB size limit, path validation |
list_files |
List files with optional pattern | { directory?, pattern?, recursive? } |
Sandboxed to workspace |
search_files |
Search for text in files | { query, file_pattern?, case_sensitive? } |
100 result limit |
file_metadata |
Get file stats | { path: string } |
Read-only operation |
directory_tree |
Visual directory structure | { depth?: number } |
Max depth 5 levels |
workspace_stats |
Project statistics | {} |
Cached computation |
๐ Getting Started
Prerequisites
- Node.js 20+
- npm 9+
Installation
-
Install server dependencies:
npm install -
Install UI dependencies:
cd src/ui && npm install && cd ../..
Running the System
- Start the MCP Server (Terminal 1):
Server runs on
npm run serverhttp://localhost:3000
2 Start the Web UI (Terminal 2):
npm run ui
UI runs on http://localhost:5173
- Open your browser: Navigate to
http://localhost:5173
๐ก Example Queries
Try these natural language queries in the UI:
- "Show all TypeScript files" โ Invokes
list_fileswithpattern: "*.ts" - "Read utils.txt" โ Invokes
read_filewithpath: "utils.txt" - "Search for 'function'" โ Invokes
search_fileswithquery: "function" - "Show directory tree" โ Invokes
directory_tree - "Show workspace stats" โ Invokes
workspace_stats - "Get metadata for utils.txt" โ Invokes
file_metadata
๐ ๏ธ Project Structure
mcp-playground/
โโโ src/
โ โโโ server/ # MCP Server (Express + TypeScript)
โ โ โโโ index.ts # Server entrypoint, routes, middleware
โ โ โโโ tools.ts # Tool registry and handlers
โ โ โโโ middleware/ # Rate limiter
โ โ โโโ utils/ # Validation utilities
โ โ
โ โโโ client/ # MCP Client (CLI + Reasoning)
โ โ โโโ index.ts # Client entrypoint
โ โ โโโ reasoning.ts # Intent classification
โ โ
โ โโโ ui/ # Web UI (React + TypeScript + Vite)
โ โ โโโ src/
โ โ โ โโโ components/ # React components
โ โ โ โโโ services/ # API client
โ โ โ โโโ types/ # TypeScript types
โ โ โ โโโ styles/ # Global CSS
โ โ โโโ index.html
โ โ โโโ vite.config.ts
โ โ โโโ package.json
โ โ
โ โโโ types/ # Shared TypeScript types
โ โโโ mcp.ts
โ
โโโ workspace/ # Sandboxed workspace directory
โ โโโ utils.txt
โ
โโโ package.json
โโโ tsconfig.json
โโโ README.md
๐งช CLI Mode (Optional)
You can also use the MCP client from the command line:
npm run client -- "Show all TypeScript files"
๐ Safety Mechanisms
| Mechanism | Implementation | Purpose |
|---|---|---|
| Path Validation | validatePath() in utils/validation.ts |
Prevents directory traversal attacks |
| File Size Limits | 1MB max for read operations | Prevents memory exhaustion |
| Result Limits | Max 100 results for searches | Prevents DoS |
| Rate Limiting | 100 requests/minute per IP | Prevents abuse |
| Operation Timeout | 5 seconds max execution | Handles long-running operations |
| Sandboxed Workspace | All file access restricted to ./workspace/ |
Prevents system file access |
๐จ UI Features
- Dark Mode Design: Professional color palette optimized for developers
- Tool Call Timeline: Visual history of all tool invocations with status icons
- Context-Aware Result Viewer: Different rendering for each tool type:
- Syntax-highlighted code for
read_file - File lists with metadata for
list_files - Search results with line numbers for
search_files - Statistics dashboard for
workspace_stats
- Syntax-highlighted code for
- Example Prompts: Quick-start suggestions
- Responsive Layout: Works on desktop and tablet
๐ง Future Enhancements
Phase 2: File Modification Tools
- Add
write_file,delete_file,rename_file - Implement confirmation dialogs and undo functionality
Phase 3: Real LLM Integration
- Replace keyword-based reasoning with OpenAI/Anthropic/Gemini API
- Implement chain-of-thought reasoning for complex queries
Phase 4: IDE Integrations
- VS Code extension
- JetBrains plugin
- LSP integration for deeper code understanding
Phase 5: Multi-Project Support
- Switch between multiple workspaces
- Project-level configuration
- Workspace templates
Phase 6: Hosted Service
- Cloud deployment
- Authentication and authorization
- Team collaboration features
๐งโ๐ป Development
Running Tests (Future)
npm test # Unit tests
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
Building for Production
cd src/ui && npm run build
๐ License
MIT
๐ Acknowledgments
Built with inspiration from:
- Anthropic's Model Context Protocol
- Cursor
- Claude Code
- Google Antigravity
๐ค Why MCP?
MCP provides a standardized interface for LLMs to interact with external systems safely:
- โ Explicit tools instead of free-form commands
- โ Structured inputs with validation
- โ Clear client-server separation
- โ Transparency in tool invocation
- โ Safety-first design with sandboxing
This project is a portfolio-worthy demonstration of understanding AI infrastructure, safety mechanisms, and full-stack development.
Made with ๐ง by following the MCP specification and best practices in AI safety.