leonvz-mcp-demo
v1.0.0
Published
A comprehensive MCP server demonstrating tools, resources, and prompts
Downloads
3
Maintainers
Readme
LeonVZ MCP Demo Server
A comprehensive Model Context Protocol (MCP) server that demonstrates all three main categories of MCP capabilities:
- 🔧 Tools - Execute actions and perform computations
- 📄 Resources - Provide access to data and files
- 💬 Prompts - Reusable templates for LLM interactions
Installation
Option 1: Use with npx (Recommended)
The easiest way to use this MCP server is with npx:
npx leonvz-mcp-demoOption 2: Install globally
npm install -g leonvz-mcp-demo
leonvz-mcp-demoOption 3: Install locally
npm install leonvz-mcp-demo
npx leonvz-mcp-demoClaude Desktop Integration
To use this server with Claude Desktop, add it to your configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"leonvz-mcp-demo": {
"command": "npx",
"args": ["-y", "leonvz-mcp-demo"]
}
}
}Alternatively, if you installed it globally:
{
"mcpServers": {
"leonvz-mcp-demo": {
"command": "leonvz-mcp-demo"
}
}
}What is MCP?
The Model Context Protocol (MCP) is an open standard for connecting AI applications to external data sources and tools. It allows AI models to:
- Access real-time data through Resources (like GET endpoints)
- Execute actions through Tools (like POST endpoints)
- Use structured interaction patterns through Prompts (reusable templates)
Think of MCP as a standardized API specifically designed for AI interactions.
Categories Explained
🔧 Tools
Tools allow AI models to execute actions and perform computations. They can have side effects and are used when you want the AI to do something.
Examples in this server:
calculate- Perform mathematical operationscreate_file- Create new files with contentlist_files- List files in the data directoryget_system_info- Get system information and metricsget_weather- Simulate weather data retrieval
📄 Resources
Resources provide AI models with access to data. They're like GET endpoints - they retrieve information but shouldn't have side effects.
Examples in this server:
config://server/settings- Server configuration datauser://profile/{userId}- Dynamic user profile lookupfile://data/{filename}- File content accesslogs://application/recent- Application logs
💬 Prompts
Prompts are reusable templates that structure how AI models should approach specific tasks. They provide consistency and best practices.
Examples in this server:
code-review- Structure code review feedbackcompose-email- Help write professional emailsmeeting-summary- Organize meeting notesproject-plan- Create project plans and timelines
Quick Start
1. Install and Test
# Install the package
npm install -g leonvz-mcp-demo
# Test with MCP Inspector
npx @modelcontextprotocol/inspector leonvz-mcp-demoThe MCP Inspector opens an interactive web interface where you can test all the tools, resources, and prompts.
2. Connect to Claude Desktop
Add this to your Claude Desktop configuration file and restart Claude:
{
"mcpServers": {
"leonvz-mcp-demo": {
"command": "npx",
"args": ["-y", "leonvz-mcp-demo"]
}
}
}Development Setup (Optional)
If you want to contribute or modify the server:
1. Clone and Install Dependencies
git clone https://github.com/leonvanzyl/mcp-demo.git
cd mcp-demo
npm install2. Build the Server
npm run build3. Test Locally
npm run inspectorUsage Examples
Testing Tools
Try asking Claude (when connected):
- "Calculate 15 multiplied by 7"
- "Create a file called 'notes.txt' with some content"
- "What's the current system information?"
- "What's the weather in Tokyo?"
Testing Resources
Try asking Claude:
- "Show me the server configuration"
- "Get the profile for user 1"
- "Read the contents of app.log"
- "What files are available?"
Testing Prompts
Try asking Claude:
- "Use the code-review prompt to review this JavaScript function"
- "Help me compose a professional email using the compose-email prompt"
- "Create a meeting summary for our team standup"
Project Structure
mcp-demo/
├── src/
│ └── server.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript output
├── mcp-data/ # Auto-created data directory
│ ├── config.json # Sample configuration
│ ├── users.json # Sample user data
│ └── app.log # Sample log file
├── package.json
├── tsconfig.json
└── README.mdKey Features
File Operations
- Create and manage files in the
mcp-datadirectory - List files with metadata (size, modification time)
- Read file contents through resources
User Management
- Dynamic user profile lookup by ID
- JSON-based user data storage
- Profile metadata with timestamps
System Integration
- Real-time system information
- Simulated metrics (CPU, memory, disk)
- Platform and runtime details
AI-Assisted Workflows
- Code review templates with focus areas
- Email composition for various purposes
- Meeting summary structuring
- Project planning assistance
Development
Run in Development Mode
npm run devAvailable Scripts
npm run build- Compile TypeScript to JavaScriptnpm run start- Run the compiled servernpm run dev- Build and run in one commandnpm run inspector- Open MCP Inspector for testing
Understanding MCP Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ MCP Client │ │ MCP Server │ │ Data Sources │
│ (Claude, etc.) │◄──►│ (This Demo) │◄──►│ (Files, APIs) │
└─────────────────┘ └─────────────────┘ └─────────────────┘- Client: AI applications that need context (Claude Desktop, IDEs, etc.)
- Server: This demo server that provides tools, resources, and prompts
- Data Sources: Files, APIs, databases that the server accesses
Real-World Applications
MCP servers can be built for:
- Development Tools: Code analysis, documentation, deployment
- Business Systems: CRM access, report generation, data analysis
- Content Management: File operations, content retrieval, publishing
- Communication: Email templates, meeting management, notifications
- Data Integration: Database access, API integration, data transformation
Learn More
License
MIT License - Feel free to use this as a starting point for your own MCP servers!
