Skip to main content
Glama
kuldeepcodes

hello-mcp-server

by kuldeepcodes

hello-mcp-python

ci Python 3.14 licence: MIT

Python による hello-world の Model Context Protocol サーバーであり、そのツールを 小さなローカル LLM で動かすコンソールチャットクライアントも付属しています。

意図的に小さくしていますが、おもちゃではありません。公式の Python MCP SDK を使用し、stdio と streamable HTTP の両方のトランスポートに対応しています。実際のパイプを介した実際のプロトコルラウンドトリップを含む 29 件の自動テストでカバーされ、実際に MCP サーバーを壊す問題も処理しています。

MCP は初めてですか? まず GETTING-STARTED.md から始めましょう。このプロジェクト全体を空のディレクトリから一歩ずつ構築しながら、すべての依存関係とファイルを説明しています。

クイックスタート

前提条件: Python 3.14 以降。

git clone https://github.com/kuldeepcodes/hello-mcp-python.git
cd hello-mcp-python

python -m venv .venv
source .venv/bin/activate        # Windows: .\.venv\Scripts\Activate.ps1

python -m pip install -e ".[dev]"
python -m pytest                 # 29 tests

# Works with no model at all, using deterministic keyword routing
python -m hello_mcp.chat --provider none --ask "hello Kuldeep"

実際の会話には、Ollama をインストールして小さなモデルをプルしてください:

ollama pull phi3          # ~2.2 GB, works with the prompt planner
python -m hello_mcp.chat --ask "what is 17.5 plus 24.25?"

Related MCP server: Pistachio MCP Server

サーバーツール

ツール

説明

say_hello

名前を指定して 10 の言語で挨拶します。enesfrdeitpthijazhar

echo

メッセージをそのまま返します。接続確認に便利です。

get_server_time

構造化された utclocaltimeZoneutcOffsethuman のフィールドを返します。

add

小数形式で 2 つの数値を加算するため、0.1 + 0.20.3 になります。

サーバーはプロンプト(friendly_greetingsummarize_capabilities)とリソース(hello://server/info およびテンプレート化された hello://greetings/{language})も公開しています。

サーバーの起動

# stdio, for local MCP clients
.\.venv\Scripts\python.exe -m hello_mcp.server

# streamable HTTP, endpoint /mcp and liveness /healthz
.\.venv\Scripts\python.exe -m hello_mcp.server --http --port 5099

stdio モードでは、stdout は JSON-RPC 専用に予約されています。すべてのログは意図的に stderr に送信されます。

MCP クライアント設定

VS Code または Claude Desktop スタイルの stdio 設定です。クライアントはプロジェクトディレクトリから実行されないため、絶対パスを使用してください:

{
  "mcpServers": {
    "hello-mcp-python": {
      "command": "/absolute/path/to/hello-mcp-python/.venv/bin/python",
      "args": ["-m", "hello_mcp.server"],
      "cwd": "/absolute/path/to/hello-mcp-python"
    }
  }
}

Windows では、インタープリタは ...\\.venv\\Scripts\\python.exe となり、JSON ではバックスラッシュをエスケープする必要があります。

HTTP クライアントは、--http を指定してサーバーを起動した後、http://127.0.0.1:5099/mcp に接続できます。

チャット戦略

戦略

選択される条件

動作の仕組み

ネイティブツール呼び出し

モデルが tools 配列を含むプローブリクエストを受け入れた場合。

モデルがツール呼び出しを直接生成します。

プロンプトプランナー

モデルには到達できるが、Ollama の phi3 のようにツールを拒否する場合。

アプリがツール名・説明・JSON スキーマを表示し、1 つの JSON の決定を求め、それを実行し、結果を文章にするようモデルに求めます。

オフラインルーティング

モデルに到達できない場合、または --provider none を使用する場合。

決定論的なキーワードルールで、hello NAMEwhat time is itadd 2 and 3echo ... をサポートします。

選択された戦略とその理由は、起動時に出力されます。

実際のトランスクリプト

  hello-mcp-chat v1.0.0
  a Model Context Protocol client for Python

Connected to hello-mcp-server (4 tools)
Model strategy: prompt planner - Ollama says this model does not support tools

  [tool] add {"a": 17.5, "b": 24.25} -> 41.75
bot> The sum of 17.5 and 24.25 is 41.75.

テストとリンティング

.\.venv\Scripts\python.exe -m ruff check .
.\.venv\Scripts\python.exe -m pytest

統合テストは、stdio 経由で実際のサーバーを起動し、実際の MCP ハンドシェイクを行い、ツールの一覧表示、ツールの呼び出し、プロンプトの一覧表示、リソースの読み込みを実行し、stdout が JSON-RPC のみを含むことをアサートします。

制限事項

  • プロンプトプランナーは、意図的に保守的にしており、ネイティブツール呼び出しよりも信頼性が低くなっています。

  • HTTP トランスポートには認証がありません。これはローカルでの学習用プロジェクトです。

  • Windows では、Asia/Kolkata などの IANA タイムゾーンを使用するために tzdata パッケージが必要です。

使用技術

  • mcp==2.0.0 — 公式の Python MCP SDK。このバージョンでは、mcp.server.mcpserver.MCPServer が使いやすい API です。古い例では、このスタイルを FastMCP と呼ぶことがあります。

  • httpx — Ollama および OpenAI 互換の HTTP 呼び出し用。

  • pytest — ユニットテストおよび統合テスト用。

  • ruff — リンティングおよびフォーマット用。

他の言語の同プロジェクト

これは、同じツール・同じ動作・同じ教訓を備えた 3 つの並行実装のうちの 1 つです:

ライセンス

MIT — LICENSE を参照してください。

Available Tools

4 tools
addAdd two numbersA

Adds two numbers and returns their sum. Prefer this over doing arithmetic yourself.

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the behavioral burden. It states that this is a pure computation: it adds the two numbers and returns the sum, with no mention of side effects or external state. It does not discuss numeric edge cases, but none are particularly relevant for a simple addition tool.

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 two short sentences with no wasted text. The first sentence states the complete behavior and return value, and the second adds a useful usage directive. It is front-loaded and easy to parse.

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

Completeness5/5

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

For a two-parameter arithmetic tool, the description covers the operation, the inputs, and the return value. No output schema exists, but 'returns their sum' is enough to describe the successful outcome. The tool is simple enough that nothing essential is missing.

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 input schema provides only names and number types, with no descriptive text. The description says 'two numbers' and 'their sum,' which maps to the a and b parameters and clarifies that both are operands in the addition. This is adequate for such a simple case, though it does not add deeper individual-parameter details.

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 operation ('Adds two numbers') and the result ('returns their sum'), using a specific verb-resource form. It is immediately distinguishable from the sibling tools, which are unrelated (say_hello, echo, get_server_time).

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

Usage Guidelines4/5

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

It gives an explicit usage directive: 'Prefer this over doing arithmetic yourself.' It does not name any alternative tool, but none of the siblings are arithmetic-related, so there is no real alternative to distinguish. The guidance is sufficient for such a simple operation.

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

echoEcho a messageA

Echoes a message back verbatim. Useful for verifying that the connection between the client and this MCP server is healthy.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYes

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden of disclosure. It clearly conveys that the tool performs no transformation and returns the message exactly as provided, implying a safe, stateless operation. It does not mention error cases or side effects, but there is no indication any exist.

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?

Two sentences, no filler: the first states behavior, the second gives practical context. The important verb-and-echo concept is front-loaded.

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

Completeness5/5

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

For a tool this simple, the description is complete. It defines the sole parameter, the behavior, and the use case, and the lack of an output schema is acceptable because the tool's output is obvious from 'echoes ... back verbatim.'

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 schema provides zero description coverage, so the description must compensate. It does by clarifying that the `message` parameter is the input that will be echoed back verbatim. This is sufficient for a single-string parameter, though more detail about constraints or format could be added.

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 states a specific verb and resource: 'Echoes a message back verbatim.' This clearly differentiates it from siblings like say_hello, get_server_time, and add, all of which have different behaviors.

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

Usage Guidelines4/5

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

The description explicitly states its use: 'Useful for verifying that the connection between the client and this MCP server is healthy.' It does not describe when not to use it or list alternatives, but the intended context is clear.

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

get_server_timeGet server timeA

Returns the current date and time on the machine hosting this MCP server. Use this whenever the user asks what time or date it is; the answer cannot be known without calling this tool.

ParametersJSON Schema
NameRequiredDescriptionDefault
time_zoneNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It clearly conveys that this is a read-only operation that reports server-local time rather than the client's time, and it explains why the tool must actually be invoked. There is no hidden mutation or surprising side effect, though it could optionally mention that time_zone affects the returned representation.

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 exactly two sentences, front-loaded with the main purpose and immediately followed by usage guidance. There is no filler, redundant restating of the title, or unnecessary detail.

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?

This is a simple tool with one optional parameter and an output schema, so the description does not need to explain return values. However, the behavior of the time_zone parameter is not addressed anywhere, so an agent could not confidently know how to request a time in a specific timezone or why the parameter exists.

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

Parameters2/5

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

The input schema provides only a 'time_zone' property with a default of null and no description. The tool description does not explain how time_zone changes the result, whether null means server-local time, or what formats are accepted. Since the description provides zero parameter explanation and schema description coverage is 0%, this is a clear gap.

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 uses a specific verb ('Returns') and resource ('current date and time on the machine hosting this MCP server'), making the tool's action and result immediately clear. It also distinguishes this tool from siblings like say_hello, echo, and add by defining its exact purpose.

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

Usage Guidelines5/5

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

The description explicitly states when to use it: 'Use this whenever the user asks what time or date it is.' It also adds a strong practical instruction by noting that the answer cannot be known without calling this tool, helping the agent avoid guessing.

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

say_helloSay helloA

Greets a person by name. Use this whenever the user asks to greet, welcome, or say hello to someone. Supports several languages via an ISO 639-1 code.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
languageNoen

TDQS

A4.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that the tool supports multiple languages and requires a person's name, which is useful. However, it does not describe output format, potential side effects, or any limitations/error behaviors—though as a greeting tool, the behavioral surface is small. A score of 3 is appropriate because the description covers core behavior but not edge details.

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?

Three sentences, all essential. First sentence defines action, second establishes usage context, third explains param. No filler or redundant restatement of the title.

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?

The tool is simple with 2 parameters, no nested objects, no output schema, and no annotations. The description covers what the tool does, when to use it, and clarifies parameters. Minor gap: does not list accepted language codes or the greeting format, but the default 'en' is in schema. Adequate for making a correct call.

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?

Schema description coverage is 0%: the schema provides only field names and types, with no descriptions. The tool description compensates by explaining that 'name' is the person to greet and 'language' accepts an ISO 639-1 code. It doesn't document possible values for language beyond default 'en', but it gives enough meaning to infer usage. Since the description adds meaningful semantics beyond the bare schema, a 4 is justified.

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 states a specific verb and resource: 'Greets a person by name.' It clearly distinguishes itself from sibling tools (echo, get_server_time, add) by focusing on greeting functionality. The mention of language support via ISO 639-1 adds specificity.

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

Usage Guidelines5/5

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

Explicitly states when to use: 'Use this whenever the user asks to greet, welcome, or say hello to someone.' This provides clear contextual guidance and implicitly contrasts with sibling tools that serve different purposes.

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

TDQS

A4.4/5.0
Disambiguation5/5

Each tool has a completely distinct purpose: greeting, echoing, retrieving time, and adding numbers. There is no overlap or ambiguity in what an agent should call.

Naming Consistency4/5

All names are lowercase snake_case and use a verb-first style, but 'echo' and 'add' are bare verbs while 'say_hello' and 'get_server_time' have object/adjective complements. This is a minor inconsistency, not a confusing mix.

Tool Count5/5

Four tools is an appropriate, well-scoped count for a small hello/utility MCP server. Each tool is independently useful and the count is firmly within the ideal range.

Completeness4/5

The set covers its obvious standalone capabilities fully—greetings, echoes, time, and arithmentic are all self-contained. The only minor gap is that it is not a fully powered calculator and has no broader domain expectations, but nothing needed seems missing.

Maintenance

ActivityMaintained
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
    Not graded
    quality
    D
    maintenance
    A minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A remote MCP server built with Node.js and TypeScript that enables tool calls and prompt templates via streamable HTTP transport. It includes example implementations for a calculator and localized greetings, featuring built-in CORS support for web-based clients.
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal learning-focused MCP server that demonstrates core primitives like tools and resources through simple greeting functions. It provides a foundational example for connecting AI models to external data using both Streamable HTTP and stdio transports.
    17
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.

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/kuldeepcodes/hello-mcp-python'

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