W

Wordware主控程序服务器

@yuhuangou/wordware-mcp
0 Stars 364 次浏览 yuhuangou 更新于 2026-08-23

一个主控程序服务器,允许开发人员本地运行Wordware AI流程,从而将Wordware的AI功能直接集成到本地开发环境中。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "wordware": {
      "command": "wordware-mcp"
    }
  }
}

该服务需要配置环境变量:PORT、WORDWARE_API_KEY

服务介绍

wordware-mcp

Wordware MCP(主控程序)服务器允许您在本地运行Wordware应用程序。这使您可以直接将Wordware强大的AI流程集成到本地开发环境中,从而更轻松地测试和开发利用Wordware功能的应用程序。

版本1.1.5的新功能

  • 更新以支持新的本地API端点 (http://localhost:9000/{WORDWARE_API_TOKEN})
  • 不再需要指定APP_IDs - 工具会自动发现
  • 通过npx wordware-mcp进行交互式安装过程
  • 自动Claude配置设置
  • 增强的CLI界面,支持命令行参数
  • 直接通过参数指定API密钥
  • 改进的错误处理和日志记录
  • 使用简单的命令语法支持全局安装

安装

最简单的方法是使用npx进行交互式安装过程:

npx wordware-mcp

这将引导您完成以下步骤:

  1. 输入您的Wordware API密钥
  2. 设置Claude配置(可选)

npx命令将:

  • 如果未提供配置详情,则提示输入
  • 创建必要的配置文件
  • 设置您的本地环境以运行Wordware应用

运行npx命令后,您可以使用以下命令启动MCP服务器:

npx wordware-mcp

永久安装

如果您希望永久安装此软件包:

# Install globally from npm registry
npm install -g wordware-mcp

# Or install locally in your project
npm install wordware-mcp

# Or clone this repository and install globally
git clone https://github.com/yuhuangou/wordware-mcp.git
cd wordware-mcp
npm run install-global

先决条件

在使用此软件包之前,您需要:

  1. 一个Wordware账户(在wordware.ai注册)
  2. 一个Wordware API密钥
  3. 至少部署了一个Wordware应用

基本用法

直接使用npx(无需安装)

您可以不先安装就直接通过npx运行wordware-mcp:

# Interactive mode - will prompt for required information
npx wordware-mcp

# Or with command line parameters
npx wordware-mcp --api-key your-api-key --port 3000

# Start MCP server after configuration
npx wordware-mcp start

作为全局命令

如果已全局安装,可以通过以下两种方式之一运行:

# Option 1: Create an .env file in your current directory first (see Configuration section)
wordware-mcp

# Option 2: Pass parameters directly via command line
wordware-mcp --api-key your-api-key --port 3000

命令行选项

Options:
  --api-key, -k <key>      Wordware API key (required unless in .env file)
  --port, -p <port>        Port to run the server on (default: 3000)
  --help, -h               Show this help message

作为项目中的软件包

// In your script
import { startMCP } from "wordware-mcp";

// Start the MCP server
startMCP();

配置

您可以采用以下两种方式之一配置MCP服务器:

1. 环境变量或.env文件

创建一个包含以下变量的.env文件:

WORDWARE_API_KEY=your-api-key
PORT=3000

2. 命令行参数

运行命令时直接传递配置:

wordware-mcp -k your-api-key -p 3000

创建您的Wordware设置

创建账户

首先,您需要一个Wordware账户。前往wordware.ai,登录并创建账户。

创建API密钥

为了让您的Wordware流程能够通过MCP访问,您需要创建一个API密钥。为此,请点击右上角的个人资料图片 > API keys > 创建新密钥 > 复制您的密钥。

创建应用

现在是时候发挥创意了。为实现您的目标创建一个Wordware应用,或者随意从探索页面(https://app.wordware.ai/explore)分叉一个应用。

部署您的应用

为了使您的应用能够被MCP触发,您需要将其部署。为此,请转到您的应用。您应该能在右上角看到一个“Deploy”按钮。然后转到部署页面。

获取app_id

请注意,原文中具体的命令示例(如#0, #1等)没有给出具体的内容,所以在翻译时保持了这些占位符不变。如果有具体的命令内容,可以进一步补充完整。

在部署页面上,您会看到您的部署 URL:https://app.wordware.ai/explore/apps/{app_id}。从那里获取您的 app_id。

与 Claude Desktop 一起使用

要将此 MCP 服务器与 Claude Desktop 一起使用:

  1. 确保已安装 Claude for Desktop

  2. 修改位于以下位置的 Claude 桌面配置文件:
    ~/Library/Application\ Support/Claude/claude_desktop_config.json

  3. 在文件中添加以下内容:

{
  "mcpServers": {
    "wordware": {
      "command": "wordware-mcp"
    }
  }
}

完整的工作流示例

这里是一个完整的工作流示例,以帮助您快速启动并运行:

1. 配置并启动 Wordware MCP

# Run the interactive setup
npx wordware-mcp

# Follow the prompts to:
# - Enter your Wordware API key
# - Configure Claude integration (if desired)

# Once configured, start the server
npx wordware-mcp start

2. 与您的应用程序集成

启动 MCP 服务器后,您的 Wordware 应用程序将在以下位置访问:

http://localhost:3000/api/run/{app_id}

您可以使用 HTTP 请求触发您的 Wordware 流程:

// Example: Calling your Wordware app from JavaScript
async function callWordwareApp() {
  const response = await fetch("http://localhost:3000/api/run/your-app-id", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      // Your input data here
      prompt: "Your prompt to the AI model",
      // Any other parameters your Wordware app expects
    }),
  });

  const result = await response.json();
  console.log(result);
}

3. 使用热重载开发

在开发过程中,您对 Wordware 应用程序所做的任何更改都会立即生效 - 只需刷新您的应用程序或发出新的 API 调用即可。

开发

如果您想为这个包做出贡献:

# Clone the repository
git clone https://github.com/yuhuangou/wordware-mcp.git
cd wordware-mcp

# Install dependencies
npm install

# Build the package
npm run build

# Run in development mode
npm run dev

许可证

MIT

故障排除

npx 常见问题

  1. 安装后出现“命令未找到”

    如果您在使用 npx 安装后看到 command not found

    # 确保全局安装了该包
    npm install -g wordware-mcp
    
    # 检查您的 npm 全局路径是否在 PATH 中
    npm config get prefix
    # 如有需要,将结果路径 + /bin 添加到您的 PATH 中
    
  2. 配置问题

    如果您的配置未被检测到:

    # 检查当前目录下是否存在 .env 文件
    ls -la .env
    
    # 手动带参数运行以绕过 .env
    npx wordware-mcp --api-key your-api-key
    
  3. 连接被拒绝错误

    如果在尝试使用您的应用程序时遇到连接错误:

    # 检查服务器是否正在运行
    lsof -i :3000
    
    # 以详细日志模式重启服务器
    npx wordware-mcp start --verbose
    
  4. 权限问题

    如果您遇到 npx 的权限错误:

    # 使用 sudo 运行(不推荐作为永久解决方案)
    sudo npx wordware-mcp
    
    # 修复 npm 权限
    chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
    

如需更多帮助,请在我们的 GitHub 仓库中提交一个问题。

环境变量

可以在 .env 文件中设置以下环境变量:

  • PORT - 服务器运行的端口(默认:3000)
  • WORDWARE_API_KEY - 您的 Wordware API 密钥

相关 MCP 服务