first-mcp-server
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., "@first-mcp-serverAdd 12 and 7"
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.
first-mcp-server
Project summary
A minimal MCP (Model Context Protocol) server exposing a single tool named
addthat adds two numbers and returns the result as text.Built with @modelcontextprotocol packages and zod for input validation.
Key files
index.js — main server file that registers the
addtool and starts the server.
Requirements
Node.js 16+ (recommend LTS)
npm or yarn
Install
Clone the repository and change into the project directory:
git clone && cd /Users/sagar/Documents/Learning/MCP-Server
Install dependencies (example with npm):
npm install
Dependencies used in this project (examples from code):
@modelcontextprotocol/server
@modelcontextprotocol/server/stdio (stdio transport)
@modelcontextprotocol/express (express helper)
@modelcontextprotocol/node (Node HTTP transport)
zod (validation)
Run
Default HTTP transport (as the project currently starts):
node index.js
The server listens on port 3001 and mounts the MCP endpoint at /mcp (see index.js).
STDIO transport (useful for local CLI-style integrations):
Uncomment the call to
runServeronSTDIOTransport()in index.js and run:node index.js
Usage examples
HTTP example (curl)
Request payload (JSON):
{ "tool": "add", "input": { "num1": 10, "num2": 20 } }
Example curl call (adjust hostname/port if needed):
curl -X POST http://localhost:3001/mcp
-H "Content-Type: application/json"
-d '{"tool":"add","input":{"num1":10,"num2":20}}'Expected response (the server's tool returns a content array of text blocks):
{ "content": [ { "type": "text", "text": "30" } ] }
Notes: index.js wires the HTTP transport using NodeStreamableHTTPServerTransport and calls transport.handleRequest(req, res, req.body) (see index.js). The exact envelope the transport expects depends on the @modelcontextprotocol/node transport implementation; the example above follows the simple shape used in this project (tool + input).
STDIO example (local CLI integration)
The project contains a helper to run the server over STDIO using StdioServerTransport. If started in STDIO mode, the server expects JSON requests on stdin and replies on stdout. The tool registered in index.js validates inputs with zod and returns the sum as text.
Tool details (from code)
Tool name: "add"
Description: "Add two numbers"
Input schema (zod):
num1: number
num2: number
Implementation snippet (from index.js):
server.registerTool(
"add",
{
title: "add",
description: "Add two numbers",
inputSchema: z.object({ num1: z.number(), num2: z.number() }),
},
async (ctx) => ({
content: [{ type: "text", text: `${ctx.num1 + ctx.num2}` }],
}),
);Notes:
Validation: zod already validates the inputs. Ensure callers send numeric values and handle validation errors gracefully.
Error handling: Add try/catch around
transport.handleRequestand tool handlers to return consistent error payloads and HTTP status codes (4xx for client errors, 5xx for server errors).Logging & monitoring: Add structured logging, request IDs, and basic metrics to monitor usage and errors.
Security: If exposed publicly, protect the /mcp endpoint (authentication, rate-limiting) and run behind a reverse proxy.
Tests: Add unit tests for tool handlers and integration tests for transports (HTTP and STDIO).
Contributing
Open issues or PRs for feature requests or fixes.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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
Add two numbers instantly and generate friendly greetings on demand. Speed up quick math and perso…
Create friendly greetings and add two numbers instantly. Speed up simple tasks and streamline ligh…
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA simple MCP server that provides integer addition functionality. Enables users to perform basic arithmetic operations by adding two integers together through natural language interactions.-
- AlicenseNot gradedqualityDmaintenanceA simple demonstration MCP server that provides a basic arithmetic tool for adding two numbers together, showcasing how to build custom MCP servers with input validation.15ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to perform basic mathematical operations like addition and subtraction through MCP tools. Also provides REST API endpoints for the same operations.MIT
- FlicenseNot gradedqualityDmaintenanceA simple MCP server that provides a tool for adding two numbers, designed for testing MCP integration with Claude.-
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/Sagar06/MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server