mcp-utility-server
A Python-based MCP server providing essential utility tools: web fetching, current time, and calculator functionality.
README
MCP Utility Server
A Python-based MCP (Model Context Protocol) server providing essential utility tools: web fetching, current time, and calculator functionality.
🚀 Overview
mcp-utility-server is a lightweight, production-ready MCP server that exposes three powerful utility tools for AI assistants and LLM applications:
web_fetch— Fetch and extract content from web pagescurrent_time— Get the current time in any timezonecalculator— Perform mathematical calculations with precision
Designed for seamless integration with MCP-compatible clients like Claude Desktop, VS Code Copilot, and custom LLM workflows.
📦 Installation
Via pip (Recommended for Python projects)
pip install mcp-utility-server
Via npm (For Node.js/TypeScript ecosystems)
npm install mcp-utility-server
From source
git clone https://github.com/yourusername/mcp-utility-server.git
cd mcp-utility-server
pip install -e .
Note: The npm package is a wrapper that bundles the Python server. Ensure Python 3.9+ is available on your system.
🧪 Quick Start
1. Configure your MCP client
Add this configuration to your MCP client (e.g., ~/.config/claude/claude_desktop_config.json for Claude Desktop):
{
"mcpServers": {
"utility": {
"command": "mcp-utility-server",
"args": []
}
}
}
Or if installed globally via npm:
{
"mcpServers": {
"utility": {
"command": "npx",
"args": ["mcp-utility-server"]
}
}
}
2. Start using the tools
Once connected, your AI assistant can call these tools naturally:
"What's the current time in Tokyo?"
→ Calls current_time(timezone="Asia/Tokyo")
"Calculate 15% of €2,500"
→ Calls calculator(expression="2500 * 0.15")
"Fetch the content from https://example.com"
→ Calls web_fetch(url="https://example.com")
🛠️ API Reference
Tool: web_fetch
Fetches the text content from a given URL.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url |
string | ✅ Yes | — | The URL to fetch (must include scheme, e.g., https://). |
Returns:
string — The page title followed by the extracted text content (cleaned HTML-free text).
Example:
{
"input": {
"url": "https://en.wikipedia.org/wiki/Python"
},
"output": "Python (programming language)\n\nPython is a high-level, general-purpose programming language..."
}
Errors: Returns an error message for invalid URLs, network issues, or non-200 responses.
Tool: current_time
Returns the current date and time for a specified timezone.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
timezone |
string | ❌ No | "UTC" |
A valid IANA timezone name (e.g., "America/New_York", "Asia/Kolkata"). |
Returns:
string — Formatted as YYYY-MM-DD HH:MM:SS TZ (e.g., 2025-03-15 14:30:00 EST).
Example:
{
"input": {
"timezone": "Europe/London"
},
"output": "2025-03-15 19:30:00 GMT"
}
Errors: Returns an error for invalid timezone names (use pytz.all_timezones for a complete list).
Tool: calculator
Evaluates a mathematical expression with full operator support.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
expression |
string | ✅ Yes | — | A mathematical expression (e.g., "2 + 2 * 5"). |
Supported operations:
+, -, *, /, ** (power), % (modulo), parentheses, pi, e, sqrt(), sin(), cos(), tan(), log(), abs(), etc. (backed by math module).
Returns:
number — The evaluated result (float or int).
Example:
{
"input": {
"expression": "sin(pi/4) + log(100, 10)"
},
"output": 2.7071067811865475
}
Errors: Returns a clear error message for syntax errors, division by zero, or unsafe expressions (only mathematical operations allowed; no __import__, exec, or system calls).
🧰 Use Cases
- Claude Desktop — Give Claude web browsing, time awareness, and calculation capabilities
- VS Code Copilot — Enhance code suggestions with real-time data and computations
- Custom LLM Agents — Add utility tools to any MCP-compatible AI pipeline
- Testing & Automation — Use as a reliable, stateless utility service
🧑💻 Development
Requirements
- Python 3.9+
mcppackagehttpx(for HTTP requests)pytz(for timezone handling)
Setup
# Clone the repository
git clone https://github.com/yourusername/mcp-utility-server.git
cd mcp-utility-server
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run tests
pytest tests/
Project Structure
mcp-utility-server/
├── src/
│ └── mcp_utility_server/
│ ├── __init__.py # Package entry point
│ ├── server.py # MCP server with tool definitions
│ └── tools/ # Tool implementations
│ ├── web_fetch.py
│ ├── current_time.py
│ └── calculator.py
├── tests/
│ └── test_tools.py
├── pyproject.toml # Build configuration
├── package.json # npm wrapper
└── README.md # You are here
🧪 Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=src/mcp_utility_server tests/
🤝 Contributing
Contributions are welcome! Please follow these steps:
- 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
Please ensure tests pass and coverage remains high.
📄 License
Distributed under the MIT License. See LICENSE for more information.
🙏 Acknowledgements
- Built on the MCP Python SDK
- Powered by httpx, pytz, and Python's
mathmodule
Made with ❤️ for the AI developer 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 模型以安全和受控的方式获取实时的网络信息。