mcp-learning
A learning-oriented MCP server with tools for greeting, self-introduction, and name shouting, built with TypeScript and Zod validation.
README
My First MCP Server
This repository contains my first Model Context Protocol (MCP) server built using the TypeScript SDK.
The goal of this project is to create and test custom MCP tools, validate user inputs, and interact with the server using MCP Inspector.
Project Features
This MCP server provides three custom tools:
1. greet Tool
A personalized greeting tool that accepts a user's name and returns a greeting message.
Example:
Input:
name: "Tala Ahmad Saleh Saabneh"
Output:
Hello, Tala Ahmad Saleh Saabneh!
The tool uses Zod schema validation to ensure that the input is a valid string before execution.
2. introduce_me Tool
A custom tool that introduces the creator of this MCP server.
Example Output:
Hello! My name is Tala Ahmad Saleh Saabneh, and I created this MCP server.
This tool does not require input parameters and demonstrates a simple MCP tool response.
3. shout_name Tool
A validation-based tool that receives a four-word full name and returns it in uppercase format.
Example:
Input:
fullName:
Tala Ahmad Saleh Saabneh
Output:
TALA AHMAD SALEH SAABNEH!
The input is validated using a Zod regular expression schema to ensure that the provided name follows the required format.
Technologies Used
- Node.js
- TypeScript
- Model Context Protocol (MCP) TypeScript SDK
- Zod (Input Validation)
- MCP Inspector
- tsx
Work Steps
1. Running the MCP Server
First, I verified that the MCP server was working correctly by running:
npm run dev
The server was kept running in the terminal because MCP Inspector requires an active server connection.
2. Launching MCP Inspector
A second terminal was opened in the same project directory, and MCP Inspector was launched using:
npx @modelcontextprotocol/inspector npx tsx src/index.ts
After starting, Inspector generated a local URL that was opened in the browser.
3. Connecting MCP Inspector
Inside MCP Inspector:
- Transport type was kept as STDIO
- Command was set to:
npx
- Arguments were set to:
tsx src/index.ts
After clicking Connect, MCP Inspector successfully connected to the MCP server.
4. Testing Available Tools
The Tools tab displayed all available tools registered in the server:
greetintroduce_meshout_name
Each tool was executed successfully through MCP Inspector.
5. Testing greet Tool
The greet tool was tested using:
name: "Tala Ahmad Saleh Saabneh"
The server successfully returned:
Hello, Tala Ahmad Saleh Saabneh!
6. Testing introduce_me Tool
The introduce_me tool was executed without parameters.
The returned message was:
Hello! My name is Tala Ahmad Saleh Saabneh, and I created this MCP server.
7. Testing shout_name Tool
The shout_name tool was tested using:
fullName:
Tala Ahmad Saleh Saabneh
The tool successfully returned:
TALA AHMAD SALEH SAABNEH!
Input Validation Testing
To verify that input validation was correctly implemented, an invalid request was intentionally submitted to the greet tool by leaving the required name field empty.
The request was rejected before reaching the tool handler.
MCP Inspector displayed:
MCP error -32602: Input validation error
Invalid input: expected string, received undefined
This confirms that Zod successfully validated the input schema and prevented invalid data from reaching the tool implementation.
Project Structure
MCP-Learning/
│
├── src/
│ └── index.ts
│
├── package.json
├── package-lock.json
├── tsconfig.json
└── README.md
Testing Evidence
The repository submission includes MCP Inspector screenshots showing:
- Available tools list
- Successful execution of
greet - Successful execution of
introduce_me - Successful execution of
shout_name - Input validation error test
Author
Tala Ahmad Saleh Saabneh
Academy
This project was developed as part of the MCP learning journey through NextFlows Academy.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。