Skip to main content
Glama
kuldeeepy

first-mcp-server

by kuldeeepy

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: Weather MCP Server

Run it

npm install
npm start

That 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

McpServer

the server itself, with a name and version the client sees

registerTool

one tool — a name, a description, and an input schema

StdioServerTransport

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

F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    A simple server that implements the Model Context Protocol, allowing AI models like Claude to fetch real-time weather information for any location using the wttr.in API.
    4
    22
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides math and weather tools accessible via LangGraph agent using MCP protocol with stdio and streamable HTTP transports.
    1
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables users to get weather forecasts for any city using the Open-Meteo API through natural language in Claude Desktop or VS Code.

View all related MCP servers

Related MCP Connectors

  • Real-time weather conditions and multi-day forecasts via Open-Meteo — free, no API key required

  • US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.

  • US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.

View all MCP Connectors

Latest Blog Posts

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/kuldeeepy/first-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server