Skip to content

Commit 5385f8b

Browse files
committed
added readme, fixed typo
1 parent 88c8acb commit 5385f8b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

examples/mcp/filesystem_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MCP Filesystem Example
22

3-
This example uses the [fileystem MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem), running locally via `npx`.
3+
This example uses the [filesystem MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem), running locally via `npx`.
44

55
Run it via:
66

examples/mcp/git_example/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# MCP Git Example
2+
3+
This example uses the [git MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/git), running locally via `uvx`.
4+
5+
Run it via:
6+
7+
```
8+
uv run python examples/mcp/git_example/main.py
9+
```
10+
11+
## Details
12+
13+
The example uses the `MCPServerStdio` class from `agents`, with the command:
14+
15+
```bash
16+
uvx mcp-server-git
17+
```
18+
Prior to running the agent, the user is prompted to provide a local directory path to their git repo. Using that, the Agent can invoke Git MCP tools like `git_log` to inspect the git commit log.
19+
20+
Under the hood:
21+
22+
1. The server is spun up in a subprocess, and exposes a bunch of tools like `git_log()`
23+
2. We add the server instance to the Agent via `mcp_agents`.
24+
3. Each time the agent runs, we call out to the MCP server to fetch the list of tools via `server.list_tools()`. The result is cached.
25+
4. If the LLM chooses to use an MCP tool, we call the MCP server to run the tool via `server.run_tool()`.

0 commit comments

Comments
 (0)