🚀 First MCP Server
Build your first Model Context Protocol (MCP) Server using the official MCP TypeScript SDK.
This project is part of my 30 Days AI DevOps Challenge, where I'm building an AI DevOps Assistant from scratch while explaining every concept in simple terms.
📌 What is MCP?
Model Context Protocol (MCP) is an open standard that enables AI applications like Claude Desktop to securely communicate with external tools and services.
Think of it like this:
User
│
▼
Claude Desktop
│
▼
MCP Server
│
▼
Your Tools
├── GitHub
├── Kubernetes
├── Slack
├── Filesystem
└── Databases
Instead of AI only answering questions, MCP allows AI to perform real actions through tools.
📂 Project Structure
first-mcp-server/
│
├── src/
│ └── index.ts
│
├── package.json
├── tsconfig.json
└── README.md
🛠 Tech Stack
- TypeScript
- Node.js
- Official MCP SDK
- Zod
- Claude Desktop
🚀 Installation
Clone the repository
git clone <YOUR_REPOSITORY_URL>
Go into the project
cd first-mcp-server
Install dependencies
npm install
Run the server
npm run dev
📦 Dependencies
npm install @modelcontextprotocol/sdk zod
npm install -D typescript tsx @types/node
⚙ Configure Claude Desktop
Linux (Fedora/Ubuntu)
~/.config/Claude/claude_desktop_config.json
Example configuration
{
"mcpServers": {
"first-server": {
"command": "npx",
"args": [
"tsx",
"/home/your-user/first-mcp-server/src/index.ts"
]
}
}
}
Restart Claude Desktop after updating the configuration.
🎯 Available Tool
hello
Input
{
"name": "KD"
}
Output
Hello KD! Welcome to your first MCP Server 🚀
🔄 How it Works
User
│
▼
Claude Desktop
│
│ Reads claude_desktop_config.json
▼
Starts MCP Server
│
▼
Discovers Available Tools
│
▼
User Prompt
│
▼
Claude Chooses Tool
│
▼
Tool Executes
│
▼
Returns Response
│
▼
Claude Responds Naturally
🧠 Behind the Scenes
- Claude Desktop starts the MCP server.
- The server registers available tools.
- Claude discovers those tools automatically.
- When a prompt matches a tool, Claude invokes it.
- The tool executes your TypeScript function.
- The response is returned to Claude.
- Claude formats the response naturally for the user.
📺 30 Days AI DevOps Challenge
This repository is part of a larger learning series.
✅ Phase 1
- What is MCP?
- AI Agents
- MCP + Kubernetes
- AI + GitHub
- Future of DevOps
🚀 Phase 2
- Build First MCP Server ✅
- Claude Desktop Integration
- Filesystem MCP
- GitHub MCP
- Kubernetes MCP
- Slack MCP
- AI DevOps Assistant
🔥 Phase 3
Build a Production-Ready AI DevOps Assistant
- Kubernetes Troubleshooting
- GitHub PR Reviews
- Incident Analysis
- Log Analysis
- Deployment Assistant
📖 Learning Resources
- Official MCP Documentation
- Claude Desktop
- TypeScript Documentation
⭐ Connect With Me
If this project helped you learn MCP, consider giving it a ⭐ on GitHub.
Follow my 30 Days AI DevOps series where I'm building an AI DevOps Assistant from scratch while explaining every concept in simple Hinglish.
📄 License
MIT License
Feel free to fork, learn and contribute.