Skip to main content
Glama
109naoki

minimal-mcp-server

by 109naoki

minimal-mcp-server

MCP(Model Context Protocol)を学ぶための最小構成のサーバー実装です。 Claude Desktop と接続して、チャットからツールを呼び出すことができます。

提供ツール

ツール名

説明

引数

echo

入力されたメッセージをそのまま返す

message (string)

get-current-time

サーバーの現在日時を返す

なし

search-wikipedia

日本語Wikipediaで記事の要約を検索する(外部API連携)

query (string)

Related MCP server: MCP Server TypeScript

セットアップ

必要環境

  • Node.js v18 以上(fetch API を使用するため)

  • npm

インストール

git clone <repository-url>
cd minimal-mcp-server
npm install

ビルド

npm run build

src/index.tsbuild/index.js にコンパイルされます。

動作確認

npm start

stdio で待ち受け状態になれば成功です(Ctrl+C で終了)。

Claude Desktop との接続

1. 設定ファイルを編集

macOS の場合:

~/Library/Application Support/Claude/claude_desktop_config.json

以下を mcpServers に追加します:

{
  "mcpServers": {
    "minimal-mcp-server": {
      "command": "node",
      "args": ["/path/to/minimal-mcp-server/build/index.js"]
    }
  }
}

/path/to/ は実際のパスに置き換えてください。

2. Claude Desktop を再起動

再起動後、チャット入力欄のハンマーアイコンをクリックすると、登録されたツールが一覧に表示されます。

3. ログの確認

MCPサーバーのログは以下に出力されます:

tail -f ~/Library/Logs/Claude/mcp-server-minimal-mcp-server.log

stdio トランスポートでは console.log(stdout)は MCP 通信と干渉するため、ログには必ず console.error(stderr)を使用してください。

使い方(Claude Desktop での質問例)

ツールは自然言語で質問するだけで、Claude が自動的に適切なツールを選んで実行します。

echo

「Hello World」とエコーして

get-current-time

今何時?

search-wikipedia

東京タワーについて教えて
富士山のWikipedia情報を調べて

開発ガイド

プロジェクト構成

minimal-mcp-server/
├── src/
│   └── index.ts          # サーバー本体(ツール定義含む)
├── build/                 # コンパイル出力(git管理外)
├── package.json
└── tsconfig.json

ツールの追加方法

src/index.tsserver.registerTool() を追加します:

server.registerTool(
  "tool-name",             // ツール名(ケバブケース推奨)
  {
    description: "ツールの説明(Claudeがツール選択の判断に使う)",
    inputSchema: {         // 引数定義(Zodスキーマ)省略可
      param1: z.string().describe("引数の説明"),
      param2: z.number().describe("引数の説明"),
    },
  },
  async ({ param1, param2 }) => {
    // ツールの処理
    return {
      content: [
        { type: "text", text: "結果のテキスト" },
      ],
    };
  },
);

ポイント

  • description は重要です。Claude はこの説明文を見てどのツールを使うか判断します。具体的に書くほど正確に呼び出されます

  • inputSchema は Zod で定義し、自動的に JSON Schema に変換されてクライアントに公開されます

  • 引数なしのツールは inputSchema を省略できます

  • 戻り値は content 配列で、type: "text" のオブジェクトを返します

外部 API 連携の例(search-wikipedia)

server.registerTool(
  "search-wikipedia",
  {
    description: "日本語Wikipediaでキーワードを検索し、記事の要約を返すツール",
    inputSchema: {
      query: z.string().describe("検索キーワード(例: 東京タワー)"),
    },
  },
  async ({ query }) => {
    const url = `https://ja.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(query)}`;
    const res = await fetch(url);
    if (!res.ok) {
      return {
        content: [
          { type: "text", text: `「${query}」に該当する記事が見つかりませんでした。` },
        ],
      };
    }
    const data = await res.json();
    return {
      content: [
        {
          type: "text",
          text: `【${data.title}】\n${data.extract}\n\nURL: ${data.content_urls?.desktop?.page ?? "N/A"}`,
        },
      ],
    };
  },
);

技術スタック

技術

用途

MCP SDK (@modelcontextprotocol/sdk)

MCP サーバーフレームワーク

Zod

引数のスキーマ定義・バリデーション

TypeScript

型安全な開発

StdioServerTransport

Claude Desktop との通信(stdin/stdout)

トランスポートについて

このサーバーは stdio トランスポート を使用しています。Claude Desktop はこの方式でMCPサーバーと通信します。

Claude Desktop → stdin → StdioServerTransport → McpServer → ツール実行
                                                                 ↓
Claude Desktop ← stdout ← StdioServerTransport ← McpServer ← 結果返却

Web アプリとして公開する場合は StreamableHTTPServerTransport を使用します(別途実装が必要)。

Available Tools

3 tools
echoA

入力されたメッセージをそのまま返す簡単なツール

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesエコーするメッセージ

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the message is returned 'as-is' (そのまま), indicating an identity function behavior, but lacks disclosure of side effects, idempotency, synchronous/asynchronous nature, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficiently structured sentence that immediately communicates the core functionality. There is no redundant information or unnecessary elaboration for this simple utility tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single string input, identity transformation), 100% schema coverage, and the universal understanding of 'echo' functionality, the description is reasonably complete. While an output schema is absent, the description adequately covers the input-to-output relationship for this trivial operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'message' fully documented in the schema as 'エコーするメッセージ'. The description implies the message will be returned but does not add syntax details, constraints, or examples beyond the schema definition, warranting the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'returns the input message as-is' (入力されたメッセージをそのまま返す), using a specific verb and resource. It clearly distinguishes from siblings get-current-time and search-wikipedia, as echoing messages is functionally distinct from retrieving time or searching encyclopedia entries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While the purpose is obvious from the name and description, there is no explicit guidance on preferred use cases (e.g., testing connectivity, debugging) or when to avoid it in favor of more complex messaging tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-current-timeB

現在の日時を取得するツール

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It fails to specify the return format (ISO string, timestamp, etc.), timezone handling (UTC vs local), or safety characteristics (read-only nature). Only the basic function is stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single efficient sentence with zero waste. It is appropriately front-loaded with the core purpose immediately stated. No redundant or unnecessary text is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (zero parameters) and lack of output schema, the description is minimally viable but incomplete. It omits critical runtime context such as timezone, precision, and return value structure that would be necessary for robust agent operation without trial-and-error.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema contains zero parameters (empty object). According to the evaluation rules, 0 parameters establishes a baseline score of 4. No parameter description is necessary or expected.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action (取得する/get) and resource (現在の日時/current date and time). It effectively distinguishes from siblings 'echo' and 'search-wikipedia' which operate on completely different domains. However, it lacks scope specification (timezone, format) which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While siblings are clearly distinct (echo, search-wikipedia), there is no explicit context about when retrieving current time is appropriate or necessary prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-wikipediaA

日本語Wikipediaでキーワードを検索し、記事の要約を返すツール

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes検索キーワード(例: 東京タワー)

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and successfully discloses that it returns article summaries (not full content) and specifically searches Japanese Wikipedia. However, it lacks details on result limits, pagination, or behavior when no matches are found.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that is perfectly front-loaded with zero waste. It efficiently packs the language (Japanese), action (search), input (keyword), and output (summaries) into a compact description where every element provides value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a simple single-parameter search tool without an output schema, the description adequately covers the essentials by specifying what is searched and what is returned. However, it could improve by clarifying whether multiple results or a single best match is returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with the 'query' parameter fully documented in the schema with an example. The description mentions 'キーワード' (keyword) which aligns with the parameter, but adds no additional syntactic or semantic details beyond the schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the specific action (検索/search), resource (日本語Wikipedia/Japanese Wikipedia), and output (記事の要約/article summaries). It distinctly differs from siblings 'echo' and 'get-current-time' by specifying Wikipedia search functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While the description implies usage through its specific function (Wikipedia search), it provides no explicit guidance on when to select this tool versus alternatives, prerequisites, or conditions where it might not be suitable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedecho
    • First observedget-current-time
    • First observedsearch-wikipedia

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: echo returns input messages, get-current-time retrieves the current date/time, and search-wikipedia searches Japanese Wikipedia. There is no overlap in functionality, making tool selection unambiguous for an agent.

Naming Consistency4/5

The naming follows a mostly consistent verb_noun pattern (echo, get-current-time, search-wikipedia), with echo being a slight deviation as a single verb. The style is readable and predictable, though not perfectly uniform.

Tool Count3/5

With only 3 tools, the server feels thin for a general-purpose MCP server, as it lacks depth in any specific domain. However, it is well-scoped for minimal functionality, avoiding bloat.

Completeness2/5

The toolset is severely incomplete for any coherent domain; it mixes unrelated utilities (echo, time) with a specific search function (Wikipedia). There are obvious gaps, such as missing CRUD operations or a focused workflow, which could lead to agent failures.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    A minimal Model Context Protocol server in TypeScript that demonstrates MCP-compliant resources and tools for LLMs, featuring simple resources and a basic tool that echoes messages or returns greetings.
    1
    5
    Apache 2.0
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A production-ready TypeScript MCP server providing basic tools (add, echo, timestamp), resources (server info, greetings, data access), and prompt templates (analyze, code-review, summarize). Serves as a foundation for building custom MCP servers with extensible architecture.
    225
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Node.js/TypeScript MCP server template with sample tools (ping and system_info) that demonstrates how to build custom tools for Claude Desktop using stdio transport.
    13
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    A local Model Context Protocol (MCP) server that exposes custom tools to Claude Desktop, enabling direct interaction with your local environment. It provides a framework for building and integrating custom TypeScript tools into the Claude interface.
    10
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/109naoki/minimal-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server