Basic MCP tools package for Aliyun, without system control or Bafayun functionality
Project description
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 processoperation: 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file aliyun_mcp_tools_xiaolin_20260130-0.1.0.tar.gz.
File metadata
- Download URL: aliyun_mcp_tools_xiaolin_20260130-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5960bfa1d6a113dcd34add3a9f30c0effe7e2047d2ec6f253dece293d416e15
|
|
| MD5 |
a8b8586f5f28dd86dbe29038e4d1b66a
|
|
| BLAKE2b-256 |
11c9425e8309505cc67bb99ab8cf9698431eb0d761fa486cd0bf3dee7e043a7a
|