@@ -9,7 +9,6 @@ A demonstration project showcasing Model Context Protocol (MCP) implementations
99- [ Python Scripts] ( #python-scripts )
1010- [ MCP Server Configuration] ( #mcp-server-configuration )
1111- [ Debugging] ( #debugging )
12- - [ License] ( #license )
1312
1413## Prerequisites
1514
@@ -25,15 +24,15 @@ A demonstration project showcasing Model Context Protocol (MCP) implementations
2524
26251 . Install dependencies using ` uv ` :
2726
28- ``` bash
29- uv sync
30- ```
27+ ``` bash
28+ uv sync
29+ ```
3130
32312 . Copy ` .env-sample ` to ` .env ` and configure your environment variables:
3332
34- ``` bash
35- cp .env-sample .env
36- ```
33+ ``` bash
34+ cp .env-sample .env
35+ ```
3736
38373 . Edit ` .env ` with your API credentials. Choose one of the following providers by setting ` API_HOST ` :
3938 - ` github ` - GitHub Models (requires ` GITHUB_TOKEN ` )
@@ -43,14 +42,13 @@ cp .env-sample .env
4342
4443## Python Scripts
4544
46- Run any script with: ` uv run <script_name > `
45+ Run any script with: ` uv run <script_path > `
4746
48- - ** basic_mcp_http.py** - MCP server with HTTP transport on port 8000
49- - ** basic_mcp_stdio.py** - MCP server with stdio transport for VS Code integration
50- - ** langchainv1_mcp_http.py** - LangChain agent with MCP integration
51- - ** langchainv1_mcp_github.py** - LangChain tool filtering demo with GitHub MCP (requires ` GITHUB_TOKEN ` )
52- - ** openai_agents_tool_filtering.py** - OpenAI Agents SDK tool filtering demo with Microsoft Learn MCP
53- - ** agentframework_mcp_learn.py** - Microsoft Agent Framework integration with MCP
47+ - ** servers/basic_mcp_http.py** - MCP server with HTTP transport on port 8000
48+ - ** servers/basic_mcp_stdio.py** - MCP server with stdio transport for VS Code integration
49+ - ** agents/langchainv1_mcp_http.py** - LangChain agent with MCP integration
50+ - ** agents/langchainv1_mcp_github.py** - LangChain tool filtering demo with GitHub MCP (requires ` GITHUB_TOKEN ` )
51+ - ** agents/agentframework_mcp_learn.py** - Microsoft Agent Framework integration with MCP
5452
5553## MCP Server Configuration
5654
@@ -63,22 +61,25 @@ The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a deve
6361** For stdio servers:**
6462
6563``` bash
66- npx @modelcontextprotocol/inspector uv run basic_mcp_stdio.py
64+ npx @modelcontextprotocol/inspector uv run servers/ basic_mcp_stdio.py
6765```
6866
6967** For HTTP servers:**
7068
71691 . Start the HTTP server:
72- ``` bash
73- uv run basic_mcp_http.py
74- ```
70+
71+ ``` bash
72+ uv run servers/basic_mcp_http.py
73+ ```
7574
76752 . In another terminal, run the inspector:
77- ``` bash
78- npx @modelcontextprotocol/inspector http://localhost:8000/mcp
79- ```
76+
77+ ``` bash
78+ npx @modelcontextprotocol/inspector http://localhost:8000/mcp
79+ ```
8080
8181The inspector provides a web interface to:
82+
8283- View available tools, resources, and prompts
8384- Test tool invocations with custom parameters
8485- Inspect server responses and errors
@@ -92,65 +93,37 @@ The `.vscode/mcp.json` file configures MCP servers for GitHub Copilot integratio
9293
9394- ** expenses-mcp** : stdio transport server for production use
9495- ** expenses-mcp-debug** : stdio server with debugpy on port 5678
95- - ** expenses-mcp-http** : HTTP transport server at ` http://localhost:8000/mcp `
96- - ** expenses-mcp-http-debug** : stdio server with debugpy on port 5679
96+ - ** expenses-mcp-http** : HTTP transport server at ` http://localhost:8000/mcp ` . You must start this server manually with ` uv run servers/basic_mcp_http.py ` before using it.
9797
9898** Switching Servers:**
9999
100- Configure which server GitHub Copilot uses by selecting it in the Chat panel selecting the tools icon.
100+ Configure which server GitHub Copilot uses by opening the Chat panel, selecting the tools icon, and choosing the desired MCP server from the list .
101101
102- ## Debugging
103-
104- ### Debug Configurations
105-
106- The ` .vscode/launch.json ` provides four debug configurations:
107-
108- #### Launch Configurations (Start server with debugging)
109-
110- 1 . ** Launch MCP HTTP Server (Debug)**
111- - Directly starts ` basic_mcp_http.py ` with debugger attached
112- - Best for: Standalone testing and LangChain script debugging
113-
114- 2 . ** Launch MCP stdio Server (Debug)**
115- - Directly starts ` basic_mcp_stdio.py ` with debugger attached
116- - Best for: Testing stdio communication
102+ ![ Servers selection dialog] ( readme_serverselect.png )
117103
118- #### Attach Configurations (Attach to running server)
104+ ** Example input **
119105
120- 3 . ** Attach to MCP Server (stdio)** - Port 5678
121- - Attaches to server started via ` expenses-mcp-debug ` in ` mcp.json `
122- - Best for: Debugging during GitHub Copilot Chat usage
106+ Use a query like this to test the expenses MCP server:
123107
124- 4 . ** Attach to MCP Server (HTTP) ** - Port 5679
125- - Attaches to server started via ` expenses-mcp-http-debug ` in ` mcp.json `
126- - Best for: Debugging HTTP server during Copilot usage
108+ ```
109+ Log expense for 50 bucks of pizza on my amex today
110+ ```
127111
128- ### Debugging Workflow
112+ ![ Example GitHub Copilot Chat Input ] ( readme_samplequery.png )
129113
130- #### Option 1: Launch and Debug (Standalone)
114+ ## Debugging
131115
132- Use this approach for debugging with MCP Inspector or LangChain scripts :
116+ The ` .vscode/launch.json ` provides one debug configuration :
133117
134- 1 . Set breakpoints in ` basic_mcp_http.py ` or ` basic_mcp_stdio.py `
135- 2 . Press ` Cmd+Shift+D ` to open Run and Debug
136- 3 . Select "Launch MCP HTTP Server (Debug)" or "Launch MCP stdio Server (Debug)"
137- 4 . Press ` F5 ` or click the green play button
138- 5 . Connect MCP Inspector or run your LangChain script to trigger breakpoints
139- - For HTTP: ` npx @modelcontextprotocol/inspector http://localhost:8000/mcp `
140- - For stdio: ` npx @modelcontextprotocol/inspector uv run basic_mcp_stdio.py ` (start without debugger first)
118+ ** Attach to MCP Server (stdio)** : Attaches to server started via ` expenses-mcp-debug ` in ` mcp.json `
141119
142- #### Option 2: Attach to Running Server ( Copilot Integration)
120+ To debug an MCP server with GitHub Copilot Chat:
143121
144- 1 . Set breakpoints in your MCP server file
145- 1 . Start the debug server via ` mcp.json ` configuration:
146- - Select ` expenses-mcp-debug ` or ` expenses-mcp-http-debug `
122+ 1 . Set breakpoints in the MCP server code in ` servers/basic_mcp_stdio.py `
123+ 1 . Start the debug server via ` mcp.json ` configuration by selecting ` expenses-mcp-debug `
1471241 . Press ` Cmd+Shift+D ` to open Run and Debug
148- 1 . Select appropriate "Attach to MCP Server" configuration
149- 1 . Press ` F5 ` to attach
150- 1 . Select correct expense mcp server in GitHub Copilot Chat tools
125+ 1 . Select "Attach to MCP Server (stdio) " configuration
126+ 1 . Press ` F5 ` or the play button to start the debugger
127+ 1 . Select the expenses- mcp-debug server in GitHub Copilot Chat tools
1511281 . Use GitHub Copilot Chat to trigger the MCP tools
152- 1 . Debugger pauses at breakpoints
153-
154- ## License
155-
156- MIT
129+ 1 . Debugger pauses at breakpoints
0 commit comments