Creating Your First Server
FreeNot checkedEnables to perform mathematical calculations, retrieve weather information, and manage files through a standardized MCP interface, showcasing best practices for
About
Enables to perform mathematical calculations, retrieve weather information, and manage files through a standardized MCP interface, showcasing best practices for building MCP servers.
README
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 install
Build
npm run build
Run the Server
npm start
Run Example Client
npm run example
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
└── LICENSE
Available 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, humidity
File Operations Tool
Performs file system operations (read, write, list, delete).
// Example usage
{
"operation": "read",
"path": "/path/to/file.txt"
}
// Returns file contents or operation result
Development
Building
npm run build
Watch Mode
npm run dev
Clean Build Artifacts
npm run clean
Documentation
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
Installing Creating Your First Server
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/ry-ops/creating-your-first-mcp-serverFAQ
Is Creating Your First Server MCP free?
Yes, Creating Your First Server MCP is free — one-click install via Unyly at no cost.
Does Creating Your First Server need an API key?
No, Creating Your First Server runs without API keys or environment variables.
Is Creating Your First Server hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Creating Your First Server in Claude Desktop, Claude Code or Cursor?
Open Creating Your First Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Creating Your First Server with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
