DM

daghanacay/mcp-workshop

开发工具

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

6 stars 3 forks 质量 58 趋势 14

We are going to build an MCP server and integrate it into multiple agentic applications. MCP can be compared to REST API as discussed here https://docs.roocode.com/features/mcp/mcp-vs-api.

概览

We are going to build an MCP server and integrate it into multiple agentic applications. MCP can be compared to REST API as discussed here https://docs.roocode.com/features/mcp/mcp-vs-api. In summary, REST APIs and MCP serve different tiers in the technology stack: - REST: Low-level web communication pattern that exposes operations on resources - MCP: High-level AI protocol that orchestrates tool usage and maintains context MCP often uses REST APIs internally, but abstracts them away for the AI. Think of MCP as middleware that turns discrete web services into a cohesive environment the AI can operate within. Detailed instructions can be found here https://docs.astral.sh/uv/getting-started/installation/ Roo is our development environment that helps us build code. Roo is a generic tool that connects to LLM backend, in particular Claude, to help speed up development.

README

以下为原文 README 节选,完整内容请查看原文。

Introduction

We are going to build an MCP server and integrate it into multiple agentic applications. MCP can be compared to REST API as discussed here https://docs.roocode.com/features/mcp/mcp-vs-api. In summary, REST APIs and MCP serve different tiers in the technology stack:

  • REST: Low-level web communication pattern that exposes operations on resources
  • MCP: High-level AI protocol that orchestrates tool usage and maintains context

MCP often uses REST APIs internally, but abstracts them away for the AI. Think of MCP as middleware that turns discrete web services into a cohesive environment the AI can operate within.

Set up uv - Python package manager

For Linux run:

curl -LsSf https://astral.sh/uv/install.sh | sh

Detailed instructions can be found here https://docs.astral.sh/uv/getting-started/installation/

Set up Roo

Set up Roo plugin

Roo is our development environment that helps us build code. Roo is a generic tool that connects to LLM backend, in particular Claude, to help speed up development.

Open VS Code Access Extensions: Click the Extensions icon in the Activity Bar or press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS) Search for “Roo Code” Select “Roo Code” by RooVeterinaryInc and click Install Reload VS Code if prompted

Please see details of setting up Roo here https://docs.roocode.com/getting-started/installing

Set up LLM backend

In order to set up the AI (LLM) backend, we will use Anthropic here.

Go to console.anthropic.com Sign up for an account or log in Navigate to the API keys section and create a new key Important: Copy your API key immediately as it won’t be displayed again

Once you have your API key:

Open the Roo Code sidebar by clicking the Roo Code icon in the VS Code Activity Bar In the welcome screen, select your API provider from the dropdown Paste your API key into the appropriate field In the dropdown, select any model you like; newer models will be more costly. I will use Claude 4.0 Opus, the most powerful and expensive yet.

Please refer to Connect to AI backend https://docs.roocode.com/getting-started/connecting-api-provider for more details.

Also turn off “Enable MCP server Creation” tag in the MCP server settings, third from left at the top of Roo code plugin interface. We will provide context for LLM in the following section.

Set up knowledge of MCP as context for your LLM code platform

We are following Building MCP with LLMs - https://modelcontextprotocol.io/tutorials/building-mcp-with-llms

在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector node path/to/server/index.js args...
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "file-server": { "command": "node", "args": ["/path/to/mcp-file-server/dist/index.js", "/path/to/base/folder"], "env": {} } } }