mcp-thisweek

June 3, 2025 ยท View on GitHub

A simple MCP (Model Context Protocol) server that provides the dates for the current week (Monday to Friday) and today's date.

Features

  • get_this_week_dates: Returns a list of dates from Monday to Friday of the current week.
  • get_today_date: Returns today's date.

Examples

  • "What are the dates for this week from Monday to Friday?"
  • "What is today's date?"

Setup

You can set up and run mcp-thisweek using pip and Python, or using Docker.

Using pip and Python

  1. Clone the repository:

    git clone https://github.com/taku-o/mcp-thisweek.git
    cd mcp-thisweek
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure your MCP client: Add mcp-thisweek to your MCP client's configuration file (e.g., mcp.json or claude_desktop_config.json).

    Replace /path/to/mcp-thisweek/server.py with the actual path to the server.py script in the mcp-thisweek directory. You may also need to replace python with the full path to your Python 3.10+ interpreter if it's not in your system's PATH.

    {
      "mcpServers": {
        "mcp-thisweek": {
          "command": "python",
          "args": [
            "/path/to/mcp-thisweek/server.py"
          ]
        }
      }
    }
    

Using Docker

Navigate to the root directory of the project (where the Dockerfile and docker-compose.yml are located) and run:

docker-compose up -d --build

This will build the image if it doesn't exist and start the container in detached mode.

To stop and remove the container, run:

docker-compose down
  1. Configure your MCP client (for Docker): When using Docker, fastmcp needs to communicate with the server running inside the container. FastMCP typically uses local command execution. To make this work with Docker, you might need a wrapper script or adjust how fastmcp invokes the server if it needs to docker exec into the container or if fastmcp itself is run inside a Docker network.

    A common way fastmcp is used is by specifying a command that fastmcp can run. If fastmcp is running on the host, it cannot directly execute a Python script inside a Docker container without docker exec.

    For a Dockerized mcp-server, the command in mcp.json would typically be docker exec -i mcp-thisweek-container python /app/server.py. This assumes fastmcp is running on the host and the container is named mcp-thisweek-container.

    The JSON configuration for Docker would look like:

    {
      "mcpServers": {
        "mcp-thisweek": {
          "command": "docker",
          "args": [
            "exec",
            "-i",
            "mcp-thisweek-container",
            "python",
            "/app/server.py"
          ]
        }
      }
    }
    

    Ensure the container mcp-thisweek-container is running.

License

This project is licensed under the MIT License.