Download the PHP package x2nx/webman-mcp without Composer

On this page you can find all versions of the php package x2nx/webman-mcp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package webman-mcp

webman-mcp

![webman-mcp](https://img.shields.io/badge/webman-mcp-blue?style=for-the-badge&logo=php) ![PHP](https://img.shields.io/badge/PHP-8.1+-777BB4?style=for-the-badge&logo=php&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge) ![Version](https://img.shields.io/badge/Version-0.1.3-orange?style=for-the-badge) **基于 MCP (Model Context Protocol) SDK 的 webman 插件,快速创建高性能 MCP 服务器** [快速开始](#-快速开始) • [创建组件](#️-创建组件) • [消息处理](#-消息处理) • [配置说明](#️-配置说明) • [常见问题](#-常见问题)

✨ 核心特性

📦 安装

环境要求

安装步骤

🚀 快速开始

1. 启动服务

2. 测试连接

HTTP 流式传输测试

SSE 模式测试

🛠️ 创建组件

webman-mcp 提供了强大的命令行工具,帮助您快速创建各种 MCP 组件。

创建工具 (Tools)

创建提示 (Prompts)

创建资源 (Resources)

创建资源模板 (Resource Templates)

💡 提示: 创建组件后,重启服务即可自动发现新组件

💬 消息处理

webman-mcp 提供了灵活的消息处理机制,支持在代码中直接处理 MCP 消息。

全局辅助函数

插件提供了两个全局辅助函数,方便在项目任何地方使用:

mcp_server_handle_message() - 处理消息

函数签名:

参数说明:

返回值:

mcp_server() - 获取服务器实例

函数签名:

使用 Server 类

如果需要更多控制,可以直接使用 Server 类:

使用场景

  1. API 接口处理 - 在 webman 路由中处理 MCP 消息

  2. 队列任务 - 异步处理 MCP 消息

  3. 命令行工具 - 在 CLI 中处理 MCP 消息

  4. 测试用例 - 单元测试和集成测试

⚙️ 配置说明

配置文件位置

编辑 config/plugin/x2nx/webman-mcp/mcp.php 文件:

配置项说明

配置项 说明 类型 默认值
server.name 服务器名称 string MCP Server
server.version 服务器版本 string 1.0.0
server.description 服务器描述 string -
server.protocol_version MCP 协议版本 ProtocolVersion V2025_06_18
server.pagination 分页大小 int 50
server.instructions 服务器指令描述 string ''
server.capabilities 服务器能力配置 array []
discover.scan_dirs 组件扫描目录 array ['app/mcp']
discover.exclude_dirs 排除扫描目录 array 见配置示例
discover.cache.enable 启用发现缓存 bool false
discover.cache.ttl 缓存过期时间(秒) int 3600
discover.cache.store 缓存存储名称 string ''
transport.sse.enable 启用 SSE 传输 bool true
transport.sse.route SSE 路由端点 array ['/sse', '/message']
transport.stream.enable 启用流式传输 bool true
transport.stream.route 流式传输路由端点 array ['/mcp']
session.ttl 会话过期时间(秒) int 3600
session.store 会话存储名称 string ''

🚀 部署

生产环境部署

性能优化建议

  1. 启用组件发现缓存 - 减少文件扫描开销

  2. 使用 Redis 缓存 - 提升会话和发现缓存性能

  3. 调整 Worker 进程数 - 根据服务器配置调整

📋 常见问题

Q: 插件安装后没有发现任何组件?

A: 这是正常现象。插件安装后 app/mcp 目录为空,需要使用命令行工具创建组件:

Q: 如何自定义传输协议端口?

A: 修改 webman 配置文件 config/server.php:

Q: 如何启用发现缓存?

A: 在配置文件中设置:

Q: 如何使用消息处理功能?

A: 可以使用全局辅助函数或 Server 类:

Q: 消息处理的响应格式是什么?

A: 返回一个数组,每个元素包含 session_id 和 mcp_message:

Q: 如何处理 SSE 会话管理?

A: SSE 模式会自动管理会话,您只需要:

  1. 通过 GET /sse 建立连接,获取 sessionId
  2. 使用该 sessionId 通过 POST /message?sessionId=xxx 发送消息
  3. 服务器会自动维护会话状态

Q: 如何查看日志?

A: 日志文件位于 runtime/logs/ 目录:

🤝 贡献

我们欢迎所有形式的贡献!

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

📄 许可证

本项目采用 LICENSE 文件了解详情。

🔗 相关链接


**如果这个项目对您有帮助,请给我们一个 ⭐️** Made with ❤️ by [x2nx](https://github.com/x2nx)

All versions of webman-mcp with dependencies

PHP Build Version
Package Version
Requires mcp/sdk Version dev-main
psr/simple-cache Version ^3.0
webman/console Version ^2.1
webman/channel Version ^2.1
webman/redis Version ^2.1
webman/cache Version ^2.1
nyholm/psr7 Version ^1.8
nyholm/psr7-server Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package x2nx/webman-mcp contains the following files

Loading the files please wait ...