creating-your-first-mcp-server
Click on "Deploy 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., "@creating-your-first-mcp-serveradd 10 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.
Creating Your First MCP Server
A production-ready TypeScript implementation of a Model Context Protocol (MCP) server with example tools demonstrating best practices for building MCP servers.
Quick Start
Installation
npm installBuild
npm run buildRun the Server
npm startRun Example Client
npm run exampleRelated MCP server: Node.js MCP Server
What is MCP?
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables:
Standardized Communication: A unified way for LLMs to interact with external tools and data sources
Tool Integration: Expose custom functionality that AI models can discover and use
Resource Management: Provide structured access to files, databases, and APIs
Prompt Templates: Define reusable prompts for common tasks
Key MCP Concepts
Server: Exposes tools, resources, and prompts that clients can use
Client: Connects to MCP servers to access their capabilities
Tools: Executable functions that perform specific tasks
Resources: Data sources like files, database records, or API endpoints
Prompts: Reusable prompt templates with parameters
Project Structure
creating-your-first-mcp-server/
├── src/
│ ├── index.ts # Main MCP server implementation
│ └── tools/
│ ├── calculator.ts # Mathematical operations tool
│ ├── weather.ts # Weather information tool
│ └── file-ops.ts # File operations tool
├── examples/
│ └── client.ts # Example MCP client usage
├── documentation/
│ ├── MCP-CONCEPTS.md # In-depth MCP concepts
│ ├── TOOL-DEVELOPMENT.md # Guide to creating tools
│ └── INTEGRATION.md # Integration guide
├── package.json
├── tsconfig.json
└── LICENSEAvailable Tools
Calculator Tool
Performs mathematical operations (add, subtract, multiply, divide, power, sqrt).
// Example usage
{
"operation": "add",
"a": 5,
"b": 3
}
// Returns: { "result": 8 }Weather Tool
Retrieves weather information for a location (simulated data for demonstration).
// Example usage
{
"location": "San Francisco"
}
// Returns weather data including temperature, conditions, humidityFile Operations Tool
Performs file system operations (read, write, list, delete).
// Example usage
{
"operation": "read",
"path": "/path/to/file.txt"
}
// Returns file contents or operation resultDevelopment
Building
npm run buildWatch Mode
npm run devClean Build Artifacts
npm run cleanDocumentation
For more detailed information, see:
MCP Concepts - Deep dive into MCP architecture and concepts
Tool Development Guide - How to create custom tools
Integration Guide - Integrating the server with clients
Error Handling
This server implements comprehensive error handling:
Input validation for all tool parameters
Graceful error messages for clients
Type-safe error responses
Logging for debugging
Security Considerations
File operations are restricted to safe directories
Input validation prevents injection attacks
Error messages don't expose sensitive system information
Rate limiting can be added for production use
License
MIT License - Copyright (c) 2026 ry-ops
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Resources
This server cannot be deployed
Maintenance
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA basic educational MCP server that provides simple tools for mathematical calculations, text manipulation, and time retrieval. Designed for learning MCP implementation patterns and development purposes.-
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server that enables file operations, mathematical calculations with unit conversions, and system information retrieval. Provides secure access to local file system, calculator functions with statistics, and system monitoring capabilities.2 npmISC
- FlicenseDqualityNot gradedmaintenanceEnables weather data retrieval and analysis through an MCP server interface with support for local file operations.1-
- FlicenseNot gradedqualityDmaintenanceProvides tools for calculating math expressions and querying weather, demonstrating how to build an MCP server using FastMCP or raw SDK.-