2025-07-19 09:33:32 +08:00
|
|
|
|
# MCP Integrations(Beta)
|
|
|
|
|
|
|
|
|
|
|
|
Now This feature is diabled by default. You can enable it by setting the environment ENABLE_MCP_SERVER_CONFIGURATION to be true
|
|
|
|
|
|
|
|
|
|
|
|
> [!WARNING]
|
|
|
|
|
|
> Please enable this feature before securing your frond-end and back-end in a managed environment.
|
|
|
|
|
|
> Otherwise, you system could be compromised.
|
2025-04-23 13:48:42 +08:00
|
|
|
|
|
2025-07-19 08:39:42 +08:00
|
|
|
|
This feature is diabled by default. You can enable it by setting the environment ENABLE_MCP_SERVER_CONFIGURATION
|
|
|
|
|
|
Please enable this feature before securing your frond-end and back-end in an internal environment.q
|
|
|
|
|
|
|
2025-04-24 15:41:33 +08:00
|
|
|
|
## Example of MCP Server Configuration
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"mcpServers": {
|
|
|
|
|
|
"mcp-github-trending": {
|
|
|
|
|
|
"transport": "stdio",
|
|
|
|
|
|
"command": "uvx",
|
|
|
|
|
|
"args": [
|
|
|
|
|
|
"mcp-github-trending"
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-04-23 13:48:42 +08:00
|
|
|
|
## APIs
|
|
|
|
|
|
|
2025-05-08 10:14:33 +08:00
|
|
|
|
### Get metadata of MCP Server
|
2025-04-23 13:48:42 +08:00
|
|
|
|
|
|
|
|
|
|
**POST /api/mcp/server/metadata**
|
|
|
|
|
|
|
2025-05-08 10:14:33 +08:00
|
|
|
|
For `stdio` type:
|
2025-04-23 13:48:42 +08:00
|
|
|
|
```json
|
|
|
|
|
|
{
|
2025-04-23 16:00:01 +08:00
|
|
|
|
"transport": "stdio",
|
2025-04-23 13:48:42 +08:00
|
|
|
|
"command": "npx",
|
2025-04-23 14:38:04 +08:00
|
|
|
|
"args": ["-y", "tavily-mcp@0.1.3"],
|
|
|
|
|
|
"env": {"TAVILY_API_KEY": "tvly-dev-xxx"}
|
2025-04-23 13:48:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2025-05-08 10:14:33 +08:00
|
|
|
|
For `sse` type:
|
2025-04-23 13:48:42 +08:00
|
|
|
|
```json
|
|
|
|
|
|
{
|
2025-04-23 16:00:01 +08:00
|
|
|
|
"transport": "sse",
|
2025-04-23 13:48:42 +08:00
|
|
|
|
"url": "http://localhost:3000/sse",
|
|
|
|
|
|
"env": {
|
|
|
|
|
|
"API_KEY": "value"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Chat Stream
|
|
|
|
|
|
|
|
|
|
|
|
**POST /api/chat/stream**
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
...
|
|
|
|
|
|
"mcp_settings": {
|
|
|
|
|
|
"servers": {
|
|
|
|
|
|
"mcp-github-trending": {
|
2025-04-23 16:00:01 +08:00
|
|
|
|
"transport": "stdio",
|
2025-04-23 13:48:42 +08:00
|
|
|
|
"command": "uvx",
|
|
|
|
|
|
"args": ["mcp-github-trending"],
|
|
|
|
|
|
"env": {
|
|
|
|
|
|
"MCP_SERVER_ID": "mcp-github-trending"
|
|
|
|
|
|
},
|
|
|
|
|
|
"enabled_tools": ["get_github_trending_repositories"],
|
|
|
|
|
|
"add_to_agents": ["researcher"]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|