simple_mcp_server
@natapone
Test Simple MCP server
Overview
What is simple_mcp_server?
simple_mcp_server is a simple custom component for Langflow that provides datetime-related tools with timezone support. It allows users to get the current date, time, and week number in any IANA timezone.
How to use simple_mcp_server?
Copy the contents of langflow_component.py, open Langflow, click "+ Custom Component", paste the code into the editor, and click "Check & Save". Then instantiate DateTimeTools() and call get_current_datetime(timezone) or get_week_number(timezone) with a valid timezone identifier.
Key features of simple_mcp_server
- Get current date and time with timezone support
- Get current week number with timezone support
- Simple error handling for invalid timezones
- Supports all IANA Time Zone Database timezones
- Minimal dependencies (pytz and built-in datetime)
Use cases of simple_mcp_server
- Retrieve the current date and time in a specific timezone, e.g., "America/New_York"
- Obtain the current week number for a given timezone for reporting or scheduling
FAQ from simple_mcp_server
What timezones are supported?
All timezones available in the IANA Time Zone Database are supported, including UTC, America/New_York, Europe/London, and many others.
What dependencies are required?
The component requires the Python packages pytz and datetime (built-in). Ensure they are installed in your Langflow environment.
How does the component handle invalid timezones?
Invalid timezones will return an error message; for the week number function, it will return -1 on error.