mcpField
W
wordware-mcp

wordware-mcp

本地服务
github.com/yuhuangouAI 与智能体082 周前更新

关于 wordware-mcp

wordware-mcp 是一款本地 MCP 服务,可在开发环境中运行已部署的 Wordware 应用。它会自动发现可用应用,并提供交互式安装和命令行配置。

主要功能

  1. 01在本地运行 Wordware 应用
  2. 02自动发现工具
  3. 03通过 npx 交互式设置
  4. 04配置 API 密钥和端口
  5. 05设置 Claude 配置

适用场景

  1. 01开发期间测试已部署的 Wordware 应用
  2. 02通过 MCP 客户端运行 Wordware 工作流
  3. 03使用 API 密钥配置本地服务

MCP 相关

该 MCP 服务将已部署的 Wordware 应用作为工具提供给 MCP 客户端。服务使用 Wordware API 密钥,并自动发现应用,无需指定 APP_ID。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"wordware": {
"command": "npx",
"args": [
"-y",
"wordware-mcp"
]
}
}
}
启动命令npx -y wordware-mcp

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmwordware-mcp

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

wordware-mcp

Wordware MCP(Model Context Protocol)服务允许你在本地运行 Wordware 应用。这样,你就可以将 Wordware 强大的 AI 工作流直接集成到本地开发环境中,从而更轻松地测试和开发利用 Wordware 功能的应用。

1.1.5 版本的新功能

  • 更新为使用新的本地 API 端点(http://localhost:9000/{WORDWARE_API_TOKEN})
  • 不再需要指定 APP_ID,工具会自动发现
  • 使用 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/{username}/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 密钥

要通过 MCP 访问你的 Wordware 工作流,你需要创建 API 密钥。点击右上角的个人资料图片 > API 密钥 > 创建新密钥 > 复制密钥

创建应用

现在可以开始发挥创意了。创建 Wordware 应用来实现你的目标,也可以从探索页面分叉应用(https://app.wordware.ai/explore)。

部署应用

要通过 MCP 触发应用,你需要部署它。前往你的应用,你应该会在右上角看到“Deploy”按钮。然后前往部署页面。

获取 app_id

在部署页面,你会看到部署 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. 安装后出现“Command not found”

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

    # Make sure the package is installed globally
    npm install -g wordware-mcp
    
    # Check your npm global path is in your PATH
    npm config get prefix
    # Add the resulting path + /bin to your PATH if needed
    
  2. 配置问题

    如果未检测到你的配置:

    # Check if .env file exists in current directory
    ls -la .env
    
    # Manually run with parameters to bypass .env
    npx wordware-mcp --api-key your-api-key
    
  3. 连接被拒绝错误

    如果尝试使用应用时看到连接错误:

    # Check if server is running
    lsof -i :3000
    
    # Restart server with verbose logging
    npx wordware-mcp start --verbose
    
  4. 权限问题

    如果使用 npx 时遇到权限错误:

    # Run with sudo (not recommended as permanent solution)
    sudo npx wordware-mcp
    
    # Fix npm permissions
    chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
    

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

环境变量

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

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

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。