update readme for new features

This commit is contained in:
samanhappy
2025-04-12 22:47:28 +08:00
parent 5532c19305
commit c55cb79720
6 changed files with 366 additions and 84 deletions

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -16,17 +16,85 @@ MCPHub is a unified hub server that consolidates multiple MCP (Model Context Pro
## Quick Start ## Quick Start
### Using Docker ### Configuration (Optional but Recommended)
Run the following command to quickly launch MCPHub: - Customize your MCP server settings by creating the `mcp_settings.json` file. For example:
```json
{
"mcpServers": {
"amap-maps": {
"command": "npx",
"args": [
"-y",
"@amap/amap-maps-mcp-server"
],
"env": {
"AMAP_MAPS_API_KEY": "your-api-key"
}
},
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--headless"
]
},
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch"
]
},
"slack": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-slack"
],
"env": {
"SLACK_BOT_TOKEN": "your-bot-token",
"SLACK_TEAM_ID": "your-team-id"
}
}
},
"users": [
{
"username": "admin",
"password": "$2b$10$Vt7krIvjNgyN67LXqly0uOcTpN0LI55cYRbcKC71pUDAP0nJ7RPa.",
"isAdmin": true
}
]
}
```
- The above example includes the `amap-maps`, `playwright`, `fetch`, and `slack` servers. You can add or remove servers as needed.
- The `users` section allows you to set up user authentication. The default root user is `admin` with the password `admin123`. You can change them as needed.
- The password is hashed using bcrypt. You can generate a new password hash using the following command:
```bash
npx bcryptjs your-password
```
### Starting MCPHub with Docker
Run the following command to quickly launch MCPHub with default settings:
```bash ```bash
docker run -p 3000:3000 samanhappy/mcphub docker run -p 3000:3000 samanhappy/mcphub
``` ```
Run the following command to launch MCPHub with custom settings:
```bash
docker run -p 3000:3000 -v ./mcp_settings.json:/app/mcp_settings.json samanhappy/mcphub
```
### Dashboard Access ### Dashboard Access
Open your web browser and navigate to: `http://localhost:3000` Open your web browser and navigate to: `http://localhost:3000`, then login using the credentials you set in the `mcp_settings.json` file.
The default credentials are:
- **Username**: `admin`
- **Password**: `admin123`
The dashboard provides: The dashboard provides:
- **Real-Time Monitoring**: Keep an eye on the status of all MCP servers. - **Real-Time Monitoring**: Keep an eye on the status of all MCP servers.
@@ -49,22 +117,7 @@ git clone https://github.com/samanhappy/mcphub.git
### Optional Configuration ### Optional Configuration
Customize your MCP server settings by editing the `mcp_settings.json` file. For example: Customize your MCP server settings by editing the `mcp_settings.json` file.
```json
{
"mcpServers": {
"time-mcp": {
"command": "npx",
"args": ["-y", "time-mcp"]
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}
```
### Start the Development Server ### Start the Development Server
@@ -78,12 +131,8 @@ cd mcphub && pnpm install && pnpm dev
MCPHub started as a small side project that I developed on a whim, and I'm amazed at the attention it has received. Thank you all for your support! MCPHub started as a small side project that I developed on a whim, and I'm amazed at the attention it has received. Thank you all for your support!
Currently, MCPHub still has many areas that need optimization and improvement. I've created a dedicated WeChat group for discussions and feedback. If you're interested in this project, you're welcome to join us and contribute! Currently, MCPHub still has many areas that need optimization and improvement. Any contributions, whether in the form of code, documentation, or suggestions, are more than welcome.
![WeChat Group](assets/wegroup.jpg)
## License ## License
This project is licensed under the [MIT License](LICENSE). This project is licensed under the [Apache 2.0 license](LICENSE).

View File

@@ -2,33 +2,100 @@
[English Version](README.md) | 中文版 [English Version](README.md) | 中文版
MCPHub 是一款统一的中心服务,可以将多个 MCPModel Context Protocol服务整合为一个 SSE 端点。它通过提供一个集中的管理界面来简化服务管理,满足您对 MCP 服务的所有需求。 MCPHub 是一个集中管理的 MCP 服务器聚合平台,可以将多个 MCPModel Context Protocol服务整合为一个 SSE 端点。它通过提供一个集中的管理界面来简化服务管理,满足您对 MCP 服务的所有需求。
![仪表盘预览](assets/dashboard.png) ![控制面板预览](assets/dashboard.zh.png)
## 功能 ## 功能
- **内置精选 MCP 服务**:默认安装 `amap-maps``playwright``slack` 等热门服务,开箱即用。 - **内置精选 MCP 服务**:默认安装 `amap-maps``playwright``slack` 等热门服务,开箱即用。
- **集中管理**:通过单一中心轻松管理多个 MCP 服务。 - **集中管理**:通过单一中心轻松管理多个 MCP 服务。
- **协议兼容**:同时支持 stdio 与 SSE MCP 协议,确保无缝对接。 - **协议兼容**:同时支持 stdio 与 SSE MCP 协议,确保无缝对接。
- **直观仪表盘**:通过 Web 界面实时监控服务状态,并动态管理服务。 - **直观控制面板**:通过 Web 界面实时监控服务状态,并动态管理服务。
- **灵活配置**:无需重启中心服务即可添加、移除或重新配置 MCP 服务。 - **灵活配置**:无需重启中心服务即可添加、移除或重新配置 MCP 服务。
## 快速开始 ## 快速开始
### 使用 Docker 部署 ### 配置(可选但推荐)
运行以下命令即可快速启动 MCPHub - 你可以通过创建 `mcp_settings.json` 文件来自定义 MCP 服务器设置,例如
```json
{
"mcpServers": {
"amap-maps": {
"command": "npx",
"args": [
"-y",
"@amap/amap-maps-mcp-server"
],
"env": {
"AMAP_MAPS_API_KEY": "your-api-key"
}
},
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--headless"
]
},
"fetch": {
"command": "uvx",
"args": [
"mcp-server-fetch"
]
},
"slack": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-slack"
],
"env": {
"SLACK_BOT_TOKEN": "your-bot-token",
"SLACK_TEAM_ID": "your-team-id"
}
}
},
"users": [
{
"username": "admin",
"password": "$2b$10$Vt7krIvjNgyN67LXqly0uOcTpN0LI55cYRbcKC71pUDAP0nJ7RPa.",
"isAdmin": true
}
]
}
```
- 上述示例中包含 `amap-maps`、`playwright`、`fetch` 和 `slack` 服务器,你可以根据需要增减服务器。
- `users` 部分允许你设置用户认证。默认的 root 用户为 `admin`,密码为 `admin123`,你可以根据需要进行更改。
- 密码使用 bcrypt 进行哈希处理。你可以使用以下命令生成新密码的哈希值:
```bash
npx bcryptjs your-password
```
### 启动
运行以下命令即可使用默认配置快速启动 MCPHub
```bash ```bash
docker run -p 3000:3000 samanhappy/mcphub docker run -p 3000:3000 samanhappy/mcphub
``` ```
### 仪表盘访问 运行以下命令可使用自定义配置启动 MCPHub
在浏览器中打开以下地址: `http://localhost:3000` ```bash
docker run -p 3000:3000 -v ./mcp_settings.json:/app/mcp_settings.json samanhappy/mcphub
```
仪表盘提供以下功能: ### 控制面板访问
在浏览器中打开 `http://localhost:3000` 并使用你在 `mcp_settings.json` 文件中设置的凭据登录。默认凭据为:
- **用户名**`admin`
- **密码**`admin123`
控制面板提供以下功能:
- **实时监控**:随时查看所有 MCP 服务的运行状态。 - **实时监控**:随时查看所有 MCP 服务的运行状态。
- **服务状态指示**:快速识别各服务是否在线。 - **服务状态指示**:快速识别各服务是否在线。
- **动态管理**:无需重启即可动态添加或移除 MCP 服务。 - **动态管理**:无需重启即可动态添加或移除 MCP 服务。
@@ -39,9 +106,9 @@ docker run -p 3000:3000 samanhappy/mcphub
## 本地开发 ## 本地开发
### 克隆代码 ### 克隆
请使用以下命令克隆 MCPHub 仓库 从 GitHub 克隆 MCPHub
```bash ```bash
git clone https://github.com/samanhappy/mcphub.git git clone https://github.com/samanhappy/mcphub.git
@@ -49,37 +116,22 @@ git clone https://github.com/samanhappy/mcphub.git
### 可选配置 ### 可选配置
通过编辑 `mcp_settings.json` 文件来自定义 MCP 服务设置。例如: 通过编辑 `mcp_settings.json` 文件来自定义 MCP 服务设置。
```json ### 启动开发服务器
{
"mcpServers": {
"time-mcp": {
"command": "npx",
"args": ["-y", "time-mcp"]
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}
```
### 启动开发服务 进入项目目录,安装依赖并启动 MCPHub
安装依赖并启动 MCPHub
```bash ```bash
cd mcphub && pnpm install && pnpm dev cd mcphub && pnpm install && pnpm dev
``` ```
## 社区与共建 ## 社区与贡献
MCPHub 只是我一时兴起开发的小项目,没想到竟收获了这么多关注,非常感谢大家的支持!目前 MCPHub 还有不少地方需要优化和完善,我也专门建了个交流群,方便大家交流反馈。如果你也对这个项目感兴趣,欢迎一起参与建设! MCPHub 只是我一时兴起开发的小项目,没想到竟收获了这么多关注,非常感谢大家的支持!目前 MCPHub 还有不少地方需要优化和完善,我也专门建了个交流群,方便大家交流反馈。如果你也对这个项目感兴趣,欢迎一起参与建设!
![微信交流](assets/wegroup.jpg) ![微信群](assets/wegroup.jpg)
## 许可证 ## 许可证
本项目采用 [MIT 许可证](LICENSE)。 本项目采用 [Apache 2.0 许可证](LICENSE)。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/dashboard.zh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,11 +1,4 @@
{ {
"users": [
{
"username": "admin",
"password": "$2b$10$Vt7krIvjNgyN67LXqly0uOcTpN0LI55cYRbcKC71pUDAP0nJ7RPa.",
"isAdmin": true
}
],
"mcpServers": { "mcpServers": {
"amap-maps": { "amap-maps": {
"command": "npx", "command": "npx",
@@ -24,32 +17,12 @@
"--headless" "--headless"
] ]
}, },
"tavily-mcp": {
"command": "npx",
"args": [
"-y",
"tavily-mcp@latest"
],
"env": {
"TAVILY_API_KEY": "your-api-key"
}
},
"fetch": { "fetch": {
"command": "uvx", "command": "uvx",
"args": [ "args": [
"mcp-server-fetch" "mcp-server-fetch"
] ]
}, },
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-access-token"
}
},
"slack": { "slack": {
"command": "npx", "command": "npx",
"args": [ "args": [
@@ -61,5 +34,12 @@
"SLACK_TEAM_ID": "your-team-id" "SLACK_TEAM_ID": "your-team-id"
} }
} }
},
"users": [
{
"username": "admin",
"password": "$2b$10$Vt7krIvjNgyN67LXqly0uOcTpN0LI55cYRbcKC71pUDAP0nJ7RPa.",
"isAdmin": true
} }
]
} }