|
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. |
This is my weekly newsletter where I share some useful tips that I've learned while researching and writing the book Hands-on APIs for AI and Data Science, a #1 New Release from O'Reilly Publishing
Hi Tip-Sheeters, One of the key areas where APIs are used in machine learning is for model inference. This is where the model is made available for real-time API calls to receive predictions. This is one of the two primary modes of model inference (along with batch inference). Tip Sheet #12 listed some of the top Python libraries worth exploring. One of those was LitServe, which is a framework for hosting models with a FastAPI backend. This week, I'll demonstrate this framework using my...
Hi Tip-Sheeters, Today is Veteran's Day, and I want to start with appreciation for any service members who are reading this. The holiday was originally created to remember the armistice that ended the first World War in 1918. Peace is a blessing that we should never take for granted. Entering a Hackathon Quick and Dirty As data and IT pros, we are constantly honing our craft. One of the best ways is through taking on intense challenges or projects to drive our learning in a short period of...
Hi Tip-Sheeters, This week, I’m sharing a few of the questions that I’ve had this past year from readers, people at events, or folks who’ve reached out on LinkedIn. If you ever have a question or something I can assist with, please hit reply on the newsletter email, and I’ll be happy to share my thoughts. Let’s jump in! Q&A About Data, Tech, and Career Q: What is the new tool or framework you are learning about right now? If you’ve been keeping up with the Tip Sheet, you won’t be surprised...