I’m not going to explain what MCP is - most of you are already onboarded to the hype. Instead I’m going to talk about FastMCP, a framework that makes building Model Context Protocol (MCP) servers easy and fast.
What is MCP (quick recap)?
The Model Context Protocol lets AI models connect to external tools and data. Instead of building complex integrations from scratch, you create an MCP server that exposes your functionality in a standard way.
Why FastMCP (Python RULZZZZ)
Building MCP servers normally requires lots of boilerplate code and protocol handling. FastMCP removes this complexity with a simple decorator-based API.
How to Start
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
Create your own project:
# Generate new dir in your project
uv init example_client
cd example_client
# Create and activate virtual env
uv venv
source .venv/bin/activate
# Install the dependencies
uv add "mcp[cli]" requests
That’s the basic project structure that will host your MCP server and its APIs.
Let’s Craft the Client and the Implementation
In the following example I created a mock API that generates data - accessed via REST calls. The API returns a huge JSON representing users registered in a system.
The Client
Using FastMCP I crafted main.py, which holds the MCP server logic that invokes the client to retrieve the users registered in the given API.
The MCP Server
When calling the server with a dedicated agent, it invokes client.py and generates a response that the LLM can understand and manipulate.
Show Me the Magic
The cool part is that we can integrate Claude Desktop with this MCP. The way to do it is by simply running:
mcp install main.py --with requests
This command edits the claude_desktop_config.json file that holds the configuration for MCP servers that Claude Desktop can use (hint: it can use multiple MCPs).
The configuration is now set and the MCP is reachable from Claude Desktop.
And now the magic drill: when a user (me) asks “how many users are there in the example-client?”, Claude invokes the call and generates proper insights about the API that was just called by client.py.
The magic of MCP.
What Does This Have to Do With Testing?
The concept of MCP is wide, but let’s say an organization is building a client library for testing their product. The automation architect or lead could craft an MCP server out of these SDKs, inject it into Claude Desktop, and now a user can:
- access the system for testing
- add/remove data
- work with the product through natural language
The power of a well-designed testing system with proper architecture could be the driver for MCPs (and agents) to become unique, tailored tools for working on a system without knowing in depth which APIs are needed.
Bonus point - it can also be used with Playwright. A sweet way to demo a system based on a Page Object Model created during a testing cycle.
