Sponsored by Deepsite.site

MCP - Model Context Protocol

Created By
AdiGo228 months ago
MCP Server using TypeScript and JavaScript made with official MCP docs handling US Weather data having context for two tools - showing weather forecast and weather alerts for US based location. Used Zod for data validation and architectured two folders - src and build , development (ts) and production (js) respectively.
Content

MCP - Model Context Protocol

About MCP

The Model Context Protocol (MCP) is an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools. The architecture is straightforward: developers can either expose their data through MCP servers or build AI applications (MCP clients) that connect to these servers.

👉 Learn more


MCP follows a client-server architecture where a host application can connect to multiple servers.


Architecture

src/ → TypeScript source
build/ → Compiled JavaScript


```bash
weather/
├── src/        # TypeScript source
│   └── index.ts
├── build/      # Compiled JavaScript
│   └── index.js
├── tsconfig.json
└── package.json

src/ Directory (TypeScript Source)

Purpose:

  • Contains development-time code written in TypeScript
  • You implement MCP protocol handlers here (Resources, Tools, Prompts)
  • Also contains logic, type definitions, SDKs, etc.

Key Files:

  • index.ts → Entry point for your MCP server
  • MCP concepts:
    • resources/ → MCP Resource implementations
    • tools/ → LLM-callable functions
    • prompts/ → Prompt templates / management

build/ Directory (Compiled JavaScript)

Purpose:

  • Holds runtime code after TS compilation
  • This is the folder Claude Desktop interacts with via:
    node build/index.js

Traits:

  • Compiled, production-ready JavaScript
  • No TS needed after this stage
  • Clean deployable output

⚙️ Data Flow Pipeline

graph LR
    A[Developer Writes TS Code] --> B[src/index.ts]
    B --> C[TypeScript Compiler tsc]
    C --> D[build/index.js]
    D --> E[Node.js Runtime]
    E --> F[Claude Desktop IPC]

What Happens After index.js

Once your index.js is ready, it flows like this:

Claude Desktop ↔ stdio ↔ Server Transport ↔ McpServer ↔ Tools (1)

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.