1. Podcasts
  2. Talk Python To Me
  3. #569: Connecting Agents to Data via MCP, CLI, and More
Talk Python To Me

16 Nov 2026 · 1h 3m · 28 chapters

Episode artwork

#569: Connecting Agents to Data via MCP, CLI, and More

In short

How to connect AI agents to external data/services using MCP (Model Context Protocol) versus CLIs versus direct APIs, including when MCP is unnecessary or harmful; also practical guidance on MCP tool design, safety, and reliability.

Guest backgrounds

Pamela Fox is a principal cloud advocate at Microsoft/GitHub, focused on developer tooling and Python. She has taught MCP workshops across PyCon and other developer communities, and runs an agent that weekly compiles a news roundup by reading her Gmail, Outlook, and X history.

Key claims

MCP is a standard for agent tool discovery and calling (via JSON-RPC handshake, tool listing, and tool calls). MCP enables “mashups” by combining multiple servers, but for deterministic/repetitive tasks a CLI or direct SDK can be better. MCP servers can be optimized (caching/indexes) so they don’t necessarily slow your app. Safety improves when you restrict tool access (read-only, tool sets) and design skills carefully to avoid over-constraining agents.

Notable examples

GitHub CLI vs GitHub MCP server on a real bug (CLI used fewer tokens and succeeded more often). Using Playwright MCP for browser automation, but scripting LinkedIn connection triage with Python Playwright + LLM structured JSON decisions instead. Using Sentry MCP data to triage and fix a backlog of errors. Updating hundreds of YouTube videos via an MCP-restricted Python library driven by an RSS-triggered agent. Etsy blocked automated shopping; DoorDash and Shopify adding MCP-style integrations to enable bulk ordering.

Written by AI. May contain mistakes.

Chapters

0:42

Meet Pamela Fox and Her Background

Pamela shares her experience with MCP and Python advocacy.

“Welcome to TalkPython to Me, the number one Python podcast for developers and data scientists.”
3:06

The Current State of Python Advocacy

Discussion on the relevance of Python in the age of coding agents.

“It It is long past time I had you on the show.”
3:54

Evolution of Programming Languages and Tools

Exploring how programming language importance is shifting.

“That was really fun about TalkPython in production.”
5:00

Diving into MCP Protocol

Pamela explains the MCP protocol and its significance for AI applications.

“So I'm glad I, on that note with, you know, PyBay, I currently think it's great that we still have these Python specific conferences.”
9:21

How MCP Works: A Technical Overview

In-depth look at how MCP functions and its communication methods.

“I think, as I said, I kind of want to structure this around MCP because that's maybe the most obvious choice.”
14:00

Understanding MCP Server Communication

Learn about how MCP servers communicate using remote procedure calls and JSON.

“And so that sends, you know, basically like a remote procedure call like to the, you know, to that MSP server and the server processes it and responds back with, you know, JSON or, you know, however it wants to respond.”
15:00

The Power of MCP for Agent Integration

Explore how MCP servers can connect agents to various data sources for enhanced functionality.

“Yeah, I'm seeing now a lot of conferences.”
17:07

Creating Mashups with MCP Servers

Discover how MCP enables the creation of mashups using data from different services.

“Yeah, for all the trouble that AI is causing, disruption, I guess.”
19:04

Essential MCP Servers for Developers

Get insights into various MCP servers that developers frequently use for productivity.

“This is this could be a problem if I learn about this.”
21:02

Using MCP for Error Management

Learn how MCP servers can help manage and fix application errors efficiently.

“And they shared some chart where they're like MCP usage is just, you know, shot, shot way up.”
Show all 28 chapters
23:17

The Future of AI and Financial Planning

Understand the role of MCP servers in enhancing financial planning tools and AI interactions.

“But now we can parallelize a bit more and you get the help of being able to sort through logs.”
25:55

MCP Servers and User Experience

Discuss the implications of MCP servers on user experience in app interactions.

“I know a lot of people when they think about AI and their website or their app, they're like, here's a thing that is swamping my app.”
28:00

The Impact of MSP Servers on User Experience

Learn how MSP servers can improve or hinder user interactions on platforms like DoorDash.

“they can make a worse experience, right?”
29:10

Workshops and MCP Server Insights

Discover the experience of giving workshops on MCP servers and their applications.

“I guess the thing that threatens the most is advertising, right?”
30:35

Understanding MCP Server Features

Explore the features of MCP servers and their evolving specifications, including recent updates.

“So really nice way of just testing out your MCP servers with all the different features and sending requests back and forth and being able to see your OAuth flow and see it succeed.”
32:58

Practical Applications of MCP with Playwright

Learn how to automate LinkedIn requests using MCP servers with Playwright for efficiency.

“Because there's always this debate about MCP versus CLI.”
35:22

When to Use MCP Servers vs. Scripting

Understand the circumstances under which to use MCP servers versus traditional scripting methods.

“And they're all great people, but I find it really boring to accept, accept.”
38:01

Creating Custom MCP Servers for Specific Tasks

Learn how to build custom MCP servers with restricted access for specific tasks.

“and or shouldn't decide what it's going to do next, then an MSP server makes sense.”
40:41

Safety and Control with MCP Servers

Examine the importance of safety protocols and controlled access when using MCP servers.

“to make our own tools that have a more restricted surface.”
42:00

Enhancing Agent Capabilities with Tool Filtering

Learn how to optimize agent interactions with MCP servers by filtering tools for safety and efficiency.

“Many of these tools, like with MCP servers, a lot of them will have a bunch of tools and you could decide to give your agent access to just some of them and not others.”
45:30

The Evolution of Agent Skills and CLIs

Discover how agent skills have evolved and how CLIs can enhance agent functionality.

“That's the big thing I've seen with agent skills lately is a skill.”
47:40

The Debate: MCP vs. CLI for Agents

Explore the effectiveness of using MCP servers versus CLI tools for agents and the implications on success rates.

“I think having CLIs used to be something that was just cool.”
51:00

Optimizing Developer Experiences for Agents

Understand the importance of optimizing tools for both agents and humans, focusing on documentation and usability.

“But now they're like, well, what's the point?”
55:00

Unexpected Agent Intelligence

Witness how agents can autonomously retrieve and utilize information from unexpected sources.

“optimizing our developer experiences for?”
55:30

The Future of Agents in Data Handling

Delve into the potential of agents to improve data handling and search capabilities, reducing information loss.

“I unknowingly was logged into the GitHub CLI.”
56:00

Exploring the Role of Agents in Information Accessibility

Learn how agents improve data accessibility and search efficiency.

“That actually reminds me of when I was prepping for today's podcast.”
58:01

CLI and MCP: Coexistence and Functionality

Discover how CLIs and MCPs can work together seamlessly.

“absolutely so final thought on um clis they don't have to necessarily be either or i ended up writing a TalkPython podcast and courses CLI, which is kind of weird.”
59:18

Getting Started with Python MCP SDK

Understand how to use Python MCP SDK and Fast MCP for development.

“I mean, let's close it out with some final thoughts.”
A man walking through an airport, asking his phone a question

Ask about this episode

Get the gist, explore an idea or ask about something said.

Claude

On Talk Python To Me, what are the key points of this episode?

Searching your listening

Transcript

Automatic transcript. May contain errors.

0:00Pamela Fox: Should your agent call an MCP server or just run a CLI? Pamela Fox joins us to share how she thinks about connecting AIs and her data. She's taught MCP workshops from PyCon to VR developers, and every week an agent combs her Gmail, Outlook, and X history to build her news roundup. She uses MCP all day, yet there are still times when you should skip it. You'll hear how her colleague pitted the GitHub CLI against the GitHub MCP server on a real bug. The CLI used fewer tokens. It succeeded more often. So do we choose CLIs, MCPs, or even just APIs for connecting our agents to our data and services?

0:40Pamela Fox: Let's find out. This is Talk Python to Me, episode 569, recorded October 15th, 2026.

1:04Pamela Fox: Welcome to TalkPython to Me, the number one Python podcast for developers and data scientists. This is your host, Michael Kennedy. I'm a PSF fellow who's been coding for over 25 years. Let's connect on social media. You'll find me and TalkPython on Mastodon, BlueSky, and X. The social links are all in your show notes. You can find over 10 years of past episodes at TalkPython.fm. And if you want to be part of the show, you can join our recording live streams. That's right. We live stream the raw uncut version of each episode on YouTube. Just visit TalkPython.fm slash YouTube to see the schedule of upcoming events.

1:39Pamela Fox: Be sure to subscribe there and press the bell so you'll get notified anytime we're recording. Before we dive into the show, I want to tell you about an upcoming members meetup here at TalkPython. the title, SQLite might actually be all you need. This talk dives into running SQLite in production and why, surprisingly, it might be one of the best production databases you can choose. Here's something I haven't really talked about yet. TalkPython doesn't run on MongoDB anymore. After years on Mongo, I've moved almost all of our sites to SQLite, the database that you might file under find for prototypes and phone apps.

2:16Pamela Fox: I knew an in-process database would have some speed advantages, but what I didn't expect is that it's 40 to 300 times faster on our data. Now looking up a guest takes 1.5 microseconds. That's one one thousandth of a millisecond or over 600 ,000 calls a second from plain Python. And a write, well, that's one one hundredth of a millisecond. But then there's that question that scares people off. What happens when the server dies? This is where the surprises live. So I hope you join me for the members tech meetup. It's on December 2nd at 10 a.m. U.S. Pacific time. Find all the details at TalkPython.

2:55Pamela Fox: Just click membership and go to the tech talks. Add it to your calendar right there. I hope to see you at the meetup and share some SQLite surprises with you. Pamela, welcome to TalkPython to me. It It is long past time I had you on the show. Really glad you're here.

3:10Michael Kennedy: Awesome. It's so fun to be here.

3:11Pamela Fox: We're going to talk about some of the craziness of 2026 and choices. Should we MCP to MCP or not? Was that the Shakespeare question? I think that was it. Yeah, exactly. Or the CLI or APIs. Or basically, I've got some data and services, and I want to connect them to my code, to my agents. How do we do that, right? I know you've written a whole lot about this and people should absolutely check out your blog, but especially conference talks. You're an awesome technologist and I really loved all of your presentations, you know, including the one just at PyBay where we were. How was PyBay? What do you think?

3:48Michael Kennedy: I thought PyBay was really fun. I love the Python conferences, getting to meet the local community. And you had a great talk at it as well.

3:58Pamela Fox: Oh, yeah. Thanks. That was really fun about TalkPython in production. That will come out eventually. I'm sure the videos of those will come out. They were recorded, so they wouldn't record them for no reason. Yes. So really, really cool. Now, before we dive in, as per usual, just give people a quick background on you.

4:13Michael Kennedy: Yeah, sure. So I am Pamela Fox. I am currently at Microsoft and or GitHub, whichever company you prefer more. And I am a principal cloud advocate. So that means that generally, like I'm using all of our developer tools and showing developers how to use them. I tend to focus on Python. We had like an official Python advocacy team for four years and we don't anymore, which is sad. And that's kind of part of the change due to coding agents where like languages are not as much of a thing anymore because the coding agents can just code and whatever. And all that matters is the output. it. So now, you know, there's, I guess there's just this big question as to how, how much does your language even matter anymore?

5:01Michael Kennedy: So I'm glad I, on that note with, you know, PyBay, I currently think it's great that we still have these Python specific conferences. It will be interesting to see how long language is the theme that holds together a community.

5:15Pamela Fox: What an interesting idea. I've been thinking about this a lot too. And I, right. I was, before we go down this AI thing, When you were talking about not specifically having a Python team, one of the thoughts I had, well, like Python is just so popular, just it's expected. It's not this niche thing where we brought in a few people that know this weird no curly braces language. You know what I mean? But like just the advocates know about Python. And so maybe you don't need a specific Python team.

5:41Michael Kennedy: Yeah, I guess two things happen. One is that more and more the advocates from the other language teams found themselves using Python because you almost have to now because that's like, it became the default language for new SDKs, right? When I first joined Marksoft, it was the opposite, right? Where we had to like kind of beg for a Python SDK. And then people had to beg for like SDKs in C Sharp, which is a crazy thing for Marksoft because Marksoft is like a huge, you know, C Sharp user.

6:07Pamela Fox: Like they may have created the language.

6:09Michael Kennedy: Right, that thing. Yes, yes, that's true. So yeah, so I think part of it is that just basically all advocates, you know, they're, you know, we're all there, everyone's using Python now, all using javascript now everyone's using every you know because it's just so easy to add on you know a react front end i saw a talk from my dad the other day he's a computer scientist and on his slide he had like react front and i was like what dad you're doing react like what has happened right that's only due to coding agents i guarantee it because that's incredible way that my dad would be just like suddenly like well i'm like seven years old i think it's time that i learned react right?

6:47Pamela Fox: Exactly. It's like, Pamela, what are you using Node for? We all use Bun now. Come on. What? Who are you?

6:54Michael Kennedy: Yeah. I need to call them up so we can talk JavaScript now.

6:57Pamela Fox: Funny. Yeah, you're right. And I honestly don't even know if I want to talk about it because it makes me a little bit sad, but I do think that there is also something to the second half of the reason that you gave, and that's we don't necessarily have to read the code. Should we read the code? I don't know. I'm very conflicted. I actually was thinking today about building a little GUI application, plug into an LLM, maybe an MCP, who knows, that would basically go to a code base and go, from this Git commit to that one, I need a tour of what has happened. Will you explain this to me? Because Git history is not, there's a thousand changed files.

7:33Pamela Fox: What is significant? What do I, you know what I mean? Something like that would be cool.

7:36Michael Kennedy: Yeah. We care more about the high level changes and also just how they're being verified. So I I think like in terms of Python, you know, what I am most interested in is, you know, the verifiability. We do have great testing frameworks in Python. So I think we can continue, you know, talking about those testing frameworks, like how you could encourage your agents to use PlayWrite and use PyTest and use hypothesis and schema thesis and all of that stuff. And, you know, at least guide it to using like an async fast API, you know, versus a sync framework. but the specifics of Python, you know, not as useful.

8:15Michael Kennedy: Like I was reading the Python 3.15 release notes and I was like, oh, all of this is great. I'm glad, I know, I'm glad they added this but, you know, it doesn't really, none of this matters until the LLMs know it.

8:26Pamela Fox: I see, yeah.

8:27Michael Kennedy: Until they've been pointed at the release notes and, you know, until I'm like using 3.15, like, you know, in production.

8:32Pamela Fox: We're going to see what the world brings but it is trending this way and it is weird. I don't think that means that people without programming skills are not needed or don't have value. I think there's tons. It's just not in the structure level. It's like, okay, we need this kind of design pattern. We need this kind of storage. What are we going to do about, you know, durability if this data center goes down and we got our data there? That kind of questions, yeah?

8:55Michael Kennedy: Yeah, and that's all things we've learned. You know, syntax was just one way that we expressed our programming knowledge. Now, you know, we're really going to express the architecture side of it because that's where, you know, we still need to think a lot about how we're going to architecture things, what the protocols are that we're going to use in order to interface across systems, which that's like a good lead in for today's topic because, you know, that I think the protocols are increasingly the important part.

9:20Pamela Fox: All right. Well, let's go ahead and dive into it. I think, as I said, I kind of want to structure this around MCP because that's maybe the most obvious choice. somebody says, I want to connect this thing to my AI. Well, MCP, obviously, right? However, there's a lot of options, as we'll see, and there's times you do and don't use MCPs, but let's start with that story. So I had a Den Belamarsky on the show a while ago to talk about MCP protocol, but honestly, it's like a year ago and in AI world, you know, how crazy, how long ago was that? So maybe we should just start from the beginning. You know, what is an MCP?

9:58Pamela Fox: What is MCP and what is an MCP server? Like, why do we care about this stuff?

10:01Michael Kennedy: Right. So MCP is, you know, it's the standard for helping AI applications to discover context. Or, you know, here it says to connect to external systems. You know, we basically wanted a standard way where we could extend our agents with access to additional tools. Right. So it's extensibility story for agents. And it's a standard. And it's like the cool thing is it's like the first standard that everybody jumped on board with. Right. It is so hard to get all these companies to agree right now. And they're like fighting on Twitter. It's like, come on, can't we all get along? And finally, with MSP, you know, we can all get along.

10:39Michael Kennedy: So this is, you know, originally came from Anthropic with Claude. But now there's great support in ChatGVT. You know, at Microsoft, we've got GitHub Copilot and VS Code. but there's also like consumer facing tools that have support for it. My business friends talk to me about MCP. That's how I know. Really? Okay. Yeah, I know. Their messaging made me like, oh, I just pitched this, you know, like actually using MCP. So, yeah, because it's a standard that works across agents and agents are both developer facing and user agent. In the last few weeks, we've had GrokBot and Muse, and there's so many new ones that pop out every week.

11:22Michael Kennedy: And a lot of those are connecting behind the scenes using MCP. They don't always call it MCP. Chachapi calls it plugins, right? Like on their opening iDev Day, they talked about Chachapi plugins. Behind the scenes, those are very much based off the MCP standard, right? So, you know, you're not always going to see MCP prominently displayed in the UI for these user-facing agents.

11:47Pamela Fox: Yeah, I think if I go to Claude and I try to connect to it, it tells me what you need to do is add a connection, not an MCP server, right? I'm like, this is where the MCP goes? You know what I mean?

11:58Michael Kennedy: Yeah, yeah. So I think there they call it like connectors or connections. I'd be happy if they all call them MCP. But a lot of times they do wrap some additional things on top. Like ChatGPT, they wrap plugins in some additional metadata that helps them like plug into the UI certain ways. So, you know, I think that's why they're calling it, you know, they're coming up with their own name for it just so they can add additional things on it.

12:23Pamela Fox: Yeah, that makes a lot of sense. And I guess it's like an API, right?

12:28Michael Kennedy: Right. Okay. So here's how it actually, like, I'll just tell you the actual, I mean, this is a developer, right? Exactly.

12:33Pamela Fox: Let's go.

12:33Michael Kennedy: What actually happens is first there's a handshake, right? So you register an MCP server and a lot of times your server is what's called an HTTP server. So there'll be actually like a URL for it. So it's like, you know, hppcoolserver.com slash MCP. And then the agent will connect to that server. So it'll send a handshake to that server. And during that handshake, it's going to ask the server what tools it has. Because tools are like the, there's other things that servers can expose, but tools are like the really, really important thing. Um, so it'll say, uh, tools slash list. So it sends this is a JSON RPC.

13:09Michael Kennedy: So it sends this JSON RPC, uh, you know, HP requests to the server, say, Hey, what tools do you have? Um, and any other sort of discoverability it wants to do at that point, um, MCP servers will support skills soon as well. That's exciting. Um, so it could discover those too. So it discovers the tools, the tools will come back. And once it has the tools, now the agent can populate its tools list with all the list of tools. And then it can decide to send those tool names to the LLM every time it's processing a user request. And if the LLM, the user request and says, oh, I've got a great tool for that, like book hotel, right?

13:44Michael Kennedy: Maybe that's a tool and they want to book hotels. Then it's going to send a request to the MSP server that says it's like tools slash calls. And then it sends in the arguments and says, OK, hotel in city, San Francisco, start date, October 15th, end date, October 17th. And so that sends, you know, basically like a remote procedure call like to the, you know, to that MSP server and the server processes it and responds back with, you know, JSON or, you know, however it wants to respond.

14:12Pamela Fox: Yeah, it's a little bit like a HTTP endpoint, but it's a little bit where the tools are the individual functions that you might or the endpoints you might call with an API client. But there's kind of a negotiation as well. Like, Do you support streaming? What version of MCP are you? So it's a little bit more high level than the HTTP APIs, right? Like maybe GraphQL or one of those types of something built on top of it, right? But it's still very approachable for Python people.

14:42Michael Kennedy: It's more opinionated because it's saying like, you know, it's saying this is specifically for agents. Agents want to know about tools. That's what they need. And they also want to know about, you know, in the future about skills, right? but you know it's using mechanisms that we understand behind the scenes like json rpc

15:00Pamela Fox: nice yeah i just last year i can't remember exactly when it was i built a mcp server for the podcast so you couldn't ask it like uh what did talk python cover on this and who said you instead of having to go and do a full search of all the pages of the website the thing could just connect and run you know database index backed super fast queries right so it gets really quick like answer and eight answers.

15:23Michael Kennedy: Yeah, I'm seeing now a lot of conferences. Well, not maybe a lot, but the nerdiest conferences will actually have MCP servers to interact with their data, right? So AI engineer did that and that was really fun.

15:34Pamela Fox: That's awesome. For like example, for the talks schedule and stuff like, hey, I'm interested in this. What talk should I go see next? Right. That kind of question would be awesome to answer right away.

15:45Michael Kennedy: Yeah, and then, so here's what's nice about MCP is that then you can connect multiple MCP servers to your agent, right? So example, you could connect the, you know, like the AI engineer MCP server for that conference. And you could also connect like the Google Calendar, like, you know, or in my case, I use the Microsoft WorkIQ MCP server for access to my Outlook. And so then in theory, you could be like, hey, which of these talks am I even like available to attend? Could you also just like put it on my calendar? right uh so this is what excites me about mcp is that mcp enables like us to make mashups really easily right like you know i don't know how people know the term mashups but back with like web 2.0 i love it yeah it was like 2006 like we you know we had this huge boom of the htgp web 2.0 apis that were very you know fun to use like the flicker api and google maps and all that stuff and I was making like hundreds of mashups.

16:44Michael Kennedy: I was absolutely addicted. But it was so fun. But like I was able to do that because I was, you know, I was a coder. Now the difference is, you know, obviously, yes, as coders, we can make these mashups, but we can enable anyone to make these mashups, right? Like we're putting the power of this, you know, this programmatic combinatorial power. We're giving it to everyone now.

17:07Pamela Fox: Yeah, for all the trouble that AI is causing, disruption, I guess. in our industry and others, you know, I do think there's something very special about being able to give people this power to speak in regular English or whatever language you speak to a computer. And it's almost like programming. Yeah. It's very neat.

17:25Michael Kennedy: Yeah. I mean, I think that's also just generally true, not just with MCP, but, you know, I gave a talk last week to CS teachers talking about, you know, the stack of programming languages. And we went up from, you know, assembly, machine, assembly, you know, C++, higher level like Python. And now, you know, we're at natural human language, right? Like we have lowered the barrier so that anyone spoken language can basically code something. Right. So, yeah.

17:51Pamela Fox: Yeah. My daughter just discovered Codex and she wanted to build a website. And after a few hours, she goes, dad, is it okay if I stay up all night? I can't put this down. Like you're going to run out of credits before you stay up all night, but don't do that. But that's kind of how the excitement is, you know?

18:06Michael Kennedy: That reminds me of discovering the web, like in like sixth grade, I definitely stayed up The first time you discover that you can make a web app or a piece of software, it's a long night.

18:17Pamela Fox: It's an amazing night. But the next day, oh, boy, what have I done? What have I done? So make this a little bit concrete. Give us some specific MCP servers that you use. And I'll share a couple of mine as well, but I'm going to let you go first on this.

18:30Michael Kennedy: Yeah. So the ones that I use the most often, there's the Twitter X MCP server. So I have that installed and that, you know, can search through all the tweets, especially the tweets I've liked and bookmarked because I use that basically as like research. Right. Because I obviously I'm using Twitter purely for educational purposes and, you know, not just for procrastinating. So every week it actually like goes through and, you know, looks at stuff. And it also is like helps me like manage bookmarks. Right. So I can put all my bookmarks in one place. So, yeah, there's the XMCP server.

19:02Pamela Fox: I didn't know this existed. This is this could be a problem if I learn about this.

19:06Michael Kennedy: yeah uh yeah yeah i they've been improving it over time you still there's still a fair bit of setup for it it's not the most you know most user-friendly um but uh you know it's it's working decently well uh let's say i also have the um a gmail mcp server which is not quite an official one but it's working well enough for now we're still waiting for it i think they're about to come up with this like google workspace mcp server so i'm excited for that oh that is exciting yeah yeah i basically my friend like vibed a in unofficial this is the thing is you can make your own mcp servers that wrap things if you need it so right now i'm using like an unofficial vibe gmail mcp server um i use the work iq mcp server that gives me access to my work uh microsoft stuff like teams outlook uh uh that sort of thing calendar um and yeah and then i have some documentation servers like we have a documentation server just for microsoft learn and that's where all of our documentation is.

20:01Michael Kennedy: So I'm not even using that many MCP servers, but the ones I am using are just absolutely essential, right? So like every week I hold an office hours where we talk about what's going on in generative AI. And I have a skill for that, an agent skill that specifically uses all those MCP servers to go to research. So it goes and looks through my Gmail, it looks through my Outlook, it looks through my Twitter history and says, okay, these are everything that's happened in the last seven days, right? And it can, you know, it can just do that every Tuesday at 9 a.m., automatically run, and then boom, got my news roundup.

20:37Michael Kennedy: And, you know, it's based off the last week of what I have been engaging with myself personally, right?

20:43Pamela Fox: Yeah. And for your role, it's really important to kind of stay on top of the news and what's happening in tech and all that, right? So being able to ask that as a question.

20:51Michael Kennedy: Right. Yeah, that's true. Like for every role, there's different MCP servers that are really shy. Like for other people there, you know, like the linear MCP server, they've had a huge, I think they get more traffic from MCP than via like their UI now or something. And they shared some chart where they're like MCP usage is just, you know, shot, shot way up. Right. And that makes a ton of sense. Right. Like if you're tracking all your issues in linear, you know, then you're going to have a lot of use. I also obviously use, I'm sorry, I didn't even think about the GitHub MCP server because it's like built in gopilot.

21:22Michael Kennedy: but you know that you know because my issues are stored in github uh there's azure devops that i'll use sometimes if i'm working on a project that is there so depending on what your role is you know what your job is you know there's going to be different mcp servers that are going to like really enhance your productivity and other ones that you just don't need yeah very cool so for me

21:40Pamela Fox: i've been i make a lot of use of the talk python one because it lets me ask questions like have we talked about this before what have we covered is it going to be just a repeat or you know that kind the stuff really nicely. One, I just to give a, like a bit of a, an outside of the box angle is I found this place. Um, no, so all right. First, so also century MCP, century MCP is awesome because I've century plugged into all my apps and I love it for my web apps, but I'm a good web developer. I can do this, but you know what? I'm not a good developer of mobile apps. I'm barely hanging onto the edge to keep my mobile app going because I didn't write it.

22:16Pamela Fox: I don't know it's just like, but okay, sort of. And I had Sentry connected to it for years and it just built up this huge backlog of errors. And I'm like, you know what? I'm tired of these errors. I think one week and I said, I bet Claude and I, given all that Sentry data with all the errors, I bet we can go fix almost all of them. And so I just connected the MCP server and I opened up VS Code with Flutter and I said, all right, Claude, I want you to look here. We're going to go there one at a time until these are gone. And it took three or four days, but I completely refreshed the app with all the details from the MCP server.

22:49Pamela Fox: And I would just say, okay, what's next? Yeah, go ahead and close that one. Let's make a GitHub issue for that. You know what I mean? And just, I kind of was just guiding it. And it completely, I think this is an amazing thing. These error-based systems that catch all the errors. And you can just say, go to the Claude Codex, go, there's an error in Sentry. Fix it. You know what I mean? That's all it needs.

23:08Michael Kennedy: Yeah, that's amazing. I can remember using Sentry at Khan Academy and having those errors just build up over time. And you're like, one day, one day I'm going to fix them. But it is so hard to prioritize bugs when you're always like features. But now we can parallelize a bit more and you get the help of being able to sort through logs. At this point, I'm never going to look through an error traceback myself, especially with Python async. Man, Python async tangent. But Python async errors, the tracebacks are so hard to parse through, right? So these days, I'm just always going to paste a traceback into an agent and be like, okay, what's the actual error here, right?

23:44Pamela Fox: Yeah, this is wrong. There's something wrong. I know this is wrong. We're fixing this, right? And then another one that I think we'll see if you would see this coming. So there's this place. So I was thinking about like retirement planning, right? Eventually I'm going to retire someday. And I'm like, I ran across this place called Bolden. It's not an advertisement. Just thought it was interesting. And it says it's the DIY retirement. Like you can run any what if on their AI, if you put your sort of financial situation into it, you can ask, like, if I put more in 401k now, will that save, you know, like, what's this going to have an effect on, right?

24:19Pamela Fox: And if the market does this, what would that do? You know, like, these kind of things. And I asked it a question, and I was like, I'll try this AI thing. So I asked it a question, it came back like that with an answer. I'm like, oh, no, I don't trust this at all. This should have taken a little bit of thinking. This is like a haiku model at best. You know what I mean? There's no way there's a good AI here. So I complained to them and the developer wrote back and said, well, what if we build an MCP server? I said, yes. And then a few weeks later, like here's the MCP server. So I connected it to Claude on like Fable or Opus or something.

24:48Pamela Fox: And then I'm like, okay, now I can ask questions I trust the answers to.

24:52Michael Kennedy: Yeah, that's a good point. Cause when you, right, that's a good point. Cause a lot of these applications have, you know, this has like an agent, you can see it on this, the front webpage, it says like AI planner assistant, but that, you know, they need to optimized for cost. So they're not necessarily going to use the most expensive model there. They may not have access to the best model. You, you might, for whatever reason, you've got Fable. I don't even have Fable, but I've got Opus 5.5, which is my new bestie, right? I love 5.5.

25:17Pamela Fox: Yeah, I love Opus 5.5. It's so good.

25:19Michael Kennedy: So I can 0.55 and, you know, and I can, you know, trust that. And, you know, we should be using the Epsp server for the data. There are some Epsp servers that do also basically wrap an agent. I don't love that as a design choice, but it is certainly a choice that some MSP servers are using. But yeah, I'd rather that they focus on returning the data and leave the agentic processing to people's agents.

25:47Pamela Fox: Right. Your job is to get the data to the smart agent that I'm running, not do your own thing on top of it. Exactly. I want to throw one more thing out there really quick and maybe you can give us your thoughts if you have any. I know a lot of people when they think about AI and their website or their app, they're like, here's a thing that is swamping my app. It's making it slow. It's overwhelming the bandwidth. And I hate it. So MCP probably just makes this worse. I don't think that's true. I think that a lot of people might have this sort of thought process, right? Like it's just going to mean it's going to talk to my site more and so on.

26:19Pamela Fox: But when you build these MCP tools, as you pointed out, you build the tools. Those are basically function calls on your code. And you can do whatever you want there. You can use caching. You can use database indexes. You can make them incredibly fast. So instead of having an AI crawl all over your stuff, it can just go right to an optimized spot and go, this is what I'm actually looking for. All right, here's a super fast response. Harkening back to the PyCon, PyBay talk. Pulled up my logs in the last couple of MCP calls on my site were like two millisecond response time. That doesn't hurt my site.

26:51Pamela Fox: I don't care. They can ask questions like that. This is the way to, I think, lessen the work on your server and your app, not increase it.

26:58Michael Kennedy: Yeah, that's really cool. I think at this point, we should assume that people are going to use agents to try to automate interaction with the websites they're using, right? So for example, I was trying to programmatically browse Etsy the other day to help with my costume shopping because I wanted to be Link from Zelda and I needed to put together lots of different parts. and I actually have never played Zelda so I was like assuming the coding agent knows more about Link than I do you know because it's in the weights it's not in my weights right but I was immediately blocked from Etsy and Etsy does not have like a shopping MCP server so if they'd had an MCP server then I would have bought a lot more on Etsy

27:42Pamela Fox: yeah isn't that surprising they're like no we're gonna it's gonna block it these are terrible like I was trying to buy five different things for an outfit You wouldn't let me, basically.

27:49Michael Kennedy: Right, because if you, yeah. So it certainly does depend on what people, because on the flip side, when people use MCP servers to automate interaction with a social media network or a website where people are posting text, they can make a worse experience, right? We see this on Twitter right now with all the reply bots. It's a horrible experience. Like everything you tweet, you get back this reply that's very well written and says it's not X, but Y, and you're like, oh, why? Why did you, you know, like fill my brain with something that I should never have to read because, you know, there's no human out there that wrote it, right?

28:26Michael Kennedy: So, you know, there's some design that goes into this, but there's definitely many services where if you build an MSP server, you are enabling people to use your app in more ways, right? So especially for shopping, right? So DoorDash, they did add an MSP server and that makes so much sense, right? For people who's doing, you know, maybe they use DoorDash to cater to their office every single day. By having an MCP server, DoorDash is making it that much easier to do bulk orders on DoorDash, right? So if you are a shopping website, I think Shopify just announced like an MCP sort of integration. So if you are a shopping website, it makes so much sense to have an MCP server, right?

29:04Michael Kennedy: Because you want that sweet, sweet consumerism, right?

29:07Pamela Fox: Exactly. Let them come purchase. Let their agents come. They'll put their credit card in.

29:11Michael Kennedy: I guess the thing that threatens the most is advertising, right? And that's always what's been threatened by, you know, ad block and programmatic scraping and all that stuff. So we'll have to figure that out.

29:20Pamela Fox: Yeah, that is a different, I think that is an absolutely significant area. And it's totally different, though, than like Etsy letting you buy or not buy. You gave a talk exploring MCP servers with GitHub Copilot. Was this last year? When was this?

29:33Michael Kennedy: This particular one was quite recent. But basically, like, I keep doing these workshops to show people MCP. The first one I gave was at PyCon. So that was, you know, PyCon down in Long Beach. and that was, you know, like a three-hour workshop. And so I've just been giving variants on this workshop for the last, whatever, seven months.

29:50Pamela Fox: I think this might've been Pi AI. Is that right? I can't remember.

29:54Michael Kennedy: Maybe not. No, no, no.

29:55Pamela Fox: That was your one where you made an MCP server pick your outfit. That was a different deal.

30:00Michael Kennedy: Yeah. You know, I just talk about MCP everywhere. So this was at We Are Developers in San Jose a few weeks ago.

30:05Pamela Fox: Gotcha. Okay. The reason is I want to talk about just like support for MCP servers across some of your common things, like Copilot, Codex, Code, VS Code, et cetera. It's like a can I use, but can I use.ai instead of onerror.com, whatever it is. I don't even think, please don't go there. I don't know what's there.

30:23Michael Kennedy: No, the actual website is can I use.dev. I told them they should get canimcp.com because I thought that would flow better. But this is from, so the people who made this is MCP Jam. It's this really nice, basically like think of it as Postman, but for MCP servers, right? So really nice way of just testing out your MCP servers with all the different features and sending requests back and forth and being able to see your OAuth flow and see it succeed. So they decided to make this caniuse.dev, and it's supposed to be like caniuse.com, but for MSP servers, because people are always asking like, hey, this new MSP feature, is it supporting these clients?

30:58Michael Kennedy: Because this MSP spec is evolving all the time. They did the most recent big drop was July 28th, continually adding more stuff to it over time. But the problem is many clients don't necessarily immediately add support for these features. So as somebody, if you're building a server, you know, you might be really excited about a new feature, but you want to check and see like, hey, you know, what is the support like that, you know, for this feature across the clients? What is the user experience going to be like?

31:26Pamela Fox: Yeah. And just does it support it at all? You know, I know for a while like ChatGPT, Codex supported by I think ChatGPT wouldn't take MCP or something like that. Why I want you to accept it. You're the most popular thing. You know what I mean? I think MCP came out of Anthropic. I can't remember exactly. But actually Codex has more support than LogCode, for example. So this is kind of a can I use for all the different features.

31:50Michael Kennedy: Yeah, and I actually, relevant to this audience, I just asked them if they will add columns for Python agent frameworks, right? Because, for example, Skills over MCP, that just got approved like a month ago. Like the spec for it got approved in Merge. So now they're, you know, making it official. And if you look for skills on can I use.dev right now, you'll see none of the current clients support it. But it is supported in a lot of the agent framework. So if you use like we've got like Microsoft agent framework, I happen to just know that that one supports it. But I bet you Pydantic AI does, too, because they're always quick to pick these things up.

32:26Michael Kennedy: Right. So I did ask them to add columns for the agent framework. So hopefully in the near future, you'll see like, you know, does Pydantic AI, LinkChain, right? You know, which of your favorite Python agent framework support it? Because that's the thing is like there's both, you know, using MCP from, you know, almost say like a user facing tool. Because in some ways, like GitHub Copilot is it's like a kind of a user facing tool, even if the users are developers. Versus using MCP as the integration layer for agents that you're writing in Python. and that's actually where we see a huge amount of uses of MCP, right?

33:02Michael Kennedy: Because there's always this debate about MCP versus CLI. And yeah, locally, you can do whatever the heck you want, whatever works for you. But when it comes to putting agents into production and having them do communication with other servers when they're actually deployed to the cloud, everyone's using MCP there, right? Like for enterprise agent interconnectedness, it's all MCP. So what I tend to care most about is actually like, hey, can I write a Python agent framework that integrates with a Python agent that integrates with this MCP server? And is it going to work as expected?

33:36Pamela Fox: So people are excited about MCP probably like, oh, we're going to add this MCP thing to our topic. But I think a good question. And this one, everything we talk about, we've got to give it a little bit of a caveat of like, well, was it like last century effectively for this technology like last year? but you wrote about to mcp or not to mcp you know my joke but there are reasons to not use it or not completely just leave it wide open like create maybe more focus tools and then give those to

34:05Michael Kennedy: your ai or to you yeah yeah and so here um this was an example for this was playwright right um so playwright is a browser automation library um and there's a python package for it it's it's fantastic. And I was already using Playwright quite heavily to write my end-to-end tests for web apps, right? And so you could actually, and there's a PyTest-Playwright plugin. So it's very easy to, you know, write these end-to-end tests with Playwright and they'll like automatically open a headless Chromium browser or Firefox browser and they'll click around, they'll do something and they'll verify it all works, right?

34:40Michael Kennedy: Now, Playwright was one of the first MCP servers that came out and people loved it because suddenly people discovered browser animation. Like a lot of people I think had never never knew that you could like programmatically control a browser and so the Playwright MCP like you know it lowered the barrier for that where people were just like adding Playwright MCP server to their coding agents and you know having fun you know automatically shopping and all that stuff. So you know so I that that was you know one of the first you know big servers that you would hear a lot about. So I wanted to make an agent that would automatically triage my LinkedIn request to connect, right?

35:18Michael Kennedy: So you go to a conference, you go back, and you see your LinkedIn, and all these people want to connect. And they're all great people, but I find it really boring to accept, accept.

35:27Pamela Fox: And every now and then it's careful, only connect with people you actually know. It's like, nope, accept, accept, accept. What am I going to be rude and tell them no? I don't know. Yeah.

35:36Michael Kennedy: Well, every so often you get kind of like a life coach in there. Yes. No, you do want to

35:42Pamela Fox: yeah like uh a recruiter a recruiter yes exactly yes a lot of a book publisher like hey would you like to write a book on this like no if i want to write a book on it we've already written a book

35:53Michael Kennedy: on it yeah i do i i have this fantasy that one day i'll write a book so i accept those but yeah so i wanted to automate that so my first experiment was doing a pedantic ai agent with the player and mcp server and it was like incredibly inefficient because it would like go to the LinkedIn page, it would kind of click around, try to figure out what to do. Like it was like continually reading lots and lots of tokens because it wasn't sure exactly what to do. And it did like eventually succeed. But it wasn't a good experience because one, I had like a limited token budget at that time. And two, it was just like taking a really long time.

36:28Michael Kennedy: And it was sometimes working, sometimes not. And I was like, well, you know what, I'm trying to do the tasks, the same task every single time, every single day. Why don't I just script this using the Python Playwright SDK, right? So I just, you know, I then, you know, scripted it using SDK. You know, at that point, I hand wrote it myself. These days, I just have Copilot open up the browser and figure it out. But then, so then it becomes like much more deterministic. And I only brought the LLM in to make the decision, right? So I have like the Python Playwright SDK code is like opening my LinkedIn, restoring my auth cookies so that I'm like logged in and that had this browser.

37:02Michael Kennedy: And then, you know, logging in, checking the request, it gets a request. Okay, then that's when it sends the information to an LLM. Only then. And it uses structured outputs and says, hey, LLM, send me back some JSON that says, you know, accept, ignore, reject, or undecided and give me the reason for it. Right. And I gave it a prompt that said, if it's a recruiter, a life coach, or a financial consultant, that's basically the prompt. Ignore.

37:26Pamela Fox: Ignore.

37:26Michael Kennedy: Yeah. You know, it's very effective. So, right. So that was you know that's that's you know that's something considered right like the re like mcp enables these uh you know you to create new mashups new permutations combinations new workflows that you know you didn't already have in your head so it makes a lot of sense if you were deploying any sort of agent that has more open-ended tasks or that like a user is ultimately going to be used in order to do their end tasks, right? So if there's any sort of open-endedness where it may have to do iteration and or shouldn't decide what it's going to do next, then an MSP server makes sense.

38:07Michael Kennedy: But if you're doing the same thing every single time and there's, you know, even like, you know, in the case of mine where it's like, all you're doing is tracing network requests, it's just not necessary to use MSP server and it can add more non-determinism to a workflow.

38:22Pamela Fox: Yeah, and if you're worried about it going crazy and just instead of connecting go, oh, she wants to connect with people. Let me find everyone on LinkedIn and add them as a connection. You know what I mean? Like something like that. You could think, oh, the AI went crazy. What you've given it is a much more constrained and deterministic deal, right? Like it can only look at yes, no. I mean, today almost would be a Jev sort of thing.

38:42Michael Kennedy: Yeah, I could totally sub in a Jev model point, right? Like it would be a good scenario for a Jev model. Generally, like that's a whole other discussion, but yeah, generally if anywhere we're using structured outputs where the result is a Boolean or a choice, you could go ahead and sub in JAP model, decisions API, Microsoft, we just launched decision one, you know, a decision model. And yeah, so then you don't even need a full LLM.

39:05Pamela Fox: Yeah, exactly. But I do think a lot of times just giving an LLM a chance to like, I got it close, but let's go there. I'll give you an example from my world that I found really helpful is I have Hermes chilling on my Mac mini, just doing a bunch of stuff. And two YouTube channels, and they really are just sort of replications of the podcast. So like the description is, it's a structured thing, but it comes from a whole bunch of different pieces of data out of the podcast and so on. But especially when I was live streaming more, it would be the stuff will go up. And then eventually when the results, like all the details of the episode are together, I got to go find all of that, the transcript, the description, the guest, the links, and then go and put them back.

39:44Pamela Fox: And I just sort of, I don't know, I lost track of that. And I had like two or 300 videos on each channel that were just episode seven, episode 200. You know what I mean? Like, oh no, I can't, I cannot navigate the YouTube studio. It's so slow on every little step. I can't go and do like 400 edits of this. And so I wanted my Hermes to just, anytime that sees something appear in the RSS feed for the podcast to instantly use the MCP server, find the details and rewrite the YouTube channel. Well, I don't want to just give it full access to my YouTube. So what I did is I used Cloud Code to build a Python library that does the specific things I want it to do to YouTube.

40:22Pamela Fox: And I just gave Hermes the wheel. I said, here's the wheel. You install this if you need to. Then you manage the YouTube channel through it. And it does. And it's gone through all my hundreds of videos are all up to date. It's perfect. And if I change it on the website, it automatically changes on YouTube like 15 minutes later. Crazy.

40:38Michael Kennedy: I think that's something that we can take advantage as Python developers is that it's easy for us to make our own tools that have a more restricted surface. For example, I keep meaning to VibeCode an mcp server for my pilates booking website right which and i would just expose only the tools that i want right like i wouldn't have um you know i wouldn't have like my account i would just have a you know like list this week sessions and book a session right so you know for you know especially for us as python developers this should be really easy we're just you know prompt and be like hey you know make this mcp server that does this and this um you know and the hardest part is like auth but there's, you know, there's ways to set that up.

41:18Michael Kennedy: And then, and then we can like feel confident pointing our agents at these tools, these servers or CLIs or however you've done them and not worry about something, something bad happening. Right. I know like many people are just kind of YOLOing with the current rage of Muse and Grokpot and that, but then of course, every day we see this like, you know, horrible thing that happened to someone because of that.

41:41Pamela Fox: It RMRF'd our production database. Why did you give it access to your production database? What are you doing?

41:47Michael Kennedy: So, you know, we we're still in an advantage as developers where, you know, if we don't have already access to tools that allow us to do restriction, then we can, you know, we can buy our own tools for that. Many of these tools, like with MCP servers, a lot of them will have a bunch of tools and you could decide to give your agent access to just some of them and not others. So MCP servers will actually annotate which of the tools are read-only and you might say, hey, you can only access the read-only tools. And with the GitHub MCP server, it has this notion of tool sets and you can say like, hey, you're only allowed to use such and such tool set.

42:26Pamela Fox: A little bit like restricting the job that you give them. Because when they come back, it goes to the MCP and it says, what can I do? And it's like, oh, well, here's 200 things you can do. You don't necessarily want it to do those 200 things just randomly. It might be like, like you said, list schedules, check my free time, book me this thing. You get three or four tools, you know what I mean? And so, yeah, you have a talk on just stricter schemas, increased reliability, and then also on directing them to the, like, oh, the filter of the tools one. That's it. Filtering tools from MCP servers. Basically how you can save tokens, make it safer.

42:58Pamela Fox: There's some tools in Copilot, and this might also apply if you run Codex or Claude in the chat window in VS Code. I can't remember.

43:08Michael Kennedy: Yeah, so when I wrote this blog post here about filtering tools, this was, what, five? Ancient. It's ancient. Ancient, ancient. So at that time, like in early days, VS Code actually, if you selected more than, I think it was like 175 tools, you'd like get this warning that's like you have more than you know this many tools selected like you may want to reduce them right and everyone would get so stressed out like trying to decide which of them to like turn off and turn on now a few things have changed since that time um one obviously our models have gotten um but two the models have tool search and deferred tool loading built in so both the new open ai models and anthropic models like from the last uh six months or so, they have a built-in capability that's actually was like trained into them as part of their RLHF, their post-training, where they know how to search for a tool and to load in a tool, like to use a deferred tool if they don't see a tool fully loaded in, right?

44:08Michael Kennedy: So a lot of the modern agents will, if they're seeing that you're using a model, like our opening eye model, they may choose to use that deferred tool. So these days, I don't really worry as much about having too many tools turned on because I know that there's much better handling of many tools. However, if you change your model to a much worse model or something, then you'll differ.

44:37Pamela Fox: Yeah, I've played around with one of the smaller, more self-hosted-like models. It wasn't quite that, but it wasn't the frontier ones. And I gave it basically this project. I want you to change part of this. It's like a little bit later, it's like I've removed all of this from your app. I'm like, no, no, no. Why did you think you'd delete all? I just wanted you to take a little part of it. Like it's, and it just made me remember like, oh yeah, it used to be like that all the time. It would just go crazy and do weird stuff. And that doesn't really happen very much with the top tier models these days.

45:05Pamela Fox: You know, you're a little bit kind of let it figure it out. I think that's some of the newer guidance is it's smart enough that you're just going to be in its way.

45:12Michael Kennedy: Yeah, it means like when you're designing MSP servers and skills, especially skills, like a lot of people, we have like these really, you know, long, verbose agent skills. And, you know, as the models get better, we, you know, may not need those skills. And especially if your skills are like over prescriptive. That's the big thing I've seen with agent skills lately is a skill. If a skill has too absolute of a statement in it. Like there was one I was using the other day that was like, oh, if they ask to do anything else besides what's in this file, then say it is not possible. Right. And like that just like shut the agent down entirely.

45:49Michael Kennedy: We're like I couldn't do things that otherwise I could have done with that API. So especially if you're like putting out agent skills to help people use like your API or your Python package, like everything needs to be very intentionally in there. and you need to be really, really careful about kind of any statements of constraints and limits because you might end up like hobbling the agent that otherwise would have been successful, but you accidentally held it back, right? So don't hold back, right? Skills should, you know, streamline things and give some hints and tips and whatnot, but usually skills should not be holding an agent back from successfully using an API.

46:27Pamela Fox: Yeah, there's so many of those projects on GitHub. I love GitHub, but there's so many. there's thousands of here's my set of skills that will make it a lawyer it'll make it a an accountant or whatever and you're like i really don't want to put this it's just going to pollute it with these ideas like i bet it would be better if i just let it be you know

46:44Michael Kennedy: yeah i i mean i use i'm happy to use my own skills i think what i encourage people is like you know find skills that you know people are talking about that you're in fork them and then make them your own right because like there's very few skills that i use from other people because, you know, I'm very opinionated. I want my workflows to work great for me. So I'm very happy with the skills that I maintain, right? So I have presentation skills is my biggest repo of skills. And it's all just things related to making presentations, like, you know, generating slide decks and images for them, making transcripts, lots of stuff with YouTube, right?

47:22Michael Kennedy: Like transcribing them after. And then I have some other skills that have to do with like Azure employment and stuff. So I'm happy with those skills because I have a lot of control over them. But it's so hard to use someone else's skill and have it be a great experience for you. So find a skill you like and then fork it. Make it your own.

47:41Pamela Fox: Yeah, that's great advice. Absolutely. Now, let's talk CLIs for a minute. I think having CLIs used to be something that was just cool. So you could maybe script it or you could automate it. Like, I want to be able to do this thing with something. and if I make a CLI, then my bash or my Ansible script or whatever can run it. So that's why we're going to have a CLI. And I think, honestly, CLIs these days are a really interesting escape hatch for agents and things like that. They're like, for some reason, they don't connect or they can't connect to an MCP. Like maybe it's an app that only would have an MCP when it's running, but you only run it for a moment.

48:17Pamela Fox: So maybe give us your thoughts on this CLI story.

48:20Michael Kennedy: Yes, we have to have the required MCP versus CLI debate. We do. It wouldn't be complete if we didn't do it. It's contractually obliged. So, yeah, it's very interesting, actually. My colleague has a project that's now called Scope. And in this project, they actually will set up scenarios to see how well an agent succeeds at a particular task in a particular environment. And the example that he gave in a talk the other day was using the GitHub CLI, GH command, and the GitHub MCP server, and then just nothing at all compared to see like how long would it take? How successful would it be? Like, would it?

48:59Michael Kennedy: So in this case, it was actually fixing a bug on one of my repos, which I didn't know he was going to do. So I was surprised to see this PR the morning of his talk. But yeah, so he's, you know, so it's comparing to see, you know, token efficiency, success, number of tool calls, all that stuff, right? Now, the results from that particular experiment was that the GitHub CLI was the best, right? And I think a lot of people would actually predict that. Like it was, you know, it required less tokens overall and was successful more of the time. But why is that? Part of that is because the agents, like LLMs, they know the GitHub CLI.

49:36Michael Kennedy: The GitHub CLI is deep, deep in the weights, right? So they're very, very good at using the GitHub CLI. They really don't know the GitHub MCP server much at all, especially, you know, it changes over time. So it's very, it's really not surprising that they would do particularly well at using that CLI. So, you know, so the takeaway from that experiment is like in that particular example, yeah, it was more successful with CLI. And there were some good kind of just specific learnings for the GitHub MCP server about what it struggled with when it was calling that server. But generally, what you should be doing is like ideally, like always offering everything, right?

50:12Michael Kennedy: So you should have you should have a CLI properly, you should have an API, like additional API, like we're not getting rid of API's like API's for HTTP services, like you still want an API, an SDK, a CLI, an MCP server, you know, is something that you've ideally optimized for agents. So you should be like running these tests with agents and saying, hey, for this scenario, for all these range of scenarios, how successful are the agents when, you know, when using our MCV server? And also with agent skills, like we do the same test with agent skills. So these are, you know, think of these as, you know, you're developing tools for agents, and you really want to see how successful agents, you can do the same with CLI, like you could, there are definitely people who are trying to optimize their CLIs more for agents, Like there was a great talk at Pi AI last year from the folks at Astral where they were talking about that there was a lot of improvements they were going to make to like rough that made it better for humans.

51:07Michael Kennedy: But now they're like, well, what's the point? Humans aren't the ones running rough anymore. Agents are running rough. They have all these ideas now about how they're going to make rough better for agents. So they may not even like bother. Like, I mean, yes, a couple humans somewhere are running rough and actually looking at the results. But yeah, so now they're like much more focused on like optimizing the experience for agents.

51:27Pamela Fox: My agent runs rough a lot. I don't know about yours, but I told the standing rule for all of my agents if they're doing coding, that is, is whenever you're done, you're not done until rough format, rough check, and TY check. All of those run without warnings, without errors. You know what I mean? Like if you introduce something that breaks those rules, those are easy to fix.

51:49Michael Kennedy: Right. So that, I mean, you can put that in your agents.md. I oftentimes have that in my agents.md. You can even formalize like a lot of these coding agents have what's called like a hook, at least VS Code, we call it a hook. So you can have a hook that runs every single time and make sure that it runs. But a lot of times if you just put it in your agents.md, then that's enough instruction to be always taking those actions.

52:12Pamela Fox: Yeah. If you want to be super old school, I mean, we're talking like 2024 old school, you could put it in a Git pre-commit hook. Really? Oh, yeah, of course.

52:19Michael Kennedy: That's freaking me, though, because we're like, you know, that's even like later in the process, right? So it depends how often, right? So you've got hooks. You know, you've got hooks for the agent hooks are much more frequent, right? So, you know, we don't know how often you're committing. But, you know, if you want it to happen every time. I have an agent hook that just every time the agent stops, my kid giggles. It just plays the sound of her giggling. And it's very cute. It just makes, you know, it just fills my life. Oh, that's sweet. Yeah. Yeah, and then it's programmed so that if I leave the machine for more than a minute, then it'll also like kind of giggle harder and tell me the name of the session so that I can decide whether to come back my machine, right?

53:00Michael Kennedy: So that way I can like do my kids' laundry while I'm the agent. Yeah, yeah, yeah.

53:03Pamela Fox: That's super cool. So we're not complete with the CLI conversation. I think one of the things that I would like to encourage people who are building CLIs for agents, a lot of the things that are interesting about this is it's good for people. and it's good for agents. Because they kind of both use English or natural spoken language, it's optimizing for one sort of helps the other a lot of times. Anyway, so my suggestion about this is that use a nice CLI framework like Typer or Click or even if you're using ArcPars, one of these built-in ones, make sure there's lots of help documentation and stuff because then the first thing the agent might do is your CLI dash dash help.

53:41Pamela Fox: Okay, I now understand this tool that I have almost completely. Let's go. You know what I mean? You don't have to do much more to teach it.

53:47Michael Kennedy: Yeah. And you can even ask the agent like for advice, like, hey, what would help you? Like, what would have helped you achieve that? Right. Like, you know, what were what were the issues with that? Yeah. It's interesting because, like, you know, on the one hand, you think it's different to optimize something for an agent versus optimize it for a human. I think that is where some of the current tension is, especially with documentation. by trying to figure out is our documentation you know who is the one actually reading it um you know so right now you know we have agents.md and that's definitely targeted agents we have readme.md and a lot of times i end up repeating similar things across both um and yeah and i think just right now it's just currently um attention i think there's some clis that will have kind of like an agent mode that might be like much more verbose for example because agents can actually i think there's actually it goes but sometimes they're like lesser rows because it depends if you're trying to reduce token count or just increase information right because uh you know lms can handle a fair bit of information like they can look through a whole python traceback error right and they can understand it whereas me like you know it takes me a while to get to like the right point in the error um so it's i think i i do find it like really fascinating to try and figure out you know, as the world is moving so much right now, you know, what kind of entity are we optimizing our developer experiences for?

55:07Pamela Fox: I promised you a GitHub CLI story.

55:10Michael Kennedy: Oh, yeah.

55:10Pamela Fox: So like a year ago or so, you know, not that long ago, I was doing something with Claude and I didn't tell it to go to GitHub. I didn't tell that there was a GitHub. I just happened to be in a Git repository and I was working zero intention to go talk to GitHub or anything and And I said, okay, what if we did it this way? And it says to me, I'm not logged into VS Code or any of the tools. I unknowingly was logged into the GitHub CLI. And I ask it a question. It goes, well, three years ago, you added this GitHub issue. And it talked about it this way. But I think it's changed. Like, what? How did you get to my GitHub?

55:45Pamela Fox: I need to know what is going on here. And eventually, like, oh, it used the... I went back and looked. Oh, it used the GitHub CLI to explore the project. And I didn't even tell it to him. Like, what is it doing? But in the end, I was like, you know what? Cool. It brought something from a long time ago back to the future. And we're working on it. It's good. But it freaked me out.

56:02Michael Kennedy: That actually reminds me of when I was prepping for today's podcast. I asked, you know, I'm a co-pad. I was like, hey, you know, it's a podcast. It's about like Python and MCP. And it immediately connected to my emails and my events. And it found that you would like attach the Google Doc to the, because I didn't know you'd made a Google Doc of what topics we were going to talk about. I had missed that. So it found the Google Doc. I was like, okay, I've made an entire like markdown document prepping you based on the Google Doc. I'm like, what Google Doc? What are you talking about? So, you know, you know these things.

56:31Michael Kennedy: Yeah, right. So like it's, you know, these agents can be very powerful. They're very good at like, you know, searching through lots of data. I, you know, just even if it's just a read only tool that's just searching through things like, you know, really, really helpful there because it's not going to get bored after the first page of, you know, search results, right? Like it can it can keep going. um so you know i think it is lowering the barrier to finding information um so you know we we don't lose we can't we're not going to lose information as much in the the big mess of things because we can have like these really persistent agents that are looking for this so for me from like an information accessibility perspective uh i think that's really good because i've always been very good at like searching the web to the point where even at google people would ask me to search for things because they knew I was like really good at Googling, even at Google.

57:19Michael Kennedy: And even like in high school, I participated in web search competitions because I'm an absolute nerd.

57:25Pamela Fox: Wait, hold on. What search engine do you all use for that? That wasn't like Lycos or anything, was it?

57:30Michael Kennedy: In high school, this was for the Science Olympiad. And that would have been in 2001. So I don't even, I think it would have been Yahoo at that point. Okay. Yeah.

57:40Pamela Fox: Yeah. Yeah.

57:41Michael Kennedy: I was a big Yahoo user.

57:42Pamela Fox: Yeah. Those

57:43Michael Kennedy: were amazing times yeah so but now like you know now it's fine i don't have to lord my searching skills anymore like now everyone can you know use their agent to really efficiently search and find great results which is good we're making information universally accessible and useful which is i think the mission statement of google but you know someone's mission yeah

58:02Pamela Fox: absolutely so final thought on um clis they don't have to necessarily be either or i ended up writing a TalkPython podcast and courses CLI, which is kind of weird. But if you go, it's open source. If you go look at it, all it does is it basically calls the MCP endpoints and the actions are like composition of the tools. So it really is just a different interface to the MCP server. But I'm like, the things that want to automate this that don't have access to the MCP server, like how long would it take to write this? It wasn't that much work. So anyway, you can make them, they can coexist like cats and dogs living together.

58:36Michael Kennedy: Mm-hmm, mm-hmm. Yeah, I mean, that's the thing is that there's some agents that can connect to MCB servers that can't connect to CLIs because not all agents have a, like, kind of coding execution environment.

58:48Pamela Fox: Yeah, especially the cloud ones, right? If it's just a chat LLN, they're not on your machine.

58:53Michael Kennedy: Right, yeah. So, yeah, so there's – and then there's other agents that can run CLI commands that, you know, for some reason they can't, MCB servers, you know, for whatever reason. So, you know, it's just – it's good to have both.

59:04Pamela Fox: And it's easier than it used to be. You used to be like, all right, well, who's going to be on the CLI team? Now it's like, I know who's going to be on the CLI team.

59:12Michael Kennedy: It's all you. It's all me.

59:14Pamela Fox: Lod, you're writing CLI today. Let's get going. Or chat or whatever, you know, copilot. Well, this has been super fun. I mean, let's close it out with some final thoughts. What do you think? Yeah, so final thoughts.

59:26Michael Kennedy: We haven't really got into the Python aspect of MCP. So things I would tell Python developers is that there is an official Python MCP SDK. And that is to get started. But there's also a fantastic package called Fast MCP, which builds on top of that MCP SDK. And that's from Prefect. And that adds all these like really neat integrations. So I personally always use Fast MCP. But you shouldn't use one of those, right? I was actually looking at a colleague's MCP server today. And it was just like handwritten from scratch. I was like, that's not necessary, right? Like, and if there is an official NCP SDK that passes the specification and then there's Fast MCP, which builds on that.

1:00:07Michael Kennedy: So it also, you know, is conformant, but then adds all these additional features. So if you're starting today, you can, you know, point your agent at the Fast MCP docs and have it, you know, write an MCP server using the latest version of MCP protocol, which is a really nice improved version. It's stateless, so it's more scalable and direction ready. so it's it is very easy to get started writing your first python mcp server um and um and yeah and there is also a conformance suite so if for some reason you did write your own mcp server you you should at least run the conformance suite to see that it aligns the spec um but you know easiest way to start server and you know just um you know just give it a go and maybe just make one for fun just so you can understand uh how this new protocol works and it'll give you more insight is when you're using MCP servers, you know, with your favorite agent.

1:00:58Pamela Fox: Yeah, I don't think I really understood how MCP servers really worked until I built one.

1:01:02Michael Kennedy: Right, yeah, which is like, I mean, that's one of the greatest way of, you know, learning how these things work. I didn't really understand how they worked until I built one, put it in production, and then had an error with it.

1:01:14Pamela Fox: Wait, this is not working the way I expected. Uh-oh, what's going on?

1:01:17Michael Kennedy: Yeah, that's when you really, really understand something, right?

1:01:19Pamela Fox: That is for sure. That is for sure. Cool. All right, well, Pamela, thanks for taking the time for being on the show. Always fun to...

1:01:26Michael Kennedy: All right. Awesome. See you next time.

1:01:28Pamela Fox: See ya. This has been another episode of Talk Python to Me. Thank you to our sponsors. Be sure to check out what they're offering. It really helps support the show. If you or your team needs to learn Python, we have over 270 hours of beginner and advanced courses on topics ranging from complete beginners to async code, Flask, Django, HTMX, and even LLMs. Best of all, there's no subscription in sight. Browse the catalog at talkpython.fm. And if you're not already subscribed to the show on your favorite podcast player, what are you waiting for? Just search for Python in your podcast player. We should be right at the top.

1:02:03Pamela Fox: If you enjoyed that geeky rap song, you can download the full track. The link is actually in your podcast blur show notes. This is your host, Michael Kennedy. Thank you so much for listening. I really appreciate it. I'll see you next time.

1:02:23Talk Python to me, get we ready to roll Upgrade the code, no fear of getting whole We tapped into that modern vibe over King Storm Talk Python to me, I-Sync is the norm

From the publisher
Should your agent call an MCP server or just run a CLI? Pamela Fox joins us to share how she thinks about connecting AI and her data. She’s taught MCP workshops from PyCon to WeAreDevelopers. And, every week, an agent combs her Gmail, Outlook, and X history to build her news roundup. She uses MCP all day. Yet, there are still times you when to skip it. You'll hear how her colleague pitted the GitHub CLI against the GitHub MCP server on a real bug fix. The CLI used fewer tokens. It succeeded more often. So do we choose CLIs, MCPs, or even just APIs for connecting our agents to our data and services? Let's find out.

Episode sponsors

Talk Python Membership
Talk Python Membership
Talk Python Courses

Links from the show Guest
Pamela Fox: pamelafox.org

Meetup: SQLite Might *Actually* Be All You Need: talkpython.fm

MCP: modelcontextprotocol.io
WeAreDevelopers workshop: pamelafox.github.io
slide 16: pamelafox.github.io
To MCP or not to MCP: blog.pamelafox.org
MCP: Bringing mashups back: blog.pamelafox.org
MCP auth session: www.youtube.com
Pydantic AI \+ Playwright: blog.pamelafox.org
post: blog.pamelafox.org
PyAI talk: www.youtube.com
post: blog.pamelafox.org
POSETTE talk: www.youtube.com
post: blog.pamelafox.org
Can MCP choose my outfit: blog.pamelafox.org
Talk Python now has a CLI: talkpython.fm
FastMCP: gofastmcp.com
Typer: typer.tiangolo.com
Click CLI: click.palletsprojects.com
Boldin: www.boldin.com
Sentry MCP: mcp.sentry.dev
X.com MCP: docs.x.com

Watch this episode on YouTube: youtube.com
Episode #569 deep-dive: talkpython.fm/569
Episode transcripts: talkpython.fm

Theme Song: Developer Rap
🥁 Served in a Flask 🎸: talkpython.fm/flasksong

---== Don't be a stranger ==---
YouTube: youtube.com/@talkpython

Bluesky: @talkpython.fm
Mastodon: @[email protected]
X.com: @talkpython

Michael on Bluesky: @mkennedy.codes
Michael on Mastodon: @[email protected]
Michael on X.com: @mkennedy