You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-30Lines changed: 26 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,8 @@ The Model Context Protocol (MCP) is an open standard that enables LLMs to connec
16
16
-[Testing with MCP Inspector](#testing-with-mcp-inspector)
17
17
-[Contributing](#contributing)
18
18
19
-
## Getting Started
20
19
21
-
###Environment Setup
20
+
## Environment Setup
22
21
23
22
#### 1. GitHub Codespaces
24
23
@@ -43,9 +42,9 @@ If you prefer a plain local environment, use **uv** for dependency management:
43
42
uv sync
44
43
```
45
44
46
-
### Use MCP Server with GitHub Copilot Chat
45
+
##Using the Expenses MCP Server
47
46
48
-
### Run the MCP Server in VS Code
47
+
### Run the MCP Server in VS Code with GitHub Copilot (Codespace/Local Dev Container/Local)
49
48
50
49
1. Open `.vscode/mcp.json` in the editor
51
50
1. Click the **Start** button (▶) above the server name `expenses-mcp`
@@ -55,42 +54,44 @@ uv sync
55
54
1. Ensure `expenses-mcp` is selected in the list of available tools
56
55
1. Ask Copilot to invoke the tool:
57
56
- "Use add_expense to record a $12 lunch today paid with visa"
58
-
- "Read the expenses resource"
59
57
60
58
### MCP Inspector
61
59
62
-
The MCP Inspector is a browser-based visual testing and debugging tool for MCP servers.
60
+
The MCP Inspector is a browser-based visual testing and debugging tool for MCP servers. At the moment it does not work great with non STDIO MCP Servers when working inside of a Codespace.
63
61
64
-
#### Launch the MCP Inspector in GitHub Codespaces
62
+
#### Launch the MCP Inspector and connect to STDIO MCP Server in GitHub Codespace
65
63
66
64
1. Run the following command in the terminal:
67
65
```bash
68
66
.devcontainer/launch-inspector-codespace.sh
69
67
```
70
-
71
68
2. Note the **Inspector Proxy Address** and **Session Token** from the terminal output
72
69
73
70
3. In the **Ports** view, set port **6277** to **PUBLIC** visibility
3. The Inspector should now connect to your MCP server
86
+
1. Open `http://localhost:6274` in your browser
87
+
1. Access the Inspector UI and configure:
88
+
-**Transport Type**: `STDIO`
89
+
-**Command**: `uv`
90
+
-**Arguments**: `run main.py`
90
91
91
92
> **Note:**`HOST=0.0.0.0` is required in devcontainer environments to bind the Inspector to all network interfaces, allowing proper communication between the UI and proxy server. `DANGEROUSLY_OMIT_AUTH=true` disables authentication - only use in trusted development environments.
92
93
93
-
#### Launch the inspector locally without Dev Container:**
94
+
#### Launch the inspector locally:**
94
95
95
96
1. Run the following command in the terminal:
96
97
```bash
@@ -105,9 +106,8 @@ The MCP Inspector is a browser-based visual testing and debugging tool for MCP s
105
106
106
107
You can attach the VS Code debugger to the running MCP server to set breakpoints and inspect code execution.
107
108
108
-
### Debugging stdio server with GitHub Copilot
109
+
### Debugging STDIO MCP server with GitHub Copilot in Codespace/Dev Container/locally
109
110
110
-
To debug the stdio server (`main.py`) while using it with GitHub Copilot:
111
111
112
112
1. Open `.vscode/mcp.json` in the editor
113
113
@@ -121,25 +121,21 @@ To debug the stdio server (`main.py`) while using it with GitHub Copilot:
121
121
122
122
6. Set breakpoints in `main.py` and use the server from GitHub Copilot Chat. Breakpoints will be hit when tools are invoked.
123
123
124
-
### Debugging HTTP server with MCP Inspector
124
+
### Debugging HTTP MCP server with GitHub Copilot in Codespace/Dev Container/locally
125
125
126
-
To debug the HTTP server (`main_http.py`) while testing with the MCP Inspector:
126
+
1. Run the HTTP MCP Server in the terminal with `uv run -- python -m debugpy --listen 0.0.0.0:5678 main_http.py`
127
127
128
-
1. Start the HTTP server with debugpy enabled:
129
-
```bash
130
-
uv run -- python -m debugpy --listen 0.0.0.0:5678 main_http.py
131
-
```
128
+
1. Open `.vscode/mcp.json` in the editor
129
+
130
+
1. Start the **expenses-mcp-debug** server (instead of expenses-mcp)
132
131
133
-
2. In VS Code, open the Run and Debug panel (Ctrl+Shift+D / Cmd+Shift+D)
132
+
1. In VS Code, open the Run and Debug panel (Ctrl+Shift+D / Cmd+Shift+D)
134
133
135
-
3. Select **"Attach to MCP Server"** from the dropdown and click the play button (or press F5)
134
+
1. Select **"Attach to MCP Server"** from the dropdown and click the play button (or press F5)
136
135
137
-
4. Open the MCP Inspector UI and configure:
138
-
-**Transport Type**: `HTTP`
139
-
-**URL**: `http://localhost:8000`
140
-
- Click **Connect**
136
+
1. In GitHub Copilot Chat, make sure **expenses-mcp-debug** is selected in the tools menu
141
137
142
-
5. Set breakpoints in `main_http.py` and test your tools from the Inspector UI. Breakpoints will be hit when you invoke tools.
138
+
1. Set breakpoints in `main_http.py` and use the server from GitHub Copilot Chat. Breakpoints will be hit when tools are invoked.
0 commit comments