mcp-server

SakithNizar/mcp-server

3.1

If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Model Context Protocol (MCP) is a web application designed to facilitate interactions with your CV and send emails through a simple interface.

MCP Server & Frontend

Model Context Protocol (MCP) is a small web application that allows you to:

  • Chat about your CV – ask questions like β€œWhat was my last position?” and get AI-generated answers.
  • Send emails – simple email endpoint using SMTP.
  • Optional frontend – minimal Next.js interface to interact with the backend.

Project Structure

mcp-server/
β”œβ”€ backend/
β”‚  β”œβ”€ index.js          # Backend server (Express + OpenAI + Nodemailer)
β”‚  β”œβ”€ resume.json       # Sample CV
β”‚  └─ .env              # Environment variables
└─ frontend/
   β”œβ”€ pages/
   β”‚  └─ index.js      # Next.js frontend
   └─ package.json      # Frontend dependencies & scripts

Features

1️⃣ Chat about CV

Endpoint: POST /chat

Request body:

{
  "message": "What was my last position?"
}

Response:

{
  "reply": "Your last position was Software Engineer at Tech Corp"
}

Uses OpenAI GPT-3.5-Turbo to generate responses. Includes fallback mock response if the OpenAI API fails or quota is exceeded.


2️⃣ Send Email

Endpoint: POST /send-email

Request body:

{
  "to": "someone@example.com",
  "subject": "Hello",
  "body": "Test email from MCP server"
}

Response:

{
  "status": "Email sent!"
}

Uses Nodemailer with your SMTP configuration.


3️⃣ Frontend (Optional)

  • Minimal Next.js UI at http://localhost:3000

  • Features:

    • Textarea to chat with MCP backend
    • Button to send test email

Setup Instructions

1️⃣ Clone the repository

git clone <your-repo-url>
cd mcp-server

2️⃣ Backend Setup

cd backend
npm install express body-parser nodemailer openai dotenv

Create a .env file:

OPENAI_API_KEY=your_openai_api_key
SMTP_HOST=smtp.example.com
SMTP_USER=your_email@example.com
SMTP_PASS=your_email_password

Start backend:

node index.js

Backend URL: http://localhost:5000


3️⃣ Frontend Setup

cd ../frontend
npx create-next-app@latest .  # only if not already set up
npm install
  • Replace pages/index.js with frontend code.
  • Update backendUrl to http://localhost:5000 in the frontend code.

Start frontend:

npm run dev

Frontend URL: http://localhost:3000


4️⃣ Testing Endpoints

Chat API
curl -X POST http://localhost:5000/chat \
-H "Content-Type: application/json" \
-d '{"message":"What was my last position?"}'
Send Email API
curl -X POST http://localhost:5000/send-email \
-H "Content-Type: application/json" \
-d '{"to":"someone@example.com","subject":"Test Email","body":"Hello from MCP server!"}'

Notes

  • Backend must run on port 5000 to avoid conflicts with Next.js frontend (port 3000).
  • If OpenAI API fails or exceeds quota, the /chat endpoint returns a mock answer.
  • Ensure your SMTP settings are correct for email functionality.

Dependencies

  • Backend: express, body-parser, nodemailer, openai, dotenv
  • Frontend: next, react, react-dom

License

MIT License