TM

thelearningdev/mcp-ai-dev-workflow

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

19 stars 13 forks 质量 52 趋势 22

MCP AI Developer Workflow Course Materials and Demos

概览

A workshop on how MCP servers help you accelerate your development workflows Now paste your JSON-RPC requests line by line, ignore lines starts with # Note: You won't receive a JSON response here If you do not have node installed, use brew installation On the MCP inspector that opens on your browser http://localhost:6274/?MCP_PROXY_AUTH_TOKEN= add - Your python environment - Type which pythonyou will get an answer like this /mcp-for-ai-dev-course/code/.venv/bin/python - Path to the stdio_server.py - On vscode, Right click on the stdio_server.py file and copy path /mcp-for-ai-dev-course/code/0-mcp-demo/stdio/stdio_client.py Replace YOUR_BASE_PATH with right path according to your laptop 1. Under command - add python path 2. Under Arguments - add stdio_server path

README

MCP Servers and AI Dev Workflows

A workshop on how MCP servers help you accelerate your development workflows

Part 1: Intro to MCP

1. Setting up Python Environment

Ensure you have python 3.12+ installed

cd code
uv sync
uv venv
source .venv/bin/activate

2. Play with your server

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 #

  1. Initialize the client
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
  1. initialize the notification
{"jsonrpc":"2.0","method":"notifications/initialized"}

Note: You won’t receive a JSON response here

  1. list the tools
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
  1. call the tool get weather
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_weather","arguments":{"city":"London"}}}

3. Let’s visualize these features in MCP inspector

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= add

2. Note down two things

  • Your python environment
    • Type which pythonyou will get an answer like this /mcp-for-ai-dev-course/code/.venv/bin/python
  • Path to the stdio_server.py
    • On vscode, Right click on the stdio_server.py file and copy path /mcp-for-ai-dev-course/code/0-mcp-demo/stdio/stdio_client.py

Replace YOUR_BASE_PATH with right path according to your laptop

3. Add these to MCP inspector

  1. Under command - add python path
  2. Under Arguments - add stdio_server path

Note: You can also run

npx @modelcontextprotocol/inspector \
  /mcp-for-ai-dev-course/code/.venv/bin/python \
  /mcp-for-ai-dev-course/code/0-mcp-demo/stdio/stdio_server.py

Part 2: MCP on AI Dev workflow

  1. 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

  1. You need Vscode + github copilot (free version should do) for this demo

  2. Two ways to install MCP server mcp.json or MCP extensions

Demo workflow

  1. Create an airflow pipeline without mcp servers
  2. Highlight the disadvantages
  3. Enable MCP servers
  4. Add better instructions
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector
新手?先看 mcpskill.org 教程 →