|
Hi Tip-Sheeters, In Tip Sheet #22, I demonstrated creating an MCP server to connect to my Football API. This week, I'll update that demo to the latest version of FastMCP and MCP Cloud. It's another good chance to pitch you why you need an ongoing side project, which I'm calling an Anchor Project. Why You Need an Anchor Project ⚓💪I learn best by building, and I've found that a lot of other tech and data people do as well. A valuable method for me is to build real-world projects, as I wrote about on the ODSC blog: Three-Legged Side Projects: A Full Stack Data Scientist’s Secret Weapon. If you keep the project going over time, it helps you to anchor your technical learning on a substantial use case that you understand and have deep expertise in. Let's call this your Anchor Project: a long-term project you use to test and learn new technologies with a consistent use case. Your Anchor Project: a long-term project you use to test and learn new technologies with a consistent use case. Benefits of an Anchor ProjectAnchoring your learning to a consistent use case instead of using random example data has some benefits:
Finding Your AnchorTake a look at some of the side projects you've worked on already -- is there one that you really enjoyed the dataset or the use case you built? Look across your projects, is there a recurring theme in them? Lean into that in your next project: that's your anchor. FastMCP UpdateIn Tip Sheet #22, I implemented the Python quickstart from the MCP official page, and then modified it to use my SportsWorldCentral API (my anchor project). I didn't realize it at the time, but the Python code for that was built using an open-source project called FastMCP 1.0, which is maintained by Jeremiah Lowin. In my demo project, I created a FastMCP server that accessed my API, installed it on my local machine, and called the server from Claude Desktop. The repo for that project is here: https://github.com/Ryandaydev/mcp_server_demo MCP has grown a lot since March, and that has led to two big advances that affect this project:
This week, I updated the code to use FastMCP 2.0 and deployed it on FastMCP Cloud. Updating the code had a couple of simple steps:
Jumping InAll of my updated code is in the new repo here: Ryandaydev/mcp_2_demo, and the MCP server file is still named `football_server.py`. Here are the changes: I updated the imports to: `from fastmcp import FastMCP` And I added the entrypoint method at the bottom of the file: ``` if __name__ == "__main__": ``` I committed these changes, and I'm ready to deploy. Deploying to FastMCP CloudOn the FastMCP Cloud signup page, you'll be asked to setup an account with a GitHub account. The pricing page says Hobby accounts are free forever. I created a new project and pointed it to my demo repository: I pointed it to the `football/football_server.py` file and started the deployment. Here's what it looks like once it is deployed successfully: After deploying, I went to Configuration and turned off authentication because I got an error when testing. (I probably could have done this during setup?) Now I was ready to test. Claude Desktop Is a No-GoLast time I demoed this, I used Claude Desktop to run the server code locally. Now I'd like to use Claude to work with my remote-hosted server, but unfortunately, this isn't available in Claude's free version 🙁. No fear, I can test the MCP server directly in FastMCP cloud. Click Inspector, select the `get_counts` tool. Now select Execute Tool and you'll see the results of the MCP server calling my API in the right-hand pane. Closing Thoughts on FastMCPThe MCP space is moving fast, and security is an area that still needs some maturing. My demo didn't explore any authentication, because it's my public demo API. Every indication I see is that MCP is going to be the de facto method of using data with LLMs for the near term, so it's worthwhile to jump in and explore. If you have a chance to use FastMCP, let me know what you find! Keep coding, Ryan Day 👉 https://tips.handsonapibook.com/ -- no spam, just a short email every week. |
Every week or two I share tips for hands-on skills related to data science, APIs, and AI. From the author of Hands-on APIs for AI and Data Science:Python Development with FastAPI from O'Reilly Publishing
Hi Tip-Sheeters, The World Cup starts today!!! I live in Kansas City, USA and we're one of the host cities for the World Cup games this year. We're also hosting the training camps for the Netherlands, England, and Argentina so it's going to be an exciting month. If you visit the airport, you'll see we are ready for the festivities to begin! So this week I'm sharing a variety of World Cup and soccer / voetbal / fútbol / football links related to data and analytics. I'll be rooting for the red,...
Hi Tip-Sheeters, This week has an everything-old-is-new-again flavor: we're looking at building command line interfaces (CLIs) for APIs. You remember those old things: the somewhat cryptic tools you run in a linux prompt or from your Mac's terminal. Well they're having a moment in the AI and API space because they're a useful way for agents to call your APIs. And we're going to build one for the Air Travel API. Read to the end to see an LLM use the CLI in an agent harness. Back from Summer...
Hi Tip-Sheeters, This week I'm sharing highlights of virtual chat I had with Ricardo Heredia Joya, a Madrid data scientist with a background as a medical doctor. He is active in the Football analytics community, and shares his thoughts and tips in the Underdoc substack. (If you're enjoying the Tip Sheet I'm sure you'll get a lot from Ricardo's newsletter.) You are your best asset, so never stop learning. - Ricardo Heredia Joya Q1: Thanks for having a virtual chat with the Tip Sheet...