Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To implement an MCP server, choose an SDK, register a narrowly scoped tool with a validated input schema, select a transport that matches deployment, and verify the server through an MCP client. The example below uses the stable TypeScript SDK v2 path and stdio for a local server. It also explains resources, prompts, Streamable HTTP, Python, testing, and common failures.

What an MCP server provides

Model Context Protocol (MCP) lets a client discover and use capabilities exposed by a server. A server can provide three kinds of capability:

  • Tools are actions the client can invoke, such as checking a status or creating a ticket.
  • Resources are readable data addressed by a URI, such as config://production or file://reports/today.
  • Prompts are reusable prompt templates that a client can request with named arguments.

Start with one safe tool. Add resources or prompts only when the client needs them; a smaller surface is easier to secure, test and document.

Choose the SDK and transport first

TypeScript v2 for a Node.js server

The TypeScript SDK v2 documentation describes v2 as the stable release line implementing the 2026-07-28 MCP specification. It replaces the older monolithic v1 package path. The first-server tutorial requires Node.js 20 or later and uses the @modelcontextprotocol/server, zod and tsx packages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Python v2 for Python services

The Python SDK v2 requires Python 3.10 or later. Install it with uv add "mcp[cli]" or pip install "mcp[cli]". Its documentation covers tools, resources, prompts, stdio, Streamable HTTP and SSE. Examples labeled v1 use a maintenance API line, so do not mix their imports or syntax with v2 code without checking migration guidance.

Match transport to deployment

Deployment Transport How it works Main concern
Local desktop or editor integration stdio The host launches your process and exchanges messages through stdin and stdout. stdout must contain only protocol messages; send logs to stderr.
Hosted or remote service Streamable HTTP A client connects to an HTTP endpoint exposed by the server. Apply authentication, TLS, request limits and the SDK’s HTTP deployment guidance.
Existing legacy integration HTTP+SSE An older streaming HTTP arrangement. The TypeScript v1 documentation presents it as backward compatibility; use current guidance for new systems.

Build a minimal TypeScript MCP server

1. Create the project

  1. Install Node.js 20 or newer.
  2. Create and enter a directory: mkdir mcp-demo && cd mcp-demo.
  3. Initialize the package: npm init -y.
  4. Install dependencies: npm install @modelcontextprotocol/server zod.
  5. Install the TypeScript runner: npm install -D tsx.
  6. Set "type": "module" in package.json.

2. Register one validated tool

Create server.ts:

import { z } from "zod";
import { Server } from "@modelcontextprotocol/server";
import { serveStdio } from "@modelcontextprotocol/server/stdio";

const server = new Server({
  name: "status-server",
  version: "1.0.0",
});

server.tool(
  "check_service",
  "Return a simple health message for a named service",
  {
    service: z.string().min(1).max(80),
  },
  async ({ service }) => ({
    content: [{
      type: "text",
      text: `${service} is available for a health check.`,
    }],
  })
);

await serveStdio(server);

The input schema is part of the protocol contract. The SDK validates service before the handler runs, so an empty or excessively long value is rejected instead of reaching your application logic. Replace the illustrative handler with a narrowly scoped operation that enforces authorization and validates any downstream API response.

3. Run it over stdio

Start the process with:

npx tsx server.ts

The process waits for protocol messages on stdin. Do not print banners, debug statements or stack traces to stdout: stdout carries JSON-RPC traffic. Use stderr instead:

console.error("status-server started");

If you need structured application logs, send them to stderr or a file and keep protocol responses on stdout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Connect and test with MCP Inspector

Starting a process is not a connection test. Use MCP Inspector, the interactive client shown in the official tutorial:

Rank #2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
  • Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
  • Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
  • CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
  • CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
  • CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)
  1. Launch Inspector according to its current installation instructions.
  2. Choose a stdio connection.
  3. Set the command to npx and arguments to tsx server.ts.
  4. Connect and inspect the server’s capabilities.
  5. Open the tools view, select check_service, enter a value such as payments, and call it.
  6. Confirm that the response contains text stating that the named service is available for a health check.

If the tool does not appear, inspect the process stderr and verify that Inspector is launching the same working directory and command you tested in a terminal.

Grow the server with resources and prompts

Resources

Use a resource when the client needs to read data rather than trigger an action. Define a stable URI scheme, document its contents and apply access checks for every request. Resource data should be bounded or paginated; never expose an unrestricted filesystem or database connection merely because the protocol can carry it.

Prompts

Use a prompt for a repeatable interaction pattern with named arguments. Keep user-controlled values clearly separated from instructions, and do not place secrets in a prompt template. A prompt can guide a client, but authorization must remain in the server-side tool or resource implementation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capability design

  • Give each tool a specific name and description that tells a client when it is appropriate.
  • Use strict schemas: enums for finite choices, bounds for strings and numbers, and explicit optional fields.
  • Return clear, machine-readable content types and human-readable error messages.
  • Prefer idempotent operations for retries; require confirmation for destructive actions.

Use Streamable HTTP for a remote server

When a server must be reached by a hosted client, expose the SDK’s Streamable HTTP transport at a stable endpoint. Put it behind HTTPS and authenticate before dispatching a tool. At minimum, plan for:

Rank #3
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
  • Authentication and authorization per user, tenant and tool.
  • Input-size, request-rate and execution-time limits.
  • Cancellation and cleanup when a client disconnects.
  • Origin and host validation, TLS termination and secure secret storage.
  • Observability that records request IDs and outcomes without logging credentials or sensitive arguments.

The older TypeScript v1 material describes HTTP+SSE as backward compatibility. Treat that as migration context, not a reason to select it for a new implementation. Confirm the exact server and client APIs for the SDK version you install.

Python implementation path

For Python v2, create an environment with Python 3.10 or newer and install mcp[cli] using uv or pip. The v2 SDK supports the same conceptual model: register a tool, resource or prompt, select stdio or an HTTP transport, then connect a client. Keep v2 imports and lifecycle calls together.

The Python getting-started material also demonstrates in-memory client testing: connect a client directly to a server object, call a tool and assert the structured result without a subprocess, listening port or network transport. This is useful for fast unit tests; add a real stdio or HTTP integration test as well, because transport wiring can fail independently of handler logic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A compact add-tool/resource/prompt example found in the Python v1 maintenance documentation is explicitly v1. Do not paste it into a v2 project unchanged. Use it only to understand the capability pattern, then follow the v2 migration guidance.

Rank #4
SANOOV Raspberry Pi 5 4GB Kit, 4GB RAM Single Board Computer with Active Cooler and ABS Case, Complete Raspberry Pi 5 Starter Kit for IoT Robotics Retro Gaming
  • All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
  • Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
  • Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
  • Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
  • Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online

Verification checklist before production

  • Runtime: Node.js 20+ for the TypeScript tutorial or Python 3.10+ for Python v2.
  • Package line: Confirm the installed SDK is the v2 line you intend to use.
  • Transport: stdio for a host-launched local process; Streamable HTTP for a remote endpoint.
  • Schema: Invalid, missing and boundary inputs are rejected with useful errors.
  • Protocol cleanliness: stdout is reserved for MCP messages in stdio mode.
  • Client behavior: Inspector can list capabilities and successfully invoke each test tool.
  • Security: Secrets are outside source control, destructive actions require appropriate authorization, and remote endpoints use TLS.
  • Operations: Timeouts, cancellation, retries and rate limits are defined for every external dependency.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

Inspector cannot start the server

Check the command, arguments and working directory. Run the exact command manually. A missing tsx dependency, an unsupported Node version or an incorrect module type in package.json commonly causes immediate exit.

The connection reports invalid JSON or protocol errors

Remove every ordinary console.log from the stdio process. Send diagnostics to stderr. Also check that a shell wrapper is not printing a startup message before launching Node.

The tool is listed but calls fail validation

Compare the client’s argument names and types with the declared Zod schema. In the example, the key must be service, and it must be a non-empty string no longer than 80 characters.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A remote client cannot reach the endpoint

Verify that the client and server use the same transport, that the URL and path are correct, and that a reverse proxy preserves the required streaming behavior. Check TLS, authentication headers, firewall rules and server logs.

Best Value
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Code copied from a tutorial no longer compiles

Identify whether the snippet targets TypeScript v1, TypeScript v2, Python v1 or Python v2. SDK package names and lifecycle APIs are version-specific. Align the runtime, package version and tutorial generation before changing application code.

Or skip the browser setup

If your MCP tool needs website images or PDFs, ScreenshotNeo provides an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Its HTTP API can also produce a capture directly:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for MCP and API configuration. Before capture, cookie or consent banners, newsletter popups and chat widgets are removed. Bot checks, blank pages and failed loads are not billed; response headers identify the page verdict and whether it was billed. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can one MCP server expose both tools and resources?

Yes. A server may expose tools, resources and prompts together; add each capability only when the client use case requires it.

Is stdio suitable for a public internet service?

No. stdio is intended for a host that launches a local process. Use Streamable HTTP for a remotely hosted server and apply authentication and TLS.

How should I test a Python server without opening a port?

The Python v2 getting-started material supports an in-memory client connected directly to the server object, allowing tool calls and assertions without a subprocess or transport.

Quick Recap

Bestseller No. 2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM); Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
$159.99
Bestseller No. 5
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.