maolaoban
MCP Servermaolaobanpublic

mcp tutorial

一个关于如何使用 VS Code 中的 Cline 插件并配置 MCP 服务器的教程。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

About This Server

一个关于如何使用 VS Code 中的 Cline 插件并配置 MCP 服务器的教程。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

使用VS Code中的Cline插件

  • Installed -> Configure MCP Server

设置cline_mcp_settings.json

{
  "mcpServers": {
    "weather": {
      "command": "node",
      "args": [
        "F:\\code\\mcp-tutorial\\build\\index.js"
      ]
    }
  }
}

MCP使用JSON-RPC2.0作为客户端和服务器之间所有通信的消息格式。该协议定义了三种类型的消息:

1.请求(Request)
  • 唯一标识符(id)
  • 要调用的方法名称(例如,tools/call)
  • 方法的参数(如果有)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "weather",
    "arguments": {
      "location": "San Francisco"
    }
  }
}
2.响应(Responses)
  • 与对应Request相同的id
  • 结果(成功)或错误(失败)
// 成功
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "temperature": 62,
    "conditions": "Partly cloudy"
  }
}
// 失败
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "Invalid location parameter"
  }
}
3.通知(Notifications)
  • 不需要响应的单向消息。通常从 Server 发送到 Client,以提供有关事件的更新或通知。
{
  "jsonrpc": "2.0",
  "method": "progress",
  "params": {
    "message": "Processing data...",
    "percent": 50
  }
}

JSON-RPC 定义了消息格式,但 MCP 还指定了这些消息如何在客户端和服务器之间传输。支持两种主要传输机制:

  • stdio (标准输入/输出):stdio 传输用于本地通信,其中 Client 和 Server 运行在同一台机器上
  • HTTP + SSE (Server-Sent Events) / Streamable HTTP:HTTP+SSE 传输用于远程通信,其中 Client 和 Server 可能位于不同的计算机上

Quick Start

1

Clone the repository

git clone https://github.com/maolaoban/mcp-tutorial
2

Install dependencies

cd mcp-tutorial
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownermaolaoban
Repomcp-tutorial
LanguageTypeScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation