mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-24 02:39:19 -05:00
feat: support server-specified endpoint (#58)
This commit is contained in:
14
README.md
14
README.md
@@ -115,6 +115,15 @@ Where `{group}` is the ID or name of the group you created in the dashboard. Thi
|
|||||||
- Isolate different AI tools to access only relevant servers
|
- Isolate different AI tools to access only relevant servers
|
||||||
- Implement more granular access control for different environments or teams
|
- Implement more granular access control for different environments or teams
|
||||||
|
|
||||||
|
**Server-Specific Endpoints**:
|
||||||
|
For direct access to individual servers, use the server-specific HTTP endpoint:
|
||||||
|
```
|
||||||
|
http://localhost:3000/mcp/{server}
|
||||||
|
```
|
||||||
|
Where `{server}` is the name of the server you want to connect to. This allows you to access a specific MCP server directly.
|
||||||
|
|
||||||
|
> **Note**: If the server name and group name are the same, the group name will take precedence.
|
||||||
|
|
||||||
### SSE Endpoint (Deprecated in Future)
|
### SSE Endpoint (Deprecated in Future)
|
||||||
|
|
||||||
Connect AI clients (e.g., Claude Desktop, Cursor, DeepChat, etc.) via:
|
Connect AI clients (e.g., Claude Desktop, Cursor, DeepChat, etc.) via:
|
||||||
@@ -127,6 +136,11 @@ For targeted access to specific server groups, use the group-based SSE endpoint:
|
|||||||
http://localhost:3000/sse/{group}
|
http://localhost:3000/sse/{group}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For direct access to individual servers, use the server-specific SSE endpoint:
|
||||||
|
```
|
||||||
|
http://localhost:3000/sse/{server}
|
||||||
|
```
|
||||||
|
|
||||||
## 🧑💻 Local Development
|
## 🧑💻 Local Development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
19
README.zh.md
19
README.zh.md
@@ -125,7 +125,18 @@ http://localhost:3000/mcp/{group}
|
|||||||
- 通过分组名称轻松识别和管理服务器
|
- 通过分组名称轻松识别和管理服务器
|
||||||
- 允许不同的 AI 客户端使用相同的端点,简化集成过程
|
- 允许不同的 AI 客户端使用相同的端点,简化集成过程
|
||||||
|
|
||||||
### SSE 端点集成 (即将废弃)
|
**针对特定服务器的 HTTP 端点**:
|
||||||
|
要针对特定服务器进行访问,请使用以下格式:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://localhost:3000/mcp/{server}
|
||||||
|
```
|
||||||
|
|
||||||
|
其中 `{server}` 是您要连接的服务器名称。这样做可以直接访问特定的 MCP 服务器。
|
||||||
|
|
||||||
|
> **提示**:如果服务器名称和分组名称相同,则分组名称优先。
|
||||||
|
|
||||||
|
### SSE 端点集成 (未来可能废弃)
|
||||||
|
|
||||||
通过以下地址连接 AI 客户端(如 Claude Desktop、Cursor、DeepChat 等):
|
通过以下地址连接 AI 客户端(如 Claude Desktop、Cursor、DeepChat 等):
|
||||||
|
|
||||||
@@ -139,6 +150,12 @@ http://localhost:3000/sse
|
|||||||
http://localhost:3000/sse/{group}
|
http://localhost:3000/sse/{group}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
要针对特定服务器进行访问,请使用以下格式:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://localhost:3000/sse/{server}
|
||||||
|
```
|
||||||
|
|
||||||
## 🧑💻 本地开发
|
## 🧑💻 本地开发
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -347,6 +347,7 @@ export const createMcpServer = (name: string, version: string): Server => {
|
|||||||
if (serverInfo.enabled === false) return false;
|
if (serverInfo.enabled === false) return false;
|
||||||
if (!group) return true;
|
if (!group) return true;
|
||||||
const serversInGroup = getServersInGroup(group);
|
const serversInGroup = getServersInGroup(group);
|
||||||
|
if (!serversInGroup || serversInGroup.length === 0) return serverInfo.name === group;
|
||||||
return serversInGroup.includes(serverInfo.name);
|
return serversInGroup.includes(serverInfo.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user