mcp-learning

mcp-learning

A learning-oriented MCP server with tools for greeting, self-introduction, and name shouting, built with TypeScript and Zod validation.

Category
Visit Server

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:

  • greet
  • introduce_me
  • shout_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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured