MCP Server Streamable
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.
README
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:
cd d:\work\projects\mcp-servers-course\mcp-server-streamable
- Install dependencies using uv:
uv sync
This will automatically create a virtual environment and install all dependencies from the pyproject.toml file.
- Activate the virtual environment:
uv run python server.py
Or manually activate:
.venv\Scripts\activate
Usage
Running the Server
Start the MCP server:
python server.py
Or using uv:
uv run python server.py
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 greeting - Returns: A greeting message
Example usage:
# When called with name="Alice"
# Returns: "Hi Alice"
Configuration for Claude Desktop
To use this server with Claude Desktop, add the following configuration to your claude_desktop_config.json file:
{
"mcpServers": {
"streamable-server": {
"command": "python",
"args": ["d:\\work\\projects\\mcp-servers-course\\mcp-server-streamable\\server.py"]
}
}
}
Alternatively, if you want to use the remote HTTP endpoint:
{
"mcpServers": {
"streamable-server": {
"command": "npx",
"args": [
"mcp-remote",
"http://127.0.0.1:8000/mcp",
"--allow-http"
]
}
}
}
Development
Project Structure
mcp-server-streamable/
├── server.py # Main server implementation
├── README.md # This file
└── .venv/ # Virtual environment
Extending the Server
To add new tools, define functions with the @mcp.tool() decorator:
@mcp.tool()
def your_tool_name(param: str) -> str:
"""Tool description"""
# Your implementation here
return result
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.