Skip to content

Building Your First MCP Server

A walkthrough of the steps to create a simple MCP server that exposes a tool, and how to test it.

Editorial team 1 min read

Building an MCP server is straightforward with an official SDK, available for several languages.

1. Pick a Small Use Case

Start with one useful tool — for example, looking up an order by ID in your system.

2. Create the Server

Using an SDK, create a server with a name and version, then register a tool with:

  • A clear name, such as get_order.
  • A description explaining what it does and when to use it.
  • An input schema, such as order_id as a string.
  • A handler that performs the lookup and returns text or structured content.

3. Choose a Transport

Use stdio for a local server; the SDK handles message framing.

4. Test With an Inspector

Protocol inspector tools connect to your server, list its tools and let you call them manually. Fix schema and output issues here before involving a model.

5. Connect to a Host

Add the server to an MCP-compatible application's configuration, then ask the model something that needs your tool.

6. Iterate

Watch how the model uses the tool. Improve descriptions and outputs where it's confused.

Before Sharing

Add input validation, helpful errors, logging to stderr and documentation. For remote deployment, add authorisation.

More in MCP

All MCP guides →
MCP Guide · 1 min

MCP Architecture: Hosts, Clients and Servers

How the Model Context Protocol is structured: the host application, the clients it creates and the servers that expose capabilities.

MCP 1 min read 2 Sep 2025

MCP Guide · 2 min

MCP Tools, Resources and Prompts

The three main things an MCP server can offer, who controls each, and when to use which.

MCP 2 min read 1 Sep 2025

MCP Guide · 1 min

MCP Transports: stdio and HTTP

How MCP messages travel: standard input and output for local servers, HTTP for remote ones, and how to choose.

MCP 1 min read 31 Aug 2025

MCP Guide · 1 min

MCP Authorisation for Remote Servers

How remote MCP servers authenticate users with OAuth, and good practice for tokens and scopes.

MCP 1 min read 29 Aug 2025