TI

Time .NET NuGet RFC3339 UTC MCP Server

Retrieve current UTC time in RFC 3339 format from the .NET/NuGet MCP server for reliable timestamps and easy integration.

Quick Install
npx -y @domdomegg/time-mcp-nuget

Overview

This MCP (Model Context Protocol) server provides a simple, reliable way to retrieve the current UTC time in RFC 3339 format (a profile of ISO 8601) from a lightweight .NET service. It is designed for easy integration with AI tooling and other services that follow the MCP pattern of exposing small, well-defined tools that models or clients can call to obtain external context or perform deterministic actions.

Using a dedicated time tool removes ambiguity about timezone, formatting, and clock synchronization in cross-service workflows. The server returns a single canonical timestamp string (e.g., “2026-04-10T12:34:56Z”) and exposes minimal metadata so it can be included as an MCP tool in model orchestration layers or consumed directly over HTTP.

Features

  • Returns current UTC time in RFC 3339 format (UTC/Z suffix).
  • Minimal, deterministic response suitable for logging, auditing, and model context.
  • Lightweight .NET implementation (source on GitHub).
  • Easy to run locally or deploy as a service.
  • Simple HTTP API and MCP-compatible tool metadata to integrate with model orchestration.
  • Example client snippets for curl, JavaScript, and .NET HttpClient.

Installation / Configuration

There are two common ways to use the server: run from source, or include the provided NuGet package in a .NET project. Replace package names or project paths with those used in your environment if different.

Clone and run from source:

git clone https://github.com/domdomegg/time-mcp-nuget.git
cd time-mcp-nuget
# Run the server (example: assuming an ASP.NET minimal API project)
dotnet run --project src/Time.Mcp.Server --urls http://localhost:8080

Add the NuGet package to a .NET project (example package id shown — check repo or NuGet for exact package id):

dotnet add package Time.MCP
dotnet restore

Run the packaged server as an executable (if the project produces one):

dotnet run --urls http://0.0.0.0:8080
# or if packaged as a global tool (if published that way)
dotnet tool install -g time-mcp
time-mcp --port 8080

Configuration (common environment variables / args)

  • PORT or –urls: listening port and addresses (e.g., http://localhost:8080)
  • LOG_LEVEL: optional log level (Information, Debug, etc.)
  • BIND_ADDRESS: optional bind address for containerized deployments

Available Resources

The server exposes a small set of HTTP endpoints and MCP metadata useful to orchestrators:

PathMethodDescription
/timeGETReturns current UTC time as RFC 3339 string in JSON
/.well-known/mcp or /mcp/metadataGETMCP-compatible metadata describing the tool (name, description, input/output schema)
/healthGETHealth check endpoint (200 OK when ready)

Example /time response:

GET /time HTTP/1.1
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json

{
  "time": "2026-04-10T12:34:56Z"
}

Example MCP metadata (simplified):

{
  "name": "time",
  "description": "Returns the current UTC time in RFC 3339 format.",
  "schema": {
    "input": null,
    "output": { "time": "string (RFC3339, UTC)" }
  }
}

Use Cases

  • Logging and audit trails: obtain a canonical RFC 3339 UTC timestamp for each event before it is stored or transmitted.
  • Model toolchains: include the time tool as an MCP resource that LLMs can call when they need a trustworthy current timestamp for reasoning, responses, or external actions.
  • Test reproducibility: retrieve a controlled timestamp during integration tests to assert expected temporal behavior.
  • Distributed systems: use a single time service to standardize formatting and reduce discrepancies between services in different time zones.
  • Short-lived signed artifacts: include a precise UTC timestamp when generating signatures or one-time tokens.

Concrete examples

Curl (simple consumer):

curl -s http://localhost:8080/time | jq -r .time
# -> 2026-04-10T12:34:56Z

JavaScript (fetch):

const res = await fetch('http://localhost:8080/time');
const json = await res.json();
console.log(json.time); // RFC3339 UTC string

C# HttpClient:

using var http = new HttpClient();
var resp = await http.GetFromJsonAsync<Dictionary<string,string>>("http://localhost