A simple MCP (Model Context Protocol) Server implementation
Project description
mcp_cuc_pbw
A simple MCP (Model Context Protocol) Server implementation in Python that provides a tool to get the current time with optional timezone support.
Version Compatibility
Requires Python 3.10 or higher.
Features
- Provides a
get_current_timetool to retrieve the current time - Supports optional timezone parameter
- Simple and lightweight implementation
- Clear documentation and examples
Requirements
- Python 3.10 or higher
- pytz (automatically installed)
Installation
From PyPI
pip install mcp_cuc_pbw
From Source
pip install -e .
Usage
Start the Server
mcp-server
By default, the server runs on http://localhost:8000.
You can specify a different host and port:
mcp-server --host 0.0.0.0 --port 8080
Using as a Module
from mcp_cuc_pbw import run_server
# Run the server on default host and port
run_server()
# Or specify host and port
run_server(host='0.0.0.0', port=8080)
Available Tools
get_current_time
Gets the current time with optional timezone support.
Parameters:
timezone(optional): Timezone string (e.g.,Asia/Shanghai,UTC,America/New_York)
Example Request:
{
"tool": "get_current_time",
"params": {
"timezone": "Asia/Shanghai"
}
}
Example Response:
{
"tool": "get_current_time",
"result": {
"current_time": "2024-01-16 14:30:45",
"timezone": "Asia/Shanghai"
}
}
Without Timezone:
{
"tool": "get_current_time"
}
Response:
{
"tool": "get_current_time",
"result": {
"current_time": "2024-01-16 14:30:45",
"timezone": "local"
}
}
MCP Protocol Reference
For more information about the Model Context Protocol:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_cuc_pbw-0.1.2.tar.gz.
File metadata
- Download URL: mcp_cuc_pbw-0.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
676d2f650243253f67054efcec4df5031c86d6f6875a61e9b2bc3819e5510564
|
|
| MD5 |
dd64a099a0124d44fe20193eab400812
|
|
| BLAKE2b-256 |
2c3a2447bbe9d450fb3e263040d098df1fcde41410b05642552bff668f792c23
|
File details
Details for the file mcp_cuc_pbw-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mcp_cuc_pbw-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c9e48965f5c31b2bcacc986f0dfc4e68942f4cc15cf0391dd7be986ab7047ec
|
|
| MD5 |
affefa8f8a68df00447116290b9307ca
|
|
| BLAKE2b-256 |
152d07ce57201d6c366cc1ee50a10783cfbe41ea7529dcb6ab7ca4a0acf5fb85
|