Skip to main content
Glama
ry-ops

creating-your-first-mcp-server

by ry-ops

What is MCP?

The Model Context Protocol is an open standard for how apps give LLMs context. An MCP server exposes capabilities; an MCP client (like Claude) discovers and uses them. Write a server once, and any MCP client can plug into it.

Related MCP server: Node.js MCP Server

The building blocks

What

Tools

executable functions the model can call — this repo ships calculator, file-ops and weather

Resources

structured data exposed by URI (files, records, APIs)

Prompts

reusable, parameterized prompt templates

Quick start

git clone https://github.com/ry-ops/creating-your-first-mcp-server.git
cd creating-your-first-mcp-server
npm install
npm run build
npm start            # run the server (stdio)
npm run example      # run the example client against it

Then point an MCP client at it. For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "first-server": {
      "command": "node",
      "args": ["/absolute/path/to/creating-your-first-mcp-server/dist/index.js"]
    }
  }
}

Build your own tool

Add a file under src/tools/ alongside calculator.ts, file-ops.ts and weather.ts, register it in src/index.ts, and rebuild. The examples/client.ts shows how to list and call tools.

Learn the concepts

Building on the SDK directly? The Claude API docs cover MCP and the tool-use loop.

License

MIT. See LICENSE.


Related MCP Connectors

Related MCP Servers