A simple Model Context Protocol (MCP) server that provides a "Hello World" tool for Microsoft Copilot Studio.
This MCP server exposes one tool:
- say_hello: Returns a greeting message. Optionally accepts a name parameter to personalize the greeting.
Note: This server uses Streamable HTTP transport (POST/GET
/mcp), which is required by Microsoft Copilot Studio. SSE transport was deprecated in August 2025.
- Navigate to the project directory:
cd c:\Py\MCPSample- Install dependencies:
pip install -r requirements.txtStart the server with:
python server.pyNote: Port 80 requires administrator privileges on Windows. You may need to run the command prompt or terminal as administrator.
The server will start on http://localhost:80 with the MCP endpoint at http://localhost:80/mcp.
You should see output like:
INFO:__main__:Starting MCP Hello World Server on http://localhost:80
INFO:__main__:MCP Streamable HTTP endpoint: http://localhost:80/mcp
INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
INFO:__main__:MCP Streamable HTTP session manager running
Make sure your MCP server is running locally (see "Running the Server" above).
- Go to Microsoft Copilot Studio
- Open your agent/copilot
- Navigate to Actions > Add an action
- Select Model Context Protocol (MCP)
- Configure the connection:
- Name: Hello World MCP Server
- URL:
http://localhost:80/mcp - Transport: Streamable HTTP
Once connected, you can use the say_hello tool in your Copilot:
Example 1 (without parameter):
- User: "Use the say_hello tool"
- Response: "Hello, World!"
Example 2 (with name parameter):
- User: "Say hello to Alice"
- Response: "Hello, Alice!"
Description: Returns a hello world greeting. Optionally accepts a name to personalize the greeting.
Parameters:
name(string, optional): Name to personalize the greeting (defaults to "World")
Returns: A greeting message as text
This server uses:
- MCP SDK: Official Model Context Protocol SDK for Python
- Starlette: ASGI framework for handling HTTP requests
- Uvicorn: ASGI server for running the application
- Streamable HTTP Transport: Required transport for Microsoft Copilot Studio (SSE deprecated August 2025)
The server implements the StreamableHTTPSessionManager from the MCP SDK. The ASGI app (MCPApp) routes:
- Lifespan events → managed by Starlette for session lifecycle
POST /mcp/GET /mcp→ handled directly byStreamableHTTPSessionManager- All other paths → returns
404 Not Found
server.py: Main MCP server implementationrequirements.txt: Python dependenciesREADME.md: This documentation file
Server won't start:
- Ensure port 80 is not already in use
- On Windows, run the command prompt or terminal as administrator (port 80 requires elevated permissions)
- Check that all dependencies are installed:
pip install -r requirements.txt
Copilot Studio can't connect:
- Verify the server is running and accessible at
http://localhost:80/mcp - Confirm you are using the Streamable HTTP transport option (not SSE) in Copilot Studio
- Check firewall settings if running on a different machine
- Ensure you're using the correct URL format (
/mcpendpoint) in Copilot Studio - On Windows, ensure you're running with administrator privileges (port 80 requires elevated permissions)
Tool not appearing:
- Refresh the connection in Copilot Studio
- Check server logs for errors
- Verify the MCP configuration in Copilot Studio
- This is a basic example server designed for demonstration purposes
- For production use, consider adding authentication, error handling, and security measures
- The server runs on localhost by default — for remote access, configure appropriate security settings
- SSE transport (
/sse) is no longer supported; use Streamable HTTP (/mcp) instead