Local Utilities MCP Server

Local Utilities MCP Server

Provides essential utility tools for text processing, file operations, hashing, temperature conversion, password generation, and date/time operations through a comprehensive MCP interface.

Category
访问服务器

README

🛠️ Local Utilities MCP Server

A comprehensive Model Context Protocol (MCP) server built with FastMCP that provides essential utility tools for text processing, file operations, system tasks, and more.

Python 3.8+ FastMCP License: MIT

🌟 Features

🌡️ Temperature Conversion

  • Convert between Celsius and Fahrenheit
  • High precision calculations with 2 decimal places

📁 File Operations

  • Read text files with full content display
  • Write content to files with automatic directory creation
  • List directory contents with file sizes and icons

🔐 Security & Hashing

  • Calculate MD5, SHA1, SHA256 hashes
  • Hash text strings or entire file contents
  • Base64 encoding and decoding

📊 Text Analysis

  • Count words, characters, and lines
  • Calculate detailed text statistics
  • Average words per line and characters per word

🕒 Date & Time

  • Get current date and time information
  • Custom formatting with Python strftime
  • Detailed breakdown (year, month, day, weekday, etc.)

🔑 Password Generation

  • Generate secure passwords with customizable options
  • Control length and character sets
  • Include/exclude uppercase, lowercase, numbers, symbols

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • Compatible MCP client (LM Studio, Claude Desktop, etc.)

Installation

  1. Clone the repository:

    git clone https://github.com/aiforhumans/local-utils-mcp.git
    cd local-utils-mcp
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    
    # Windows
    .venv\Scripts\activate
    
    # macOS/Linux
    source .venv/bin/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    

Running the Server

Start the MCP server:

python server.py

The server runs on stdio transport by default, which is compatible with most MCP clients.

🔧 Configuration

LM Studio Integration

Add this configuration to your LM Studio mcp.json file:

{
  "mcpServers": {
    "local-utils": {
      "command": "python",
      "args": ["path/to/your/server.py"],
      "env": {}
    }
  }
}

Claude Desktop Integration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "local-utils": {
      "command": "python",
      "args": ["path/to/your/server.py"]
    }
  }
}

📖 API Reference

Available Tools

convert_temp(value: float, unit: str)

Convert temperature between Celsius and Fahrenheit.

Parameters:

  • value: Temperature value to convert
  • unit: "C" for Celsius to Fahrenheit, "F" for Fahrenheit to Celsius

Example:

convert_temp(25, "C") → "77.00 °F"
convert_temp(77, "F") → "25.00 °C"

read_file(file_path: str)

Read and return the contents of a text file.

Parameters:

  • file_path: Absolute or relative path to the file

Returns: File contents with path information

write_file(file_path: str, content: str)

Write content to a text file with automatic directory creation.

Parameters:

  • file_path: Path where to write the file
  • content: Text content to write

list_directory(directory_path: str = ".")

List contents of a directory with file sizes.

Parameters:

  • directory_path: Path to directory (defaults to current directory)

Returns: Formatted list with file/folder icons and sizes

calculate_hash(text_or_path: str, hash_type: str = "sha256", is_file: bool = False)

Calculate cryptographic hash of text or file content.

Parameters:

  • text_or_path: Text string or file path to hash
  • hash_type: "md5", "sha1", or "sha256" (default)
  • is_file: Set to true when hashing a file

base64_encode_decode(text: str, operation: str = "encode")

Encode or decode text using Base64.

Parameters:

  • text: Text to encode/decode
  • operation: "encode" or "decode"

get_datetime_info(format_string: str = "%Y-%m-%d %H:%M:%S")

Get comprehensive current date and time information.

Parameters:

  • format_string: Python strftime format string for custom formatting

text_stats(text: str)

Calculate detailed statistics for the given text.

Parameters:

  • text: Text to analyze

Returns: Lines, words, characters, and averages

generate_password(length: int = 12, include_uppercase: bool = True, include_lowercase: bool = True, include_numbers: bool = True, include_symbols: bool = False)

Generate a secure random password.

Parameters:

  • length: Password length (default: 12)
  • include_uppercase: Include A-Z (default: true)
  • include_lowercase: Include a-z (default: true)
  • include_numbers: Include 0-9 (default: true)
  • include_symbols: Include special characters (default: false)

🧪 Testing

Run the test suite to verify functionality:

python test.py

This will test all core functions and verify the server can be imported correctly.

🔨 Development

Adding New Tools

To extend the server with additional tools:

  1. Create a new function with the @mcp.tool() decorator:
@mcp.tool(
    description="Your tool description here"
)
async def your_new_tool(param1: str, param2: int = 10) -> str:
    """
    Your tool implementation.
    
    Args:
        param1: Description of parameter 1
        param2: Description of parameter 2 with default value
    
    Returns:
        String result of the tool operation
    """
    try:
        # Your tool logic here
        result = f"Processed {param1} with value {param2}"
        return result
    except Exception as e:
        return f"Error: {str(e)}"
  1. Add proper error handling and meaningful return messages
  2. Update the README with documentation for your new tool
  3. Test your tool to ensure it works correctly

Project Structure

local-utils-mcp/
├── server.py              # Main MCP server
├── requirements.txt       # Python dependencies  
├── README.md             # This file
├── .gitignore           # Git ignore rules
├── test.py              # Test suite
└── .venv/               # Virtual environment (not in git)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📋 Requirements

  • Python 3.8+
  • FastMCP 2.9.0+
  • MCP 1.9.4+

See requirements.txt for complete dependency list.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Related Projects

⭐ Support

If you find this project helpful, please consider giving it a star on GitHub!


Made with ❤️ for the MCP community

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选