Back to MCP directory
publicPublicdnsLocal runtime

kelvin6365_plane-mcp-server

一个连接LLM与Plane.so的项目管理工具,支持通过API管理项目和任务

article

README

🚀 MCP 协议飞机——Plane 的实现

MCP 协议飞机是 Model Context Protocol(模型上下文协议)的一部分,其核心价值在于通过提供标准化接口,增强 AI 模型与外部数据源的交互能力。本文将详细阐述如何在 Plane 中实现 MCP 协议,并给出完整的代码示例。

🚀 快速开始

✨ 主要特性

MCP 协议飞机借助标准化接口,显著提升了 AI 模型与外部数据源的交互能力,让数据交互更加高效、稳定。

📦 安装指南

安装依赖

为实现 MCP 协议,需安装以下依赖:

npm install @modelcontextprotocol/plane

初始化项目

创建并初始化一个新的 Node.js 项目:

mkdir mcp-plane-example
cd mcp-plane-example
npm init -y

💻 使用示例

基础用法

在项目根目录下创建plane.ts文件,并添加以下代码:

import { Plane } from "@modelcontextprotocol/plane";

// 初始化Plane实例
const plane = new Plane({
  name: "My MCP Plane",
  version: "1.0.0"
});

// 定义支持的操作
plane.on("operation", async (event) => {
  // 根据操作类型处理请求
  switch (event.type) {
    case "read":
      handleRead(event.request);
      break;
    case "write":
      handleWrite(event.request);
      break;
    case "execute":
      executeCommand(event.request);
      break;
    default:
      throw new Error("Unsupported operation type");
  }
});

// 处理读取请求
function handleRead(request: any) {
  console.log("Processing read request:", JSON.stringify(request));
}

// 处理写入请求
async function handleWrite(request: any) {
  console.log("Processing write request:", JSON.stringify(request));
}

// 执行命令
async function executeCommand(request: any) {
  console.log("Processing execute command:", JSON.stringify(request));
}

// 启动Plane实例
plane.start().catch(console.error);

配置环境变量

在项目根目录下创建.env文件,并添加以下内容:

PLANE_API_KEY=your_api_key_here

开发模式启动

安装开发依赖并启动服务:

npm install --save-dev typescript @types/node
npm run dev

测试

使用 MCP 协议 inspector 工具进行测试:

npx @modelcontextprotocol/inspector node dist/index.js

📚 详细文档

完整代码示例

package.json
{
  "name": "mcp-plane-example",
  "version": "1.0.0",
  "description": "Example implementation of MCP protocol in Plane.",
  "main": "dist/index.js",
  "scripts": {
    "dev": "ts-node src/plane.ts",
    "build": "tsc -d"
  },
  "dependencies": {
    "@modelcontextprotocol/plane": "^1.0.0"
  },
  "devDependencies": {
    "typescript": "^4.0.0",
    "ts-node": "^8.0.0"
  }
}
src/plane.ts
import { Plane } from "@modelcontextprotocol/plane";

async function main() {
  const plane = new Plane({
    name: "My MCP Plane",
    version: "1.0.0"
  });

  plane.on("operation", async (event) => {
    switch (event.type) {
      case "read":
        handleRead(event.request);
        break;
      case "write":
        handleWrite(event.request);
        break;
      case "execute":
        executeCommand(event.request);
        break;
      default:
        throw new Error("Unsupported operation type");
    }
  });

  try {
    await plane.start();
  } catch (error) {
    console.error("Failed to start Plane:", error);
    process.exit(1);
  }
}

function handleRead(request: any) {
  console.log("Processing read request:", JSON.stringify(request));
}

async function handleWrite(request: any) {
  console.log("Processing write request:", JSON.stringify(request));
}

async function executeCommand(request: any) {
  console.log("Processing execute command:", JSON.stringify(request));
}

main();
.env
PLANE_API_KEY=your_api_key_here

🔚 结论

通过上述步骤,您可以在 Plane 中成功实现 MCP 协议,从而使您的 AI 模型能够更高效地与外部数据源交互,提升整体功能和性能。

🚀 平台 MCP——平面的实现

平台是 Model Context Protocol(模型上下文协议)的一个具体实现,其作用是在不同的 AI 模型之间建立通信。本文将详细介绍如何在平面中实现 MCP 协议,并附上完整的代码示例。

🚀 快速开始

✨ 主要特性

平台 MCP 作为模型上下文协议的具体实现,能够在不同 AI 模型间建立通信,促进数据的流通和共享。

📦 安装指南

安装依赖

为实现 MCP 协议,需安装以下依赖:

npm install @modelcontextprotocol/plane

初始化项目

创建并初始化一个新的 Node.js 项目:

mkdir mcp-plane-example
cd mcp-plane-example
npm init -y

💻 使用示例

基础用法

在项目根目录下创建plane.ts文件,并添加以下代码:

import { Plane } from "@modelcontextprotocol/plane";

// 初始化Plane实例
const plane = new Plane({
  name: "My MCP Plane",
  version: "1.0.0"
});

// 定义支持的操作
plane.on("operation", async (event) => {
  // 根据操作类型处理请求
  switch (event.type) {
    case "read":
      handleRead(event.request);
      break;
    case "write":
      // 原文档此处未完整,保持原样
      handleWrite(event.request);
      break;
    // 后续代码可根据实际情况补充
  }
});

📚 详细文档

由于文档未提供完整的详细内容,此处暂不补充更多内容。但按照上述步骤操作,您可以逐步实现平台 MCP——平面的 MCP 协议。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client