Skip to main content

Aliyun MCP Tools Xiaolin

Basic MCP tools package for Aliyun, without system control or Bafayun functionality.

Features

  • calculator: Math calculation tool
  • get_current_time: Get current system time
  • process_text: Text processing tool with various operations

Installation

pip install aliyun-mcp-tools-xiaolin-20260130

Usage

Basic Usage

from aliyun_mcp_tools import calculator, get_current_time, process_text

# Calculate math expression
result = calculator("2 + 2 * 3")
print(result)  # Output: {"success": true, "result": 8}

# Get current time
current_time = get_current_time()
print(current_time)  # Output: {"success": true, "time": "2026-01-30 12:00:00"}

# Process text
text_result = process_text("hello world", "uppercase")
print(text_result)  # Output: {"success": true, "result": "HELLO WORLD"}

Aliyun MCP Integration

from mcp.server.mcpserver import MCPServer
from aliyun_mcp_tools import calculator, get_current_time, process_text

# Create MCP server
mcp = MCPServer("Aliyun Tools Server")

# Register tools
@mcp.tool()
def calculate(expression: str) -> dict:
    """Calculate math expression"""
    return calculator(expression)

@mcp.tool()
def get_time() -> dict:
    """Get current time"""
    return get_current_time()

@mcp.tool()
def text_process(text: str, operation: str) -> dict:
    """Process text with specified operation"""
    return process_text(text, operation)

# Run server
mcp.run(transport="stdio")

Tools

calculator

Calculates Python math expressions.

Parameters:

  • python_expression: Python expression to evaluate

Returns:

  • {"success": true, "result": <calculated value>} on success
  • {"success": false, "error": <error message>} on failure

get_current_time

Gets the current system time.

Returns:

  • {"success": true, "time": "YYYY-MM-DD HH:MM:SS"} on success
  • {"success": false, "error": <error message>} on failure

process_text

Processes text with various operations.

Parameters:

  • text: Text to process
  • operation: Operation type ("uppercase", "lowercase", "capitalize", "count_words")

Returns:

  • {"success": true, "result": <processed text or word count>} on success
  • {"success": false, "error": <error message>} on failure

Development

Build the package

python -m build

Upload to PyPI

python -m twine upload dist/*

License

MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aliyun_mcp_tools_xiaolin_20260130-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file aliyun_mcp_tools_xiaolin_20260130-0.1.0.tar.gz.

File metadata

File hashes

Hashes for aliyun_mcp_tools_xiaolin_20260130-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d5960bfa1d6a113dcd34add3a9f30c0effe7e2047d2ec6f253dece293d416e15
MD5 a8b8586f5f28dd86dbe29038e4d1b66a
BLAKE2b-256 11c9425e8309505cc67bb99ab8cf9698431eb0d761fa486cd0bf3dee7e043a7a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page