"ok" on success/api/mcp/add BearerAdd MCP Server
Add a new MCP server configuration to PocketPaw. Specify the server name, command, arguments, environment variables, and transport type for stdio or HTTP-based MCP servers.
Overview
Adds a new MCP server to the configuration. The server can use either stdio transport (local process) or http transport (remote URL).
Request Body
Body Parameters
name requiredUnique identifier for the server. Used as the key in config and tool naming (mcp_<name>__<tool>).
transport requiredTransport protocol. Use stdio for local processes or http for remote servers.
stdiohttpcommandCommand to execute for stdio transport (e.g., npx, python).
argsCommand arguments for stdio transport.
urlServer URL for http transport.
envEnvironment variables to pass to the server process.
enabledWhether to enable the server immediately.
Response
status stringcurl -X POST "http://localhost:8000/api/mcp/add" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "name": "filesystem", "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"], "env": {}, "enabled": true }'const response = await fetch("http://localhost:8000/api/mcp/add", { method: "POST", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ name: "filesystem", transport: "stdio", command: "npx", args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"], env: {}, enabled: true })});const data = await response.json();console.log(data);import requests
response = requests.post( "http://localhost:8000/api/mcp/add", headers={"Authorization": "Bearer <token>"}, json={ "name": "filesystem", "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"], "env": {}, "enabled": True })print(response.json()){ "status": "ok" }curl -X POST "http://localhost:8000/api/mcp/add" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>"const response = await fetch("http://localhost:8000/api/mcp/add", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.post(
"http://localhost:8000/api/mcp/add",
headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:8000/api/mcp/add", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}