My First MCP
my-first-mcp
My first MCP (Model Context Protocol) server implementation.
Based on the video tutorial https://frontendmasters.com/courses/mcp/
Description
This is a simple MCP server that provides an addition tool. It demonstrates how to create a basic MCP server using the @modelcontextprotocol/sdk.
Features
Addition Tool: Adds two numbers together and returns the result
Installation
npm installUsage
Running the server
npm run myFirstMcpTesting the server
List available tools
npm run myFirstMcp:listThis will return information about all available tools in the server.
Call the add tool
npm run myFirstMcp:callThis will call the add tool with example arguments (5 + 3) and return the result.
API
Tools
add
Adds two numbers together.
Parameters:
a(number): First numberb(number): Second number
Returns:
A text response with the sum of the two numbers
Example:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "add",
"arguments": {
"a": 5,
"b": 3
}
}
}Dependencies
@modelcontextprotocol/sdk: MCP SDK for building serverszod: TypeScript-first schema validation
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/MaxiGarcia13/my-first-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server