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., "@first-mcp-server What's the weather in Delhi?"
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
The smallest MCP server that actually does something — one tool, stdio transport,
no build step. About 35 lines in server.ts.
I wrote this while figuring out how MCP works. If you've read Understanding MCP Servers, this is that post's weather example as code you can actually run.
What it does
Exposes a single tool, getCityWeather, over stdio. Ask Claude "what's the
weather in Delhi?" and it discovers the tool, calls it, and answers from the
result.
The weather itself is a hardcoded map of three cities. That's on purpose — the point here is the protocol, not the data. Swap the lookup for a real API call and nothing else about the server changes.
Related MCP server: Minimal MCP Demo
Run it
npm install
npm startThat starts the server on stdio. On its own it does nothing visible — it's waiting for a client to talk to it, which is the whole idea.
Connect it to Claude
Add it to your MCP config (claude_desktop_config.json for Claude Desktop, or
.mcp.json for Claude Code):
{
"mcpServers": {
"first-server": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/first-mcp-server/server.ts"]
}
}
}Use an absolute path — the host spawns this as a subprocess and won't be in your project directory. Restart the host, then ask it about the weather in Delhi, Mumbai or Bangalore.
The three pieces
Everything in server.ts is one of these:
Piece | What it is |
| the server itself, with a name and version the client sees |
| one tool — a name, a description, and an input schema |
| how bytes move; JSON-RPC over stdin/stdout |
The description and schema matter more than they look. They're the only thing the model reads when deciding whether this tool is relevant to your question, so vague descriptions produce a tool that never gets called.
License
MIT
Available Tools
1 toolgetCityWeatherB
Fetch the current weather for a city
Inputs: name (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap. The single tool's purpose is immediately clear from its name and description.
The single tool name follows a clear verb-noun camelCase pattern (getCityWeather), and there are no other names to create inconsistency.
One tool feels thin for a weather server, which often supports forecasts, alerts, and other query types. It is not necessarily wrong, but it is on the low end of acceptable.
The tool covers the specific task of fetching current city weather, but leaves obvious gaps like forecasts, historical data, or unit selection unexplained. It is adequate for a narrow demo, but not a full weather service.
Maintenance
Related MCP Connectors
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Current weather and forecast lookup as an agent tool.
Read-only airport delay, weather, and 24h forecast tools for AI assistants. Airport-level only.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables users to get weather forecasts for any city using the Open-Meteo API through natural language in Claude Desktop or VS Code.ISC
- AlicenseBqualityDmaintenanceThis MCP server demonstrates basic Model Context Protocol architecture by exposing a get_weather tool that returns fake weather data, communicating over stdio.1ISC
- FlicenseNot gradedqualityCmaintenanceEnables querying current weather information for cities through natural language, with support for both stdio and streamable HTTP transports.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to retrieve current weather conditions and 3-day forecasts for cities through standardized MCP tools over stdio.-