0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

はじめて作った思い出のMCPサーバ

Last updated at Posted at 2025-12-02

はじめて作ったMCPサーバ。
Cuesorが時間を認識できるようになった。

time_mcp.ts
import { FastMCP } from "fastmcp";
import { z } from "zod";

const server = new FastMCP({
  name: "Time MCP Server",
  version: "1.0.0",
});

server.addTool({
  name: "now-tool",
  description: "現在時刻(ISO8601形式)を返します。",
  parameters: z.object({}),
  execute: async () => {
    return new Date().toISOString();
  },
});

// server.addResource({
//   name: "now-resource",
//   uri: "resources://now",
//   mimeType: "application/json",
//   description: "現在時刻(ISO8601形式)を返します。",
//   load: async () => {
//     return {
//       text: new Date().toISOString(),
//     };
//   },
// });

server.start({
  transportType: "stdio",
});
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?