A workshop on how MCP servers help you accelerate your development workflows
Ensure you have python 3.12+ installed
cd code
uv sync
uv venv
source .venv/bin/activate
With your virtual env activated run...
cd 0-mcp-demo/stdio/
python stdio_server.py
The terminal will say starting server
Now paste your JSON-RPC requests line by line, ignore lines starts with #
- Initialize the client
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
- initialize the notification
{"jsonrpc":"2.0","method":"notifications/initialized"}
Note: You won't receive a JSON response here
- list the tools
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
- call the tool get weather
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_weather","arguments":{"city":"London"}}}
1. Install mcp-inspector
npx @modelcontextprotocol/inspector
If you do not have node installed, use brew installation
brew install mcp-inspector
mcp-inspector
On the MCP inspector that opens on your browser http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<some-token-here> add
2. Note down two things
- Your python environment
- Type
which pythonyou will get an answer like this<YOUR_BASE_PATH>/mcp-for-ai-dev-course/code/.venv/bin/python
- Type
- Path to the
stdio_server.py- On vscode, Right click on the
stdio_server.pyfile and copy path<YOUR_BASE_PATH>/mcp-for-ai-dev-course/code/0-mcp-demo/stdio/stdio_client.py
- On vscode, Right click on the
Replace
YOUR_BASE_PATHwith right path according to your laptop
3. Add these to MCP inspector
- Under command - add python path
- Under Arguments - add stdio_server path
Note: You can also run
npx @modelcontextprotocol/inspector \
<YOUR_BASE_PATH>/mcp-for-ai-dev-course/code/.venv/bin/python \
<YOUR_BASE_PATH>/mcp-for-ai-dev-course/code/0-mcp-demo/stdio/stdio_server.py
- Create an account in context7 and copy your API Key, keep it aside
We are not affiliated with context7, just a tool that works well
-
You need Vscode + github copilot (free version should do) for this demo
-
Two ways to install MCP server
mcp.jsonor MCP extensions
- Create an airflow pipeline without mcp servers
- Highlight the disadvantages
- Enable MCP servers
- Add better instructions