Skip to main content
Glama
Sdaas

mcp-tutorial

by Sdaas

One time setup

How we setup this repo

uv init mcp-tutorial
cd mcp-tutorial
uv add "mcp[cli]<2.0"

The MCP Server

server.py contains the MCP Server. It is a one line changes to switch it from stdio transport to streamable http transport

mcp.run()  # stdio transport (subprocess)
-OR-
mcp.run(transport="streamable-http")  # now an HTTP service on :8000

The MCP Client

The MCP client host_with_loop.py can work with both stdio and streamable-http transport

# If the MCP Server were using stdio transport, then we would use stdio_client(server_params) to talk to it.
async with stdio_client(server_params) as (read, write):

# If it were using HTTP transport, we would use streamablehttp_client("http://localhost:8000/mcp")
async with streamablehttp_client("http://localhost:8000/mcp") as (read, write, _):

Testing with STDIO

  • Make sure that server.py uses mcp.run() # stdio transport (subprocess)

  • Make sure that host_with_loop uses the stdio transport

Testing the MCP Server

Launch the inspector UI ( in browser )

uv run mcp dev server.py

Related MCP server: Weather MCP Server

Testing the stand-alone MCP Client

This client runs the MCP Server as a subprocesses and then calls the tool. The key line is

# Tell the client HOW to launch the server (as a subprocess over stdio)
server_params = StdioServerParameters(command="python", args=["server.py"])

Run it as

uv run client_only.py

Testing with Ollama

Check that Ollama is running

$ ollama ps
NAME    ID    SIZE    PROCESSOR    CONTEXT    UNTIL

$ brew services list
Name          Status  User  File
ollama        started sdaas ~/Library/LaunchAgents/homebrew.mxcl.ollama.plist
...

$ curl http://localhost:11434/api/tags | jq
.... API response ....

Simple host

Run the host

uv run host.py

Host with Loop

uv run host_with_loop.py

Testing with STDIO

  • Make sure that server.py uses http transport

  • Make sure that host_with_loop uses the http transport

Start the MCP server

$ uv run server.py
INFO:     Started server process [75425]
INFO:     Waiting for application startup.
[08/24/26 17:09:14] INFO     StreamableHTTP session manager started        streamable_http_manager.py:143
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Run the application

uv run host_with_loop.py
USER: What's the temperature in Tokyo?
MODEL: ...
MODEL: ...
ANSWER: The current temperature in Tokyo is 18°C.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables natural language weather queries for global cities, integrating with OpenWeather API to provide real-time weather information in an easy-to-read format.
    1
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides weather forecasts and active alerts for US locations using the National Weather Service API. It supports both local stdio and remote HTTP/SSE transport modes for flexible integration with MCP clients.
    80
    GPL 3.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sdaas/mcp-tutorial'

If you have feedback or need assistance with the MCP directory API, please join our Discord server