AI Engineer World's Fair 2025
Real world MCPs in GitHub Copilot Agent Mode
About this talk
Jon Peck demonstrates how GitHub Copilot agent mode uses Model Context Protocol servers to complete practical software-development tasks. He contrasts agent workflows with code completion and chat, shows how a detailed README can guide implementation, explains local and remote MCP connections, and demonstrates configuring a PostgreSQL MCP server in VS Code to retrieve database information and generate test fixtures. He also highlights repository-wide Copilot instructions and addresses an audience question about assigning issues to a coding agent.
Chapters
- 0:00From code completion to Copilot agent mode
- 1:33README-driven agent implementation
- 3:24MCP fundamentals and local or remote server connections
- 5:07PostgreSQL MCP setup and test-data generation
- 10:57Copilot instruction files and audience question
Talk transcript
- 0:00
[upbeat music] Our focus lately, obviously, has been a lot about Copilot and how we're really
- 0:25
bringing all the AI development capabilities to you. Initially, code completion. That was really our, our first step into this, right? And that's the sort of thing that you interact with at the microsecond level.
- 0:37
You're writing code, you're getting suggestions as you type, full function completions, that sort of thing. We moved on from that into chat, and having the ability to interact usually in more or less a one-shot, where you're giving it perhaps a complex prompt.
- 0:55
You're getting it to spit out or change multiple files, uh, and then you're moving on to the next thing you wanna do. Agent mode is really all about doing a complete task and having a deep interaction with that agent as you are building.
- 1:10
So I'll give it something I wanna do. I will interact with the agent as it's working, telling it what it's allowed to do on the command prompt, allowing it to read responses, that sort of thing.
- 1:21
And at the end, I'm gonna do anything from build a complete greenfield app to do a deep refactoring across a large code base, moderately complex tasks.
- 1:33
To give you a real example of what this looks like, here I've got a README. Uh, no code at all, just a README inside a repo. It's got a description of what I'm gonna make.
- 1:43
It's got the project structure lined up. It's the usual stuff I would write to another developer, how I wanna set it up, how I wanna configure the environment variables.
- 1:53
Uh, I might have a database schema in there. I might describe my specific API endpoints that I want to use. Um, and I might even include, you know, some workflow graphs.
- 2:03
Uh, a cool thing about LLMs nowadays with vision capabilities is I could include these as an image, and it'll actually be able to read them. If I'm working with a model that doesn't, I'll just use Mermaid or some other text-based di- graph diagramming.
- 2:16
But that README is intended to be very complete so that I can simply go in, I can switch Copilot over to agent mode and pick the model I want to work with and just say something like, "Hey, go ahead and implement this."
- 2:29
And it's gonna go ahead and crank through. By the way, apologies for using videos on this. Uh, as per yesterday's email, the internet's a little untrustworthy. Obviously, it's been untrustworthy for thirty years or so. [laughing]
- 2:40
More so locally, right? So it's going ahead. It's gonna build my data models. It's gonna spit out, um, the app py. It's gonna start working on the front end, et cetera.
- 2:50
And something to notice here is whenever those Continue boxes come up, that's when it's wanting to interact with the terminal. So it actually has to ask for my permission before it's allowed to continue doing that.
- 3:00
But then it'll read the response from the terminal if something goes wrong and react to that. So at the end of this, and this took in real time maybe about eight minutes, um, I've actually got a basic working app, obviously not well styled or anything.
- 3:13
I'll do that in later iterations. But I can interact with it. I can make travel reservations. I can pick the rooms I want, et cetera. Right? So that's your basic agent mode interaction.
- 3:24
Now, let's add MCP into this. If you haven't heard of MCP yet, uh, you probably haven't been on the internet in the last year. But a real quick review.
- 3:33
Uh, MCP is Model Context Protocol. It's basically an open protocol. It's kind of an API for AI, if you will. It allows LLMs to talk to external data sources, external references to get information, which might be general, might be specific to your account if you've added authentication into it.
- 3:50
Uh, or it might just be advice. So you can connect to all kinds of things from this. Um, and we're just gonna go through every single one of the MCPs out there, and we're gonna go in det-- No.
- 4:00
Okay, I'm not. [laughing] There's thousands, people. Okay. So github.com/modelcontextprotocol/servers is a list of it. By the way, this URL in the bottom right, gh.io/fair/mcp, all of these slides and the embedded videos.
- 4:16
So feel free to take pictures, but those will all be available to you immediately. How does this mechanically work? My IDE, in this case I'm using VS Code, has configured in it which MCPs I want to actually use.
- 4:29
I'll show that in a second. Copilot is aware of those in the configuration. So when I ask it to do something, it's gonna pick the right MCP for the job, and it's gonna go out and to connect to that MCP and get whatever it has to, it has to get.
- 4:44
That might be a local MCP server running on my machine, which is gonna connect to like a local database maybe, or maybe dial out to a web API to get something.
- 4:52
Or it might even be this MCP to MCP protocol, SSE, which I'm not super familiar with, where you basically have that MCP server running on a remote server, so it can be in a protected environment, and then it'll do the work and return it back to your IDE.
- 5:07
Either way, how you actually use these is pretty straightforward, right? I'm gonna identify the problem that I'm working with and what technologies are in that. So in this particular case, right, I'm using Postgres.
- 5:19
Uh, maybe what I wanna do is I wanna make tests for this application, and I wanna actually use the data from the local database as my mock data, right?
- 5:27
So I'll go ahead, I'll find the Postgres MCP, I'll add that in, and then I'll ask Copilot to go and do something with it. So let's take a look at what that looks like.
- 5:36
I head out to github/modelcontextprotocol/servers. I search around for one that's gonna do the job. Okie dokie, there's a Postgres MC, PostgreSQL MCP I can use. I could manually install it.
- 5:49
There's instructions here of course, but one nice thing about using VS Code is a lot of these have a one-click config where I can just hit that. It's gonna activate VS Code, and then it's gonna say, "Okay, can I install this server?"
- 6:02
So it goes ahead, I say, "Yep, install the server." It's gonna add that into my settings JSON, and one thing I didn't quite detail here in the video, but just so you know, when it gives it to me initially, it's just a bare sort of connection string default, right?
- 6:16
I have to go in, fill it out with my specific information. In this particular case, I don't need an authentication token 'cause I'm using local unauthenti-unauthenticated PostgreSQL. But obviously, if it were a remote database or I was in production, I would be using a proper auth key here.
- 6:30
But I basically fill that out with the data that's gonna be needed. You can see my PostgreSQL connection string there. And then I'm gonna start that server. So there's a little start icon above that.
- 6:42
Sorry, that probably went through quickly. But what that does is it basically starts the local MCP server so that now it's available for me to connect to. If I ever want to see what I currently have, I can always hit this little tools icon down in the chat area.
- 6:59
Sorry, it's small, but it looks like a little tool, you know, hammer and whatever next to each other. And that'll bring up this list of all the MCP servers that are available to it.
- 7:08
I can enable and disable them there and just use that as a reference for what I might be able to do. So knowing that that's there, I'm gonna ask Copilot to do something with Postgres, and sometimes I have to be more specific.
- 7:20
I tried this without specifically saying, "Use the Postgres MCP," and sometimes it intuits it and sometimes it doesn't. So I've taken to just being explicit, "Use the Postgres MCP to..."
- 7:30
And here, what I'm gonna ask it to do is to go to that Postgres database, pull the data, and then make a mock.json, which I can use as a reference as I build tests.
- 7:41
So I can see it goes ahead. It says, "Am I allowed to connect to this?" So same thing as when I was working in the terminal. I actually have to give it permission to do it 'cause I don't want it just going and messing around in my database without it-- without my permission.
- 7:55
By the way, one particular thing about this Postgres MCP, not all of them, but this one only functions in read-only mode, which is one of the reasons I like it, 'cause it's very safe.
- 8:04
It can read my data, it can use it locally in the IDE, but it's not gonna mutate my database accidentally, right? It'll go ahead. It'll run through all of that, pull the data.
- 8:13
There we go. It's got the actual data. It's put it into a mock JSON, and then it proceeds with the rest of the non-MCP agent workflow of, "I'm gonna actually build out all of your tests using that," et cetera.
- 8:25
So that worked out pretty well. Let's just take a quick look at what mechanically actually happened there, right? Aw, bummer. My little music repeat Saigon isn't working. I thought that was cute.
- 8:37
Anyway, um, we basically said to Copilot, "Hey, go and do something." Copilot itself parses that prompt and identifies the fact that it should be using an MCP for this connection.
- 8:48
It asks for permission from the developer to actually go and do the connection. When it gets that, it calls that MCP server. That MCP then interrogates my database for whatever it needs.
- 9:03
So basically, Copilot and the MCP are kind of handshaking and talking here, saying, "All right, you know, the first thing I wanna do," I know we kind of breezed through it, "is get the database schema.
- 9:12
All right, the next thing is I wanna identify and select from the specific tables. The next thing I wanna do is pull the data from those tables," and those were those successive steps you saw.
- 9:21
After that, Copilot's parsing all of those responses and putting something into my output. In this particular case, it's creating those files that I asked it to, and then adding it to its successive context so it can do the rest of the work.
- 9:35
And the reason I say iterate here is I guarantee your first prompt will not be right, right? Which is one of the reasons I really like using README files, and also now you can use Copilot instructions and also put prompt files that you can use selectively into VS Code.
- 9:49
So just go ahead and search for those and you'll find more detail on how to do that. One last thing I wanna leave you with here, I've got about four minutes it seems, um, is that GitHub itself has an MCP server.
- 10:01
And the reason I love this is because there's a lot of things that I don't necessarily want to do manually using, you know, GitHub command line or Git, or even having to go out to the site and actually click buttons.
- 10:16
The MCP server is pretty powerful, and what it lets me do, same workflow by the way, although there is a specific URL for this. I'll give that to you at the end.
- 10:26
Um, I go down, I find it. I say, "Go ahead and add it to VS Code." And the thing I'm gonna have to do here is, of course, I want information specific to my account.
- 10:34
So you'll see in here there's a place where you can add your GitHub personal access token. So you'll just go ahead, you'll generate one of those. You'll drop it in.
- 10:42
Yes, John, remember to blur it. Very good. Um, and then you will start that MCP server, and that would be connecting as you through your personal access token. So then I can tell it something like, "Okay, you know, you just went and you did all of this work."
- 10:57
I wanna, uh, I wanna point out one thing, by the way, which I consider a best practice. Um, for those of yous that use Copilot instructions, um, which basically is a specially named file in your IDE, .github/copilot-instructions.md.
- 11:11
You can put in there basically things that you want to go into every single prompt. It's kind of pre-injected, right? One of the things I like to put in there, aside from all of my standards about am I using pep8, uh, do I want you to run a security check on the stuff you just installed, so on,
- 11:26
so on, all those good practices. I like to say also include a changelog of everything you've done. That way when agent does work, even though, yes, I'm gonna be progressively committing and get sort of a history that way, having it explicitly add things to the changelog gives me a really good idea of what it did at every
- 11:44
single step. So that's what you're seeing happen right here, right? But then following that,
- 11:50
I'm just basically gonna say, "All right. Now that you've done all of that work, go ahead and use the GitHub MCP to commit all of these changes to a new branch and make a PR."
- 12:01
Right? So one step shot, I can pretty much just say, "Okay, go ahead and do the stuff I would normally have to do," either through manipulating Git commands or in VS Code manually, or going out and creating that PR directly.
- 12:14
And I won't show you the whole flow, but basically it comes up, it says, "All right, I'm gonna make that connection. Am I allowed to? I'm gonna go ahead, create the branch for you, create the PR," et cetera.
- 12:24
All right. With two minutes to go, I'll leave you with this slide of references. Um, so gh.io/fair/mcp, once again, is this deck. And the very last slide in this is all of the things that you would care to find out about, about how to work with VS Code, how to install MCPs, et cetera.
- 12:46
And I think I might have time for, like, one question before they drag me off stage. All right, first hand up.
- 12:52
There's, uh, something new called GitHub Co- uh, GitHub Copilot, uh, agent mode, coding agent, something like that, where you basically, uh, assign issues to, uh, to it, uh, through the web UI.
- 13:06
Yes. Thank you for bringing that up.
- 13:08
How, how does it play out? Like, uh, do you think this will be like a unified product in some future or those will, like, run separate?
- 13:15
TBA whether it's gonna be totally unified because I think the concerns of the independent developer versus the concerns of the enterprise are a little bit different. So at the time being, we're visualizing that as a little bit more of an enterprise thing, um, because of the way that it does work autonomously, and then you can hand it
- 13:32
off and have other developers approve it, sort of team-like interaction. Um, that said, uh, these are always fluid. We'll find out exactly how it works. Uh, for anyone who hasn't seen this yet, this is what I informally call Assign Issue to Copilot, where you can go into GitHub on github.com, you can create a new issue, and then
- 13:51
you can pick Copilot as the assignee. And Copilot will take off, and it'll do a lot of the agentic kind of stuff we just saw, but it does it in the background, provides you a session you can refer to on github.com, but then basically works through a PR and gives you output there.
- 14:06
A quick note on that, um, MCP is available there as well, and you can configure that in your repo settings under the Copilot subset and dump in your Co- your MCP configs there.
- 14:19
Thanks very much for your time.
- 14:20
Thank you.
- 14:20
Cheers. [upbeat music]