MCP Greeting Server
Provides time-aware greetings in multiple languages and timezones, with personalization support.
README
🌍 MCP Greeting Server
A Model Context Protocol (MCP) server that provides intelligent, time-aware greetings in multiple languages and timezones.
✨ Features
- 🕐 Time-aware greetings - Automatically says good morning, afternoon, or evening based on current time
- 🌍 Multi-language support - English, Portuguese, Spanish, and French
- 🌎 Timezone flexibility - Works with any timezone (defaults to Brazil/São Paulo)
- 👤 Personalization - Optional name parameter for personalized greetings
- 🎯 MCP Compatible - Ready to use with Claude and other MCP clients
🚀 Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
Installation
# Clone the repository
git clone https://github.com/gustavorobertux/mcp-greeting-server.git
cd mcp-greeting-server
# Install dependencies
npm install
# Start the server
npm start
🔧 Claude Configuration
Method 1: Claude Desktop App
-
Install Claude Desktop from Claude.ai
-
Locate the configuration file:
# Windows %APPDATA%\Claude\claude_desktop_config.json # macOS ~/Library/Application Support/Claude/claude_desktop_config.json # Linux ~/.config/Claude/claude_desktop_config.json -
Add the MCP server configuration:
{ "mcpServers": { "greeting": { "command": "node", "args": ["/full/path/to/mcp-greeting-server/index.js"] } } } -
Restart Claude Desktop and you'll see the greeting tool available!
Method 2: Claude Web/API with MCP Client
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
// Connect to the greeting server
const transport = new StdioClientTransport({
command: "node",
args: ["/path/to/mcp-greeting-server/index.js"]
});
const client = new Client({
name: "greeting-client",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);
// Use the greeting tool
const result = await client.request({
method: "tools/call",
params: {
name: "greet",
arguments: {
name: "Alice",
language: "en"
}
}
});
console.log(result.content[0].text);
Method 3: NPX (Quick Test)
# Run directly with npx (after publishing to npm)
npx mcp-greeting-server
# Or clone and run locally
git clone https://github.com/gustavorobertux/mcp-greeting-server.git
cd mcp-greeting-server
npm install
npm start
Troubleshooting
Issue: Claude Desktop doesn't show the greeting tool
- ✅ Check file path is absolute
- ✅ Verify Node.js is in PATH
- ✅ Restart Claude Desktop completely
- ✅ Check Claude Desktop logs for errors
Issue: Permission denied
# Make the script executable (Linux/macOS)
chmod +x index.js
# Or run with node explicitly
"command": "node"
Issue: Module not found
# Install dependencies in the project folder
cd /path/to/mcp-greeting-server
npm install
MCP Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"greeting": {
"command": "node",
"args": ["/absolute/path/to/mcp-greeting-server/index.js"]
}
}
}
🧪 Testing with Claude
Once configured, you can test in Claude:
Hey Claude, can you greet me?
Claude will use the greet tool and respond with a time-appropriate greeting!
Hey Claude, greet me in Portuguese with my name "João"
Claude will call: greet({ name: "João", language: "pt" })
📖 Usage
With Claude
Once configured with Claude, simply ask for greetings naturally:
User: "Hey Claude, can you greet me?"
Claude: Uses greet() → "🌅 Good morning! friend! 🤝 It's 09:30 now. Hope you're having a great time!"
User: "Greet me in Portuguese as João"
Claude: Uses greet({name: "João", language: "pt"}) → "☀️ Boa tarde! João! 🤝 São 14:30 agora. Espero que esteja tendo um ótimo momento!"
Direct API Usage
Basic Greeting
// Simple greeting (uses defaults: English, current timezone)
greet()
// Output: "🌅 Good morning! friend! 🤝\n\nIt's 09:30 now. Hope you're having a great time!"
Personalized Greeting
// With name
greet({ name: "Alice" })
// Output: "☀️ Good afternoon! Alice! 🤝\n\nIt's 14:30 now. Hope you're having a great time!"
Multi-language Support
// Portuguese
greet({ name: "João", language: "pt" })
// Output: "🌅 Bom dia! João! 🤝\n\nSão 09:30 agora. Espero que esteja tendo um ótimo momento!"
// Spanish
greet({ name: "María", language: "es" })
// Output: "🌙 ¡Buenas noches! María! 🤝\n\nSon las 21:30 ahora. ¡Espero que estés teniendo un gran momento!"
// French
greet({ name: "Pierre", language: "fr" })
// Output: "☀️ Bon après-midi! Pierre! 🤝\n\nIl est 15:30 maintenant. J'espère que vous passez un bon moment!"
Different Timezones
// New York time
greet({ timezone: "America/New_York" })
// London time
greet({ timezone: "Europe/London" })
// Tokyo time
greet({ timezone: "Asia/Tokyo" })
⚙️ API Reference
Tool: greet
Description: Returns an appropriate greeting based on the current time
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | No | - | Person's name for personalization |
timezone |
string | No | America/Sao_Paulo |
Timezone for the greeting |
language |
string | No | en |
Language code (en, pt, es, fr) |
Example Response:
{
"content": [
{
"type": "text",
"text": "🌅 Good morning! Alice! 🤝\n\nIt's 09:30 now. Hope you're having a great time!"
}
]
}
🌐 Supported Languages
| Language | Code | Example |
|---|---|---|
| English | en |
"Good morning! friend!" |
| Portuguese | pt |
"Bom dia! amigo!" |
| Spanish | es |
"¡Buenos días! amigo!" |
| French | fr |
"Bonjour! ami!" |
🕐 Time Periods
| Time Range | Greeting Type | Emoji |
|---|---|---|
| 05:00 - 11:59 | Morning | 🌅 |
| 12:00 - 17:59 | Afternoon | ☀️ |
| 18:00 - 04:59 | Evening/Night | 🌙 |
🛠️ Development
Project Structure
mcp-greeting-server/
├── index.js # Main server file
├── package.json # Dependencies and scripts
├── README.md # This file
└── .gitignore # Git ignore rules
Running in Development
# Install dependencies
npm install
# Start the server
node index.js
# Or with npm script
npm start
Testing
# Test the greeting function
npm test
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Adding New Languages
To add support for a new language:
- Add the language to the
greetingsobject inhandleGreetmethod - Include translations for:
morning,afternoon,evening,friend,timeText,hopeText - Update the README.md supported languages table
- Add the language code to the schema enum
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with Model Context Protocol SDK
- Inspired by the need for international, time-aware greetings
- Perfect for Claude integrations and other MCP clients
📞 Support
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: gustavorobertux@gmail.com
Made with ❤️ for the MCP community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。