# Running Example Fast MCP Server

BlueRock Secure MCP Server for FastMCP comes with an example MCP server built with the FastMCP Pythonic Framework.

FastMCP v2.13 is preloaded onto the Amazon Linux 2023 instance.  An example Fast MCP server, Anthropic's Weather Forecast MCP, is bundled with the image as well.

## Running FastMCP

### Step 1: Log in to your BlueRock Free Tier instance AMI

```sh
ssh -i <ssh-key-file> ec2-user@<ip address>
```

### Step 2: Launch FastMCP Server

For full documentation on FastMCP go to the [FastMCP website](https://gofastmcp.com/getting-started/welcome). &#x20;

On the BlueRock instance, change to the FastMCP directory.

```sh
cd /opt/bluerock/mcp/fastmcp
```

Activate a python virtual environment

```sh
source .venv/bin/activate
```

Create a sample MCP server in a file `my_server.py`

```python
from fastmcp import FastMCP

mcp = FastMCP("My MCP Server")

@mcp.tool
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run()
```

Start the sample server.

```sh
python my_server.py
```

## Running the example Weather Fast MCP Server

### Step 1: Log in to your BlueRock Free Tier instance AMI

```sh
ssh -i <ssh-key-file> ec2-user@<ip address>
```

### Step 3: Start the MCP Weather Server and MCP Weather Client

```sh
cd /opt/bluerock/mcp/weatherMCP
```

**Start MCP Server**

```sh
source .venv/bin/activate
uv run server-weatherMCP.py
```

**Start MCP Client**

Login the ec2 instance in a separate terminal (see Step 1)

```
cd /opt/bluerock/mcp/weatherMCP
source .venv/bin/activate
uv run client-weatherMCP.py
[11/11/25 15:47:55] INFO     Processing request of type ListToolsRequest                   server.py:674
Connected to MCP Weather Server
Available tools: 2
  - get_alerts: Get weather alerts for a US state.

    Args:
        state: Two-letter US state code (e.g. CA, NY)

  - get_forecast: Get weather forecast for a location.

    Args:
        latitude: Latitude of the location
        longitude: Longitude of the location



============================================================
MCP WEATHER CLIENT - INTERACTIVE MODE
============================================================

Commands:
  forecast <latitude> <longitude> - Get weather forecast
  alerts <state_code>             - Get weather alerts (e.g., CA, NY)
  tools                           - List all available tools
  help                            - Show this help
  quit                            - Exit

weather>
```

**Run Weather MCP Tools**

<pre><code><strong>weather> help
</strong>
Commands:
  forecast &#x3C;latitude> &#x3C;longitude> - Get weather forecast
  alerts &#x3C;state_code>             - Get weather alerts
  tools                           - List all available tools
  quit                            - Exit
weather> alerts CA
[10/31/25 15:49:46] INFO     Processing request of type CallToolRequest                                           server.py:674
[10/31/25 15:49:48] INFO     HTTP Request: GET https://api.weather.gov/alerts/active/area/CA "HTTP/1.1 200 OK"  _client.py:1740
============================================================
WEATHER ALERTS
============================================================
Event: Beach Hazards Statement
Area: San Francisco; Coastal North Bay Including Point Reyes National Seashore; San Francisco Peninsula Coast; Northern Monterey Bay; Southern Monterey Bay and Big Sur Coast
Severity: Moderate
Description: * WHAT...A long period northwesterly swell will result in an
increased risk for sneaker waves and rip currents and breaking
waves of 12 to 17 feet with the highest waves up to 20 feet in
favored locations.

* WHERE...San Francisco, Coastal North Bay Including Point Reyes
National Seashore, San Francisco Peninsula Coast, Northern
Monterey Bay and Southern Monterey Bay and Big Sur Coast
Counties.

* WHEN...From 7 AM PDT Saturday morning through 2 AM PST early
Tuesday morning.

* IMPACTS...Sneaker waves can unexpectedly run significantly
farther up the beach than normal, including over rocks and
jetties. Rip currents are typically more frequent and stronger
in the vicinity of jetties, inlets, and piers.
Instructions: Remain out of the water to avoid hazardous swimming conditions.

---

Event: Beach Hazards Statement
Area: Coastal Del Norte; Northern Humboldt Coast; Southwestern Humboldt; Mendocino Coast
Severity: Moderate
Description: * WHAT...Increased threat of sneaker waves expected.

* WHERE...Coastal Del Norte, Northern Humboldt Coast,
Southwestern Humboldt and Mendocino Coast Counties.

* WHEN...From late tonight through late Saturday night. .

* IMPACTS...Large, unexpected waves can sweep across the beach
without warning, sweeping people into the sea from rocks,
jetties, and beaches. These sneaker waves can also move large
objects such as logs, crushing anyone caught underneath.
Instructions: Don't be fooled by an ocean that looks calm.  There can be
30 minutes of small waves before a sneaker wave strikes.  Avoid
rocks and jetties. Avoid steep beaches.  Stay much farther back
from the water and never turn your back on the ocean.

---

Event: High Surf Advisory
Area: San Luis Obispo County Beaches; Santa Barbara County Central Coast Beaches
Severity: Minor
Description: * WHAT...Large breaking waves of 8 to 12 feet with dangerous rip
currents.

* WHERE...San Luis Obispo County Beaches and Santa Barbara
County Central Coast Beaches.

* WHEN...Until 11 AM PDT Friday.

* IMPACTS...There is an increased risk for ocean drowning. Rip
currents can pull swimmers and surfers out to sea. Large
breaking waves can cause injury, wash people off beaches and
rocks, and capsize small boats near shore.
Instructions: Remain out of the water due to dangerous surf conditions, or stay
near occupied lifeguard towers. Rock jetties can be deadly in
such conditions, stay off the rocks.
weather>
</code></pre>
