Skip to main content

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_time tool 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


Download files

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

Source Distribution

mcp_cuc_pbw-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_cuc_pbw-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_cuc_pbw-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11

File hashes

Hashes for mcp_cuc_pbw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59b47fa69960bfb9df80f03e6c3a2e0ade9c194285e273ba8673ef59600dc75c
MD5 66960eb49f6c17bcfc907f5237e1aac9
BLAKE2b-256 8932b6e8e47d7427e04b63a696ab13ff578bd952c78a2b3f6523530bbfe6e96c

See more details on using hashes here.

File details

Details for the file mcp_cuc_pbw-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_cuc_pbw-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11

File hashes

Hashes for mcp_cuc_pbw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55aa717954d79593bbb1692f7252bf7f7e83a51e5b633f3de05f1c8461d08118
MD5 afda42597f7e9caf3bde8bb1de4a6d12
BLAKE2b-256 a58c0a817e5ec5c3087121e5ce90210255ebf8cfcfe0229c3f06eae9dee5665d

See more details on using hashes here.

Supported by

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