MCP Server
Enables communication between MCP clients and the server over stdio transport, allowing programmatic interaction with greeting-related functionality.
Provides a greeting service with tools for generating personalized greetings, accessing server information, and using greeting templates.
Integrates schema validation for defining input parameters for greeting tools, ensuring type safety in client-server communication.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Servergreet me with politeness set to formal"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server and Client Example (TypeScript)
This project demonstrates the creation and interaction of a simple Model Context Protocol (MCP) server and a standalone MCP client using TypeScript and the @modelcontextprotocol/sdk.
The setup includes:
my-mcp-greeter-server: An MCP server that provides greeting-related tools, resources, and prompts.my-mcp-client-script: A simple command-line client script that launches the server, connects to it, and interacts with its capabilities programmatically.
Communication between the client and server in this example uses the stdio (standard input/output) transport mechanism.
Overview of the Process Followed
This project was built following these main phases:
Server Development: Creating the MCP service provider.
Client Development: Creating a script to consume the server's services.
Testing & Interaction: Running the client script, which launches the server and demonstrates communication.
(Optional) Integration: Discussing how to integrate the server with existing MCP clients like VS Code extensions.
Related MCP server: TypeScript MCP Server Boilerplate
Prerequisites
Before you begin, ensure you have the following installed:
Node.js (v16 or higher recommended)
npm (usually included with Node.js)
A text editor or IDE (like VS Code)
npx(usually included with npm) - useful for testing with MCP Inspector.
Phase 1: Building the MCP Server (my-mcp-greeter-server)
Project Setup:
Created the directory
my-mcp-greeter-server.Initialized an npm project:
npm init -y.Installed necessary dependencies:
npm install @modelcontextprotocol/sdk zod.Installed development dependencies:
npm install -D typescript @types/node.Initialized TypeScript configuration:
npx tsc --init.Configured
tsconfig.json(setting"module": "Node16","target": "ES2022","outDir": "./build","rootDir": "./src", etc.).Updated
package.jsonto include"type": "module"and addedbuild/startscripts.Created the source file
src/index.ts.
Server Implementation (
src/index.ts):Imported required modules (
McpServer,StdioServerTransport,z).Defined constants for server
nameandversion.Instantiated
McpServer, passing the name, version, and declaring its capabilities (tools, resources, prompts).Defined a Tool (
greet): Usedserver.tool()to create a function callable by clients. Included a description, defined input parameters with Zod (name,politeness), and implemented the handler to return a personalized greeting string.Defined a Resource (
server-info): Usedserver.resource()to expose static data. Provided a unique URI (info://greeter/about) and implemented the handler to return the server's name and version.Defined a Prompt (
suggest-greeting): Usedserver.prompt()to create a reusable interaction template. Included a description and implemented the handler to return a predefined set of user/assistant messages to guide an LLM interaction.Used Stdio Transport: Instantiated
StdioServerTransportas the communication method.Connected: Called
await server.connect(transport)to make the server ready.Logging: Added
console.errorstatements for visibility during execution, especially important for stdio transport where stdout is used for protocol messages.Kept Alive: Ensured the Node.js process didn't exit immediately after connection.
Building & Fixing:
Ran
npm run buildto compile TypeScript to JavaScript in thebuilddirectory.Fixed a TypeScript error related to accessing server version directly, opting to use predefined constants instead.
Phase 2: Building the MCP Client Script (my-mcp-client-script)
Project Setup:
Created a separate directory
my-mcp-client-script.Initialized an npm project:
npm init -y.Installed necessary dependencies:
npm install @modelcontextprotocol/sdk.Installed development dependencies:
npm install -D typescript @types/node.Initialized and configured
tsconfig.jsonsimilarly to the server project.Updated
package.jsonwith"type": "module"andbuild/startscripts.Created the source file
src/client-script.ts.
Client Implementation (
src/client-script.ts):Imported required modules (
Client,StdioClientTransport,path,url).Determined Server Path: Calculated the path to the server's compiled
index.jsfile (relative or absolute).Configured Stdio Transport: Instantiated
StdioClientTransport, providing thecommand(node) andargs(the path to the server script). This configuration is key, as the client transport launches the server process.Instantiated Client: Created a
Clientinstance, giving it an identity and declaring its intent to use tools and resources.Connected: Called
await client.connect(transport), which launched the server process and established the MCP connection over its stdio streams.Interacted with Server:
Called the
greettool usingawait client.callTool().Read the
server-inforesource usingawait client.readResource().Fetched the
suggest-greetingprompt usingawait client.getPrompt().
Logged Results: Used
console.logto display the responses received from the server.Closed Connection: Used
await client.close()in afinallyblock to cleanly shut down the connection and terminate the server process.
Phase 3: Building and Running
Build Both Projects:
cd my-mcp-greeter-server && npm run buildcd ../my-mcp-client-script && npm run build
Run the Client:
cd my-mcp-client-scriptnpm run start(ornode build/client-script.js)Observed the interleaved output from both the client (
console.log) and the server (console.error), confirming successful communication and execution of tools/resources/prompts.
Explanation of Roles
The Server (
GreeterServer):Provides Services: Exposes specific capabilities (greeting tool, server info, prompt template).
Passive Listener (in stdio): Waits for a client to connect via its standard streams.
Executes Logic: Runs the code associated with a tool/resource/prompt when requested by the client.
Sends Results: Formats results according to MCP specs and sends them back to the client.
The Client (
client-script.ts):Consumes Services: Uses the capabilities offered by the server.
Initiator (in stdio): Launches the server process and establishes the connection.
Sends Requests: Decides which tool to call, resource to read, or prompt to get, and sends the appropriate MCP request.
Receives Results: Processes the responses sent back by the server.
Controls Flow: Manages the sequence of interactions and decides when to close the connection.
Testing the Server Interactively
While the client script tests the programmatic interaction, you can test the server's capabilities individually using the MCP Inspector:
# Make sure the server is NOT already running
# Replace /path/to/... with the actual absolute path
npx @modelcontextprotocol/inspector node /path/to/my-mcp-greeter-server/build/index.jsAvailable Tools
1 toolgreetB
Generates a personalized greeting.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the person to greet. | |
| politeness | No | Desired politeness level. | informal |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'personalized greeting' but doesn't explain what that entails (e.g., format, length, language), whether it's idempotent, or any side effects. This leaves significant gaps in understanding the tool's behavior.
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 extremely concise with a single sentence that directly states the tool's purpose. There is no wasted language, and it is front-loaded with the essential information, making it efficient and well-structured.
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?
Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. However, it lacks details on the greeting format or any behavioral context, which would be helpful for an agent to use it effectively, especially without annotations.
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 description coverage is 100%, so the schema already fully documents both parameters (name and politeness). The description adds no additional meaning beyond what the schema provides, such as examples or edge cases, meeting the baseline for high schema coverage.
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 tool's purpose with a specific verb ('Generates') and resource ('a personalized greeting'), making it immediately understandable. However, since there are no sibling tools, it doesn't need to differentiate from alternatives, which prevents a perfect score of 5.
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 provides no guidance on when to use this tool versus alternatives, prerequisites, or any contextual constraints. It simply states what the tool does without offering usage instructions or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion or overlap between tools, making disambiguation perfect. The tool's purpose is clearly distinct by default.
A single tool inherently follows a consistent naming pattern, as there are no other tools to compare it against. The name 'greet' is straightforward and appropriate.
One tool is too few for most server purposes, as it limits functionality and suggests an incomplete or trivial implementation. This is borderline for a meaningful MCP server scope.
The server's purpose is unclear from the single tool, but 'greet' alone suggests severe incompleteness for any practical domain. There are obvious gaps, as no other operations are supported, making the surface inadequate.
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseDqualityDmaintenanceA minimal Model Context Protocol server in TypeScript that demonstrates MCP-compliant resources and tools for LLMs, featuring simple resources and a basic tool that echoes messages or returns greetings.15Apache 2.0
- FlicenseBqualityDmaintenanceA boilerplate project for quickly developing Model Context Protocol (MCP) servers using TypeScript SDK. Includes example tools like calculator and greeting functions, plus system information resources.3
- FlicenseBqualityDmaintenanceA demonstration TypeScript MCP server that showcases basic MCP concepts with simple tools (greeting, calculator), text resources, and prompt templates for learning the Model Context Protocol.2
- FlicenseNot gradedqualityDmaintenanceA boilerplate project for quickly developing Model Context Protocol (MCP) servers using TypeScript SDK, with example implementations of tools (calculator, greeting) and resources (server info).
Appeared in Searches
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/sanketshinde3001/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server