MCP server tools and transport
MCP servers can provide three main types of capabilities, and tools are functions that can be called by the LLM with user approval.
Definition · At a glance · How it works
Definition
MCP servers can provide three main types of capabilities. Tools are functions that can be called by the LLM, with user approval. Resources are file-like data that can be read by clients, like API responses or file contents.
Prompts are pre-written templates that help users accomplish specific tasks. The tutorial builds an MCP weather server and connects it to a host, Claude for Desktop. The tutorial primarily focuses on tools.
At a glance
When you ask a question in Claude for Desktop, the following stages occur.
How it works
In the Python example, the MCPServer class uses Python type hints and docstrings to automatically generate tool definitions. In the Spring example, the @Service annotation auto-registers the service in the application context. The starter-webflux-server demonstrates how to create an HTTP-based MCP server with the WebFlux starter.
The starter-webflux-server also showcases how to define and register MCP Tools, Resources, and Prompts, using the Spring Boot’s auto-configuration capabilities. The tool execution handler is responsible for actually executing the logic of each tool. The Ruby mcp gem provides the Model Context Protocol SDK for Ruby, with classes for server implementation and stdio transport.
The Rust rmcp crate provides the Model Context Protocol SDK for Rust, with features for server implementation, procedural macros, and stdio transport. serveStdio negotiates the protocol revision with each client, so the same server answers both 2026-07-28 clients and clients that still open with the 2025-era initialize handshake. The Java example server uses MCP protocol version 2025-11-25, as supported by the latest stable release of the Java SDK.
Clients that also support that version can connect to it, but clients that support only 2026-07-28 cannot. For STDIO-based servers, never write to stdout. Writing to stdout will corrupt the JSON-RPC messages and break the server.
For HTTP-based servers, standard output logging is fine since it does not interfere with HTTP responses. The Python example must use at least version 2.0.0 of the Python MCP SDK. The C# example sets up a console application that uses the Model Context Protocol SDK to create an MCP server with standard I/O transport.
Example
The server in the tutorial exposes two tools: get_alerts and get_forecast. Using an MCP server with Claude for Desktop requires configuring Claude for Desktop for that server. The servers are added in the mcpServers key.
The MCP UI elements only show up in Claude for Desktop if at least one server is properly configured. Since this is the US National Weather service, the queries only work for US locations.
Common misconceptions
A no-active-alerts message for a given state is not an error; it just means there are no current weather alerts for that state. Simply closing the window does not fully quit the application, and MCP server configuration changes will not take effect.
Sources
This page is written from the official sources below. Open them to check the original text.
- Official documentationhttps://modelcontextprotocol.io/docs/2026-07-28/develop/build-serverFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.