Spaces:
Sleeping
Sleeping
File size: 2,118 Bytes
05c5ed5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | # π§ MCP Server Configuration Guide
> This guide explains how to add MCP servers by defining their configuration in JSON format. Each MCP server entry is stored in the database and supports different transport types: `stdio`, `SSE`, and `StreamableHTTP`.
You can add new MCP servers effortlessly through the UI β no need to restart the app. Each tool is available instantly and can be tested independently outside of chat. This is perfect for quick debugging and reliable development workflows.

<br/>
## π₯οΈ Stdio Type
Used for locally executed tools that run via a command-line interface.
**Example:**
```json
{
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
```
- `command`: Required. The CLI command to launch the server.
- `args`: Optional. A list of arguments to pass to the command.
## π SSE / StreamableHTTP Type
Used for remote servers that communicate via HTTP (SSE or streaming).
**Example:**
```json
{
"url": "https://api.example.com",
"headers": {
"Authorization": "Bearer sk-..."
}
}
```
- `url`: Required. The endpoint to connect to.
- `headers`: Optional. HTTP headers such as authorization tokens.
You don't need to specify the transport type manually β it is inferred based on the structure:
- If `command` is present β it's a `stdio` config
- If `url` is present β it's a `SSE` or `StreamableHTTP` config
## πΎ File-based Configuration (for local dev)
By default, MCP server configs are stored in the database.
However, for local development, you can also use a file-based approach by enabling the following setting:
```env
# Whether to use file-based MCP config (default: false)
FILE_BASED_MCP_CONFIG=true
```
Then, create a `.mcp-config.json` file in the project root and define your servers there. Example:
```jsonc
// .mcp-config.json
{
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
```
Simply paste your configuration in the MCP Configuration form (or .mcp-config.json) to register a new tool.
|