Can an Agent Use It?

Can an agent build and call an MCP server with FastMCP 4.1? Yes, on the first try

Yes, on the first try: Claude Code (Sonnet 5.5, sandbox tools only) had FastMCP 4.1.4's quickstart server answering a greet call from a FastMCP client in 15 seconds, with no outside reference material in the log.

The task

Using fastmcp 4.1.4, follow the FastMCP quickstart: build the quickstart's MCP server with its greet tool, then call that tool from a FastMCP client. Call greet with the name "Ford" and print what the tool returns.

Docs: https://gofastmcp.com/getting-started/quickstart

When you're done, leave a script at /work/run.sh that runs the result end to end from a fresh shell and exits 0.

What happened

How we checked

The hidden check ran bash /work/run.sh in the box after killing everything the agent left running, and required exit 0 and Hello, Ford! in the output. Tail:

CallToolResult(content=[TextContent(type='text', text='Hello, Ford!', annotations=None, meta=None)], structured_content={'result': 'Hello, Ford!'}, meta={'fastmcp': {'wrap_result': True}, 'io.modelcontextprotocol/serverInfo': {'name': 'My MCP Server', 'version': '4.1.4'}}, data='Hello, Ford!', is_error=False)

The version probe saw 4.1.4 and fastmcp-4.1.4.dist-info in the venv. The server's own serverInfo also reports 4.1.4. On an untouched box the same check failed (exit 127, bash: /work/run.sh: No such file or directory), as it should. Method: SPEC.md.

Transcript

Long outputs are clipped below. The complete redacted logs are at https://github.com/Simbastack-hq/canagentuseit/tree/main/results/2026-10-30T0511Z-fastmcp-4-1-4 (added when this post goes live).

Transcript (attempt 1, Claude Code, claude-sonnet-5-5)

Claude Code 2.1.314, model claude-sonnet-5-5

[00:01] fetch_url

https://gofastmcp.com/getting-started/quickstart

output:

Quickstart - FastMCP

    Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
Assistant

Responses are generated using AI and may contain mistakes.

FastMCP 4 is here — built for the new MCP protocol. See what's new.

FastMCP home pagev4.0.5

Prefect Horizon
PrefectHQ/fastmcp

PrefectHQ/fastmcp

Search...

Navigation
Get Started
Quickstart

Search the docs...

⌘K

Documentation

Get Started

Welcome!

Installation

Quickstart

Coding Agents

What's New

Servers

Overview

Core Components

Working with Tools

MCP Providers

Interactivity

Extensibility

Auth

Deployment

Apps

Overview

Quickstart

FastMCPApp

Interactive Tools

Generative UI

Custom HTML

Reference

Clients

Overview

Client-Only Package

Transports

Client GroupsNEW

fastmcp-remote

OperationsUPDATED

AuthenticationUPDATED

Integrations

Auth

Web Frameworks

AI Assistants

AI SDKs

MCP.json

More

Settings

CLI

Upgrading

Development

What's New

FAQ

On this page
Back to topCreate a FastMCP Server
Add a Tool
Run the ServerUsing the FastMCP CLI

Call Your Server
Give Your Tool a UI
Deploy Your Server

Get Started
Quickstart
Copy pageCopy page

Copy pageCopy page

This guide builds a working MCP server from scratch: a tool, a way to run it, a client that calls it, and a visual UI for the result. It ends with the server deployed and reachable over the internet.
If you haven’t alrea
… (18556 more chars)

[00:06] run

mkdir -p /work && cd /work && cat > my_server.py <<'EOF'
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(transport="http", port=8000)
EOF
cat > my_client.py <<'EOF'
import asyncio
from fastmcp import Client

client = Client("http://localhost:8000/mcp")

async def call_tool(name: str):
    async with client:
        result = await client.call_tool("greet", {"name": name})
        print(result)

asyncio.run(call_tool("Ford"))
EOF
cat > run.sh <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
[ -d .venv ] || uv venv -q .venv
uv pip install -q --python .venv/bin/python "fastmcp==4.1.4"
.venv/bin/python my_server.py >server.log 2>&1 &
SERVER=$!
trap 'kill $SERVER 2>/dev/null || true' EXIT
for _ in $(seq 60); do
  (echo >/dev/tcp/127.0.0.1/8000) 2>/dev/null && break
  sleep 0.5
done
.venv/bin/python my_client.py
EOF
chmod +x run.sh && env -i HOME=$HOME PATH=$PATH bash -lc ./run.sh; echo exit=$?

output:

CallToolResult(content=[TextContent(type='text', text='Hello, Ford!', annotations=None, meta=None)], structured_content={'result': 'Hello, Ford!'}, meta={'fastmcp': {'wrap_result': True}, 'io.modelcontextprotocol/serverInfo': {'name': 'My MCP Server', 'version': '4.1.4'}}, data='Hello, Ford!', is_error=False)
exit=0

[exit code 0]

[00:13] Agent: I built the quickstart server with its greet tool and called it from a FastMCP client with the name "Ford". /work/run.sh ran from a clean shell and exited 0.

The tool returned Hello, Ford!. The client prints the whole result object, as the quickstart does, so the output looks like this:

CallToolResult(content=[TextContent(type='text', text='Hello, Ford!', ...)], structured_content={'result': 'Hello, Ford!'}, ..., data='Hello, Ford!', is_error=False)

The files are all in /work:

I skipped the quickstart's optional "Give Your Tool a UI" and deploy sections, since you only asked for the server and the client call.

[00:13] Stopped: done, 3 turns, $0.06645809999999999


Written by an agent from the run log. Verdicts are about this agent, this version, on this date. Spot an error? Request a correction.

Reviewed by a human on 2026-10-30 before publishing.

#works#sdk#Prefect