mcpField
G
GoCopilotAgentToDoList

GoCopilotAgentToDoList

Local
github.com/iancarpenterDeveloper Tools0Updated 74w ago

About GoCopilotAgentToDoList

GoCopilotAgentToDoList is a Go HTTP server that retrieves the current time for a specified timezone through an MCP service running in Docker. It demonstrates a JSON API integration and includes basic unit tests.

Key features

  1. 01Get a timezone-specific time through /mcp/time
  2. 02Run the MCP service using Docker
  3. 03Exchange requests and responses as JSON
  4. 04Include marshaling unit tests

Use cases

  1. 01Provide an application with the current time in a specified timezone
  2. 02Demonstrate a Go HTTP server calling a Dockerized MCP service
  3. 03Test JSON request and response marshaling

MCP support

The Go server forwards requests to an MCP service in a Docker container, invokes the mcp/time command, and returns its result as JSON.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

GoCopilotAgentToDoList

Overview

GoCopilotAgentToDoList is a Go-based HTTP server that provides an API endpoint for retrieving the current time in a specified timezone. The server interacts with a Dockerized Model Context Protocol (MCP) service to fetch the time, making it a practical example of integrating Go, Docker, and external services.

Features

  • /mcp/time API endpoint: Accepts a POST request with a timezone and returns the current time for that timezone.
  • Docker integration: Uses Docker to run the MCP service for time retrieval.
  • JSON-based communication: Both requests and responses use JSON.
  • Unit tests: Includes basic unit tests for request and response marshaling.

Prerequisites

  • Go 1.18 or later
  • Docker installed and running
  • MCP Docker image (mcp:latest) available locally
  • Windows OS (but code is cross-platform)

Project Structure

go.mod                  # Go module definition
package main.go         # Main application source code
package_main_test.go    # Unit tests for the project
todos.json              # (Reserved for future to-do list features)

Usage

1. Build and Run the Server

Open a terminal in the project directory and run:

go run package\ main.go

The server will start and listen on http://localhost:8080.

2. API Endpoint
POST /mcp/time
  • Request Body:
    {
      "timezone": "America/New_York"
    }
    
  • Response Body:
    {
      "time": "2025-05-27T12:34:56Z"
    }
    
  • Example with curl:
    curl -X POST http://localhost:8080/mcp/time -H "Content-Type: application/json" -d '{"timezone":"America/New_York"}'
    
3. How It Works
  • The server receives a POST request at /mcp/time with a JSON body specifying the timezone.
  • It marshals the request and pipes it to a Docker container running the MCP service (mcp:latest), specifically the mcp/time command.
  • The output from the container is parsed and returned as a JSON response.

Running Tests

To run the unit tests, execute:

go test -v

Extending the Project

  • To-Do List Feature: The presence of todos.json suggests future plans for a to-do list API.
  • Additional Endpoints: You can add more endpoints by defining new handlers in package main.go.
  • Error Handling: Improve error messages and logging for production use.

Troubleshooting

  • Ensure Docker is running and the mcp:latest image is available locally.
  • If you encounter permission issues with Docker, run your terminal as administrator.
  • The server listens on port 8080 by default. Change this in package main.go if needed.

License

This project is provided as-is for educational and demonstration purposes.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.