Skip to content

Commit b9b6ce1

Browse files
committed
fix: cleanup of examples and Readme
1 parent 99b5aee commit b9b6ce1

File tree

5 files changed

+34
-25
lines changed

5 files changed

+34
-25
lines changed

test-mcp/README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,40 @@ uv sync
7171

7272
### FastMCP Library Server (HTTP)
7373
```bash
74-
# Using the script
74+
# Using the script (automatically starts MCP inspector)
7575
./run_fastmcp.sh
7676

77-
# Or directly
77+
# Or directly (just the server, no inspector)
7878
uv run python main_fastmcp.py
7979
```
8080

81-
This starts an HTTP server on `http://127.0.0.1:8000` that you can interact with via HTTP requests.
81+
This starts an HTTP server on `http://127.0.0.1:8000` that you can interact with via HTTP requests. The `run_fastmcp.sh` script automatically starts the MCP inspector tool for testing.
8282

8383
### MCP Built-in FastMCP Server (STDIO)
8484
```bash
85-
# Using the script
85+
# Using the script (automatically starts MCP inspector)
8686
./run.sh
8787

88-
# Or directly
88+
# Or directly (just the server, no inspector)
8989
uv run python main.py
9090
```
9191

92+
The `run.sh` script automatically starts the MCP inspector tool for testing.
93+
9294
### Low-Level Server (STDIO)
9395
```bash
94-
# Using the script
96+
# Using the script (server only)
9597
./run_lowlevel.sh
9698

9799
# Or directly
98100
uv run python main_lowlevel.py
99101
```
100102

103+
**Note:** The `run_lowlevel.sh` script does NOT automatically start the MCP inspector. To test this server, you need to manually start the inspector:
104+
```bash
105+
npx @modelcontextprotocol/inspector
106+
```
107+
101108
## Using with MCP Clients
102109

103110
The STDIO-based servers (`main.py` and `main_lowlevel.py`) can be used with any MCP-compatible client like [Claude Desktop](https://claude.ai/download).
@@ -144,15 +151,27 @@ The FastMCP Library server runs as an HTTP server and requires a different clien
144151

145152
The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a developer tool for testing and debugging MCP servers. It provides an interactive web interface to test your server's tools, resources, and prompts.
146153

147-
### Installation & Usage
154+
### Automatic Inspector Startup
155+
156+
The following run scripts **automatically start the MCP inspector** for you:
157+
- `./run.sh` (MCP Built-in FastMCP server)
158+
- `./run_fastmcp.sh` (FastMCP Library server)
159+
160+
### Manual Inspector Startup
148161

149-
The MCP Inspector can be run directly using `npx` without installation:
162+
For the **low-level server** (`run_lowlevel.sh`), the inspector is NOT started automatically. You need to manually start it:
150163

151164
```bash
165+
# First, start the server
166+
./run_lowlevel.sh
167+
168+
# Then, in a separate terminal, start the inspector
152169
npx @modelcontextprotocol/inspector
153170
```
154171

155-
### Testing Each Server Implementation
172+
### Testing Each Server Implementation Manually
173+
174+
If you prefer to run the inspector manually for any server:
156175

157176
**MCP Built-in FastMCP Server (`main.py`):**
158177
```bash

test-mcp/main.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,3 @@ def debug_assistant_prompt() -> str:
209209
4. Provide prevention strategies
210210
211211
Ask clarifying questions if needed."""
212-
213-
214-
215-
# mcp.run()
216-
# def main():
217-
# # Run the MCP server
218-
# mcp.run()
219-
220-
# if __name__ == "__main__":
221-
# main()

test-mcp/run.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
# Install dependencies
44
uv sync
55

6-
# Run the MCP server
7-
uv run python main.py
8-
6+
# Run the MCP server + the mcp inspector
7+
uv run mcp dev main.py

test-mcp/run_fastmcp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
uv sync
55

66
# Run the MCP server
7-
uv run python main.py
7+
uv run fastmcp dev main_fastmcp.py
88

test-mcp/uv.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)