how to run this project give step by step process pls explain of this mcp and explain how this mcp works
pls
β Complete Step-by-Step Guide: Running Your System Info MCP Server
Let me explain everything from scratch - what MCP is, how it works, and how to run your server!
---
π Part 1: What is MCP (Model Context Protocol)?
Understanding MCP
MCP = Model Context Protocol
Think of it like this:
- Claude (AI) = A smart assistant that can answer questions
- MCP Server = A tool that extends Claude's abilities
- Protocol = A standard way for Claude and servers to talk to each other
Simple Analogy:
Claude is like a person with a phone (AI)
β
MCP is like installing apps on that phone (Protocol)
β
Your System Info Server is an app (MCP Server)
β
Now Claude can check your system info by "calling" the app
Without MCP:
User: "What's my CPU usage?"
Claude: "I'm sorry, I don't have access to your system information."
With MCP:
User: "What's my CPU usage?"
Claude: [Uses MCP to call your server]
[Your server checks system]
[Returns: "Ryzen 5 5600H - 25% usage"]
Claude: "Your CPU is running at 25% usage on a Ryzen 5 5600H."
---
π§ Part 2: How Your MCP Server Works
Architecture Overview:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Claude Desktop β
β (Claude AI running on your computer) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
β MCP Protocol (JSON-RPC over stdio)
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ
β Your MCP Server (Node.js) β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β index.js - Main Server β β
β β β’ Listens for requests from Claude β β
β β β’ Routes requests to appropriate tools β β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌββββββββββββββββββββββββββββββββββββ β
β β Tool Functions (cpu.js, memory.js, etc.) β β
β β β’ getCPUInfo() β β
β β β’ getMemoryInfo() β β
β β β’ getDiskInfo() β β
β β β’ ... (18 tools total) β β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌββββββββββββββββββββββββββββββββββββ β
β β systeminformation library β β
β β β’ Reads system data from OS β β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ
β Your Windows Operating System β
β β’ CPU stats, Memory, Disk, Network, Processes, etc. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Communication Flow (Step by Step):
1. User asks Claude: "What's my CPU usage?"
2. Claude decides: "I need to use the get_cpu_info tool"
3. Claude sends JSON request via stdio:
{
"method": "tools/call",
"params": {
"name": "get_cpu_info"
}
}
4. Your MCP server receives the request
5. Server calls getCPUInfo() function
6. getCPUInfo() calls systeminformation.cpu()
7. systeminformation reads CPU data from Windows
8. Data flows back:
Windows β systeminformation β getCPUInfo() β Server
9. Server formats response as JSON:
{
"content": [{
"type": "text",
"text": "{\"brand\":\"Ryzen 5 5600H\",\"usage\":25}"
}]
}
10. Server sends response to Claude via stdio
11. Claude receives data and formats it nicely
12. User sees: "Your CPU is a Ryzen 5 5600H running at 25% usage"
---
π Part 3: Step-by-Step Running Instructions
Prerequisites Check
First, verify you have everything installed:
# Check Node.js (should be v18+)
node --version
# Check npm
npm --version
# Navigate to your project
cd C:\Users\amogh\Downloads\mcp
---
Method 1: Running Standalone (Testing)
This is for testing the server manually.
Step 1: Build the Project
npm run build
What this does:
- Compiles TypeScript files (src/*.ts) β JavaScript files (dist/*.js)
- Takes ~5-10 seconds
- You'll see: "β Compiled successfully"
Step 2: Run the Server
node dist/index.js
What you'll see:
MCP System Info Server running on stdio
Available tools: 18
What this means:
- Server is running β
- Waiting for requests on stdin/stdout
- To stop: Press Ctrl + C
Step 3: Test Individual Tools (Optional)
node test-server.js
What you'll see:
Testing System Info MCP Server...
1. Testing get_cpu_info...
β CPU Info: Ryzen 5 5600H with Radeon Graphics - 12 cores
2. Testing get_memory_info...
β Memory Info: 7.35 GB total, 0.67 GB free
3. Testing get_os_info...
β OS Info: Microsoft Windows 11 Home Single Language
β All tests passed! The MCP server is working correctly.
---
Method 2: Running with Claude Desktop (Production)
This is the main way to use your MCP server!
Step 1: Locate Claude Desktop Config File
Windows Path:
%APPDATA%\Claude\claude_desktop_config.json
Or the full path:
C:\Users\amogh\AppData\Roaming\Claude\claude_desktop_config.json
How to open it:
Option A - Using File Explorer:
1. Press Windows + R
2. Type: %APPDATA%\Claude
3. Press Enter
4. Look for claude_desktop_config.json
5. Right-click β Open with β Notepad
Option B - Using Run command:
1. Press Windows + R
2. Type: notepad %APPDATA%\Claude\claude_desktop_config.json
3. Press Enter
Option C - Direct path:
1. Open File Explorer
2. Paste this in address bar: C:\Users\amogh\AppData\Roaming\Claude
3. Find claude_desktop_config.json
---
Step 2: Edit the Configuration File
If the file is empty or doesn't exist, add this:
{
"mcpServers": {
"system-info": {
"command": "node",
"args": ["C:/Users/amogh/Downloads/mcp/dist/index.js"]
}
}
}
If the file already has content, add your server to the mcpServers section:
{
"mcpServers": {
"existing-server": {
"command": "...",
"args": ["..."]
},
"system-info": {
"command": "node",
"args": ["C:/Users/amogh/Downloads/mcp/dist/index.js"]
}
}
}
β οΈ Important Notes:
- Use forward slashes (/) not backslashes (\)
- Make sure the path is correct
- JSON must be valid (use a JSON validator if unsure)
- Save the file after editing
---
Step 3: Restart Claude Desktop
Complete restart required:
1. Close Claude Desktop completely
- Right-click taskbar icon β Exit
- Or: Alt + F4
2. Wait 5 seconds
3. Open Claude Desktop again
Why restart? Claude only reads the config file on startup.
---
Step 4: Verify the Server is Connected
In Claude Desktop, look for:
- A small "plug" or "connection" icon in the interface
- Or check the settings/tools menu
To test if it's working:
Type in Claude:
Can you check my system information?
or
What tools do you have available?
Claude should mention it has access to system information tools.
---
Step 5: Use Your MCP Server!
Now you can ask Claude questions like:
CPU Monitoring:
What's my CPU usage right now?
What CPU do I have?
How many cores does my CPU have?
Is my CPU temperature normal?
Memory Monitoring:
How much RAM do I have?
How much memory is being used?
Show me memory statistics
Disk Information:
How much disk space do I have?
Which drives are almost full?
Show disk usage for all drives
System Information:
What operating system am I running?
What's my computer's uptime?
What's my hostname?
Give me complete system specs
Process Management:
What are the top 10 processes by CPU usage?
Show me processes using the most memory
How many processes are running?
Network Information:
What's my IP address?
Show me all network interfaces
Am I connected to the internet?
What WiFi networks can I see?
Hardware:
What graphics card do I have?
What's my screen resolution?
What's my battery percentage?
Show me hardware information
---
π Part 4: Understanding What Happens Behind the Scenes
When You Ask: "What's my CPU usage?"
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Step 1: You type in Claude Desktop β
β "What's my CPU usage?" β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 2: Claude AI analyzes your question β
β β’ Realizes it needs system information β
β β’ Sees "system-info" MCP server is available β
β β’ Decides to use "get_cpu_info" tool β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 3: Claude sends MCP request β
β β
β Via stdio (standard input/output): β
β { β
β "jsonrpc": "2.0", β
β "method": "tools/call", β
β "params": { β
β "name": "get_cpu_info", β
β "arguments": {} β
β } β
β } β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 4: Your MCP Server (index.js) receives request β
β β
β server.setRequestHandler(CallToolRequestSchema, ...) β
β β’ Parses the JSON β
β β’ Sees tool name is "get_cpu_info" β
β β’ Calls getCPUInfo() function β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 5: getCPUInfo() in tools/cpu.js executes β
β β
β import si from 'systeminformation'; β
β β
β const cpuData = await si.cpu(); β
β const currentLoad = await si.currentLoad(); β
β const cpuTemp = await si.cpuTemperature(); β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 6: systeminformation library reads Windows β
β β
β On Windows, it uses: β
β β’ WMI (Windows Management Instrumentation) β
β β’ PowerShell commands β
β β’ System APIs β
β β
β Gets data like: β
β β’ CPU model: "AMD Ryzen 5 5600H" β
β β’ Cores: 6 physical, 12 logical β
β β’ Current usage: 23.5% β
β β’ Temperature: 55Β°C β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 7: Data flows back to getCPUInfo() β
β β
β const cpuInfo = { β
β manufacturer: "AMD", β
β brand: "Ryzen 5 5600H", β
β cores: 12, β
β usage: 23.5, β
β temperature: 55 β
β }; β
β β
β return { β
β content: [{ β
β type: "text", β
β text: JSON.stringify(cpuInfo, null, 2) β
β }] β
β }; β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 8: Server sends response back to Claude β
β β
β Via stdio (standard output): β
β { β
β "content": [{ β
β "type": "text", β
β "text": "{ β
β \"manufacturer\": \"AMD\", β
β \"brand\": \"Ryzen 5 5600H\", β
β \"cores\": 12, β
β \"usage\": 23.5, β
β \"temperature\": 55 β
β }" β
β }] β
β } β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 9: Claude receives and interprets the data β
β β’ Parses the JSON response β
β β’ Understands the CPU information β
β β’ Formats it into natural language β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β Step 10: You see the response β
β β
β "Your CPU is an AMD Ryzen 5 5600H with 12 cores β
β (6 physical, 12 logical with hyperthreading). It's β
β currently running at 23.5% usage and the temperature β
β is 55Β°C, which is normal." β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Total time: Usually less than 1 second! β‘
---
π οΈ Part 5: Troubleshooting Common Issues
Issue 1: "Cannot find module"
Error:
Error: Cannot find module 'systeminformation'
Solution:
cd C:\Users\amogh\Downloads\mcp
npm install
---
Issue 2: "tsc: command not found"
Error:
'tsc' is not recognized as an internal or external command
Solution:
npm install
npm run build
---
Issue 3: Server doesn't show up in Claude
Possible causes:
A) Config file path wrong
// β Wrong (backslashes)
"args": ["C:\\Users\\amogh\\Downloads\\mcp\\dist\\index.js"]
// β
Correct (forward slashes)
"args": ["C:/Users/amogh/Downloads/mcp/dist/index.js"]
B) Didn't restart Claude Desktop
- Must completely close and reopen Claude
C) JSON syntax error
- Use https://jsonlint.com/ to validate your JSON
D) Node.js not in PATH
// Use full path to node.exe
{
"mcpServers": {
"system-info": {
"command": "C:/Program Files/nodejs/node.exe",
"args": ["C:/Users/amogh/Downloads/mcp/dist/index.js"]
}
}
}
---
Issue 4: "Permission Denied" Errors
Some tools require elevated privileges:
Solution:
- Run Claude Desktop as Administrator (right-click β Run as administrator)
- Or accept that some features (WiFi scan, temperatures) may not work without admin rights
---
Issue 5: Server crashes or shows errors
Check the logs:
Windows:
%APPDATA%\Claude\logs
Look for errors mentioning your server
Common fixes:
# Rebuild the project
cd C:\Users\amogh\Downloads\mcp
npm run build
# Test manually
node dist/index.js
# Run test script
node test-server.js
---
π Part 6: Monitoring Your Server
Check if server is running:
When manually testing:
node dist/index.js
# You should see:
# MCP System Info Server running on stdio
# Available tools: 18
When running via Claude:
- Claude automatically starts/stops the server as needed
- You won't see the server process running separately
View server activity:
Enable debug logging (if needed):
Edit dist/index.js and add after line 1:
console.error('Debug: Server started');
Then check Claude's logs:
%APPDATA%\Claude\logs
---
π― Part 7: Quick Reference
File Locations:
Your Project:
C:\Users\amogh\Downloads\mcp\
Source Code:
C:\Users\amogh\Downloads\mcp\src\
Compiled Code (what runs):
C:\Users\amogh\Downloads\mcp\dist\
Claude Config:
C:\Users\amogh\AppData\Roaming\Claude\claude_desktop_config.json
Claude Logs:
C:\Users\amogh\AppData\Roaming\Claude\logs\
Common Commands:
# Build the project
npm run build
# Run manually
node dist/index.js
# Test the server
node test-server.js
# Rebuild (after making changes)
npm run build
# Watch mode (auto-rebuild on changes)
npm run watch
Config Template:
{
"mcpServers": {
"system-info": {
"command": "node",
"args": ["C:/Users/amogh/Downloads/mcp/dist/index.js"]
}
}
}
---
β
Final Checklist
Before using with Claude Desktop:
- Node.js installed (v18+)
- Project built (npm run build)
- Test script passes (node test-server.js)
- Config file created/edited
- Path uses forward slashes (/)
- Claude Desktop restarted
- Tested with a simple question
---
π Success Indicators
You know it's working when:
β
Test script shows: "All tests passed!"
β
Claude responds to system info questions
β
Claude mentions having access to system tools
β
You can ask "What's my CPU?" and get a real answer
β
No error messages in Claude
---
You're all set! Your System Info MCP Server is ready to use! π
Any questions about a specific step? Let me know!