hello-mcp-server
hello-mcp-python
Python으로 작성된 hello-world Model Context Protocol 서버이면서, 작은 로컬 LLM으로 해당 도구를 구동하는 콘솔 채팅 클라이언트입니다.
의도적으로 작게 만들었지만 장난감은 아닙니다. 공식 Python MCP SDK를 사용하고, stdio와 streamable HTTP 두 전송 방식을 모두 제공하며, 실제 파이프를 통한 실제 프로토콜 왕복(round-trip)을 포함한 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
서버 도구
도구 | 설명 |
| 이름을 넣어 10개 언어로 인사를 건넵니다: |
| 메시지를 그대로 반환합니다. 연결 확인에 유용합니다. |
|
|
| 두 수를 있는 그대로 소수점 사이즈로 더합니다. 따라서 |
서버는 프롬프트(friendly_greeting, summarize_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 5099stdio 모드에서 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로 연결할 수 있습니다.
채팅 전략
전략 | 선택되는 경우 | 동작 방식 |
네이티브 도구 호출 | 모델이 | 모델이 도구 호출을 직접 생성합니다. |
프롬프트 플래너 | 모델에는 연결되지만 | 앱이 도구 이름, 설명, JSON 스키마를 보여주고, JSON 결정 하나를 요청한 뒤 실행하고, 실행 결과를 문장으로 만들어 달라고 모델에 요청합니다. |
오프라인 라우팅 | 연결 가능한 모델이 없거나 | 결정된 키워드 규칙이 |
선택된 전략과 그 이유는 시작 시 출력됩니다.
실제 대화 기록
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. 이 버전에서 편리하게 쓸 수 있는 API는mcp.server.mcpserver.MCPServer입니다. 이전 예제에서는 이 스타일을FastMCP라고 부르기도 했습니다.httpx— Ollama 및 OpenAI 호환 HTTP 호출.pytest— 단위 및 통합 테스트.ruff— 린트 및 포맷팅.
다른 프로젝트에서 만난 같은 주제
세 개의 병렬 구현 중 하나입니다. 같은 도구, 같은 동작, 같은 교훈을 담았습니다:
hello-mcp-dotnet — C# / .NET 10
hello-mcp-java — Java 17 / Spring Boot
hello-mcp-python — Python 3.14+ (현재 위치)
라이선스
MIT 라이선스 — LICENSE 참조.
Available Tools
4 toolsaddAdd two numbersA
Adds two numbers and returns their sum. Prefer this over doing arithmetic yourself.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| time_zone | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| language | No | en |
TDQS
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.
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.
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.
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.
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.
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
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.
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.
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.
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
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
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for Speech-to-Text
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.2MIT
- FlicenseNot gradedqualityDmaintenanceA 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.
- AlicenseNot gradedqualityDmaintenanceA 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.17MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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