Skip to main content
Glama
happyteam-dx1

MCP Sample Server

MCP Sample Server

シンプルなModel Context Protocol (MCP)サーバーのサンプル実装です。

関連プロジェクト

  • MCPクライアント: このサーバーと対話するための自然言語クライアント

    • OpenAI APIを使用して自然言語でMCPツールを実行

    • GitHubリポジトリ: yukinaka/mcp-client

    • ローカルパス: ../mcp-client/

Related MCP server: Calculator MCP

機能

このMCPサーバーは以下の機能を提供します:

ツール

  1. get_current_time - 現在の時刻を取得

    • パラメータ: timezone (オプション) - タイムゾーン(例: Asia/Tokyo, UTC)

  2. calculate - 簡単な計算を実行

    • パラメータ:

      • operation - 演算の種類(add, subtract, multiply, divide)

      • a - 最初の数値

      • b - 2番目の数値

リソース

  • サンプルノートへのアクセス(note:///welcome, note:///example

インストール

前提条件

  • Node.js (v18以上)

  • npm または yarn

ローカル開発

# リポジトリをクローン
git clone https://github.com/yukinaka/mcp-sample-server.git
cd mcp-sample-server

# 依存関係をインストール
npm install

# ビルド
npm run build

npmパッケージとしてインストール(公開後)

npm install -g @odenalexbs/mcp-sample-server

使い方

MCPクライアントで使用する(推奨)

このサーバーには、OpenAI APIを使用した自然言語クライアントが付属しています。

cd ../mcp-client
npm install
npm start

詳細はmcp-client/README.mdを参照してください。

Claude Codeで使用する

.claude/settings.local.json に以下の設定を追加します:

開発版(ローカル)を使用する場合

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

GitHubから直接使用する場合

{
  "mcpServers": {
    "sample": {
      "command": "npx",
      "args": ["-y", "github:yukinaka/mcp-sample-server"]
    }
  }
}

npmパッケージとして使用する場合(公開後)

{
  "mcpServers": {
    "sample": {
      "command": "npx",
      "args": ["-y", "@odenalexbs/mcp-sample-server"]
    }
  }
}

他のMCPクライアントで使用する

Claude Desktop等の他のMCPクライアントでも同様に設定できます。クライアントの設定ファイルに上記のような設定を追加してください。

開発

ウォッチモード

npm run watch

テスト実行

# サーバーを直接実行してテスト
npm run build
npm start

GitHub公開手順

  1. GitHubで新しいリポジトリを作成

  2. ローカルでGitリポジトリを初期化:

git init
git add .
git commit -m "Initial commit: MCP sample server"
git branch -M main
git remote add origin https://github.com/yukinaka/mcp-sample-server.git
git push -u origin main
  1. (オプション)npmに公開:

npm login
npm publish

カスタマイズ

このサンプルをベースに、独自のツールやリソースを追加できます:

  • src/index.tstools 配列に新しいツールを追加

  • CallToolRequestSchema ハンドラーに実装を追加

  • リソースを追加する場合は resources 関連のハンドラーを修正

ライセンス

MIT

参考リンク

Available Tools

2 tools
calculateC

簡単な計算を実行します(加算、減算、乗算、除算)

ParametersJSON Schema
NameRequiredDescriptionDefault
operationYes実行する演算
aYes最初の数値
bYes2番目の数値

TDQS

C2.9/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. The description only states what calculations it performs but doesn't disclose any behavioral traits like error handling (e.g., division by zero), precision, performance characteristics, or what the output looks like. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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

Conciseness4/5

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

The description is very concise - a single sentence in Japanese that efficiently states the purpose. It's front-loaded with the main function and includes parenthetical examples. There's no wasted text, though it could be slightly more structured if it included brief usage notes.

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

Completeness2/5

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

Given the tool has no annotations and no output schema, the description is incomplete. While it states what calculations are performed, it doesn't cover important contextual aspects like return values, error conditions, or behavioral constraints. For a calculation tool with 3 parameters and no structured output information, the description should do more to help an agent understand how to use it effectively.

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?

The schema description coverage is 100%, meaning all parameters are documented in the schema. The description doesn't add any parameter semantics beyond what's already in the schema (operation with enum values, a and b as numbers). It doesn't explain parameter relationships, constraints, or examples. With high schema coverage, the baseline is 3 even without additional param info in the description.

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 what the tool does: '簡単な計算を実行します(加算、減算、乗算、除算)' translates to 'Performs simple calculations (addition, subtraction, multiplication, division).' This specifies the verb ('performs calculations') and the resource/scope ('simple calculations' with listed operations). It distinguishes from the sibling tool 'get_current_time' which is unrelated. However, it doesn't explicitly differentiate from potential calculation alternatives beyond listing operations.

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. It doesn't mention any prerequisites, constraints, or scenarios where this tool is appropriate versus other calculation methods. The only sibling tool 'get_current_time' is completely unrelated, so no comparison is needed, but the description offers no usage context at all.

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
timezoneNoタイムゾーン (例: Asia/Tokyo, UTC)

TDQS

B3.1/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. While '取得します' (get) implies a read-only operation, the description doesn't explicitly state whether this requires permissions, has rate limits, or what the return format looks like (e.g., timestamp, formatted string). For a tool with zero annotation coverage, this is a significant gap in transparency.

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 in Japanese that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 low complexity (single optional parameter) and high schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it doesn't fully compensate for missing behavioral details like return format or error conditions, keeping it at a baseline level.

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?

The schema description coverage is 100%, with the single parameter 'timezone' fully documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides, such as default behavior when timezone is omitted. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose as '現在の時刻を取得します' (Get the current time), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from its sibling tool 'calculate', which might also handle time-related calculations, so it doesn't reach the highest 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 like the 'calculate' sibling tool. It doesn't mention any context, exclusions, or prerequisites for usage, leaving the agent to infer appropriate scenarios.

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. 2 tool updatesv1.0.0
    • First observedcalculate
    • First observedget_current_time

TDQS

B3/5.0
Disambiguation5/5

The two tools have completely distinct purposes: 'calculate' handles mathematical operations, while 'get_current_time' retrieves temporal information. There is no overlap in functionality, making it impossible for an agent to confuse them.

Naming Consistency3/5

The naming is mixed: 'calculate' uses a verb-only style, while 'get_current_time' follows a verb_noun pattern. Although both are readable, they lack a consistent convention, which could lead to minor confusion in a larger set.

Tool Count2/5

With only 2 tools, this server feels thin and under-scoped for a general-purpose 'MCP Sample Server'. It lacks coverage for common operations beyond basic math and time, suggesting it might be a minimal example rather than a fully functional server.

Completeness2/5

Given the server's name implies a sample or general utility scope, the toolset is severely incomplete. It misses obvious utilities like string manipulation, file operations, or data conversion, leaving significant gaps that would hinder agent workflows.

Maintenance

ActivityInactive
ResponsivenessSyncing

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
    B
    quality
    C
    maintenance
    A Model Context Protocol server that provides basic calculator functionality for LLMs, enabling them to perform mathematical operations like addition, subtraction, multiplication, division, modulo, and square root.
    6
    304
    16
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    A simple server that provides basic mathematical operations (sum and subtraction) through the Model Context Protocol.
    2
    1
    -
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server implementation that provides basic utility tools including echo, uppercase text conversion, and mathematical calculations.
    2
    3
    225
    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/happyteam-dx1/mcp-sample-server'

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