MCP Server Streamable
A Model Context Protocol (MCP) server implementation using FastMCP with streamable HTTP transport.
Overview
This project demonstrates how to create an MCP server that runs over HTTP with streamable transport. The server provides a simple greeting tool that can be called by MCP clients.
Features
HTTP Transport: Uses streamable HTTP transport for communication
FastMCP Framework: Built with the FastMCP library for easy server development
Simple Tool: Includes a greeting tool that takes a name parameter
Prerequisites
Python 3.8+
uv (recommended for fast package management)
Installation
Clone or navigate to the project directory:
Install dependencies using uv:
This will automatically create a virtual environment and install all dependencies from the pyproject.toml
file.
Activate the virtual environment:
Or manually activate:
Usage
Running the Server
Start the MCP server:
Or using uv:
The server will start on the default port and be accessible via HTTP.
Available Tools
greeting
Description: Send a personalized greeting
Parameter:
name
(string) - The name to include in the greetingReturns: A greeting message
Example usage:
Configuration for Claude Desktop
To use this server with Claude Desktop, add the following configuration to your claude_desktop_config.json
file:
Alternatively, if you want to use the remote HTTP endpoint:
Development
Project Structure
Extending the Server
To add new tools, define functions with the @mcp.tool()
decorator:
Transport Details
This server uses the "streamable-http" transport, which:
Provides HTTP-based communication
Supports streaming responses
Is suitable for web-based integrations
Allows for remote access over HTTP
Troubleshooting
Port conflicts: If the default port is in use, the server will indicate this in the logs
Virtual environment: Ensure the virtual environment is activated before running
Dependencies: Make sure all required packages are installed with
uv sync
License
This project is part of the MCP servers course and is intended for educational purposes.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A demonstration MCP server that runs over HTTP with streamable transport, providing a simple greeting tool for testing MCP client-server communication. Built with FastMCP framework for educational purposes in learning MCP server development.