POST /api/mcp/add Bearer

Add 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 required
string

Unique identifier for the server. Used as the key in config and tool naming (mcp_<name>__<tool>).

transport required
string

Transport protocol. Use stdio for local processes or http for remote servers.

Allowed values:
stdiohttp
command
string

Command to execute for stdio transport (e.g., npx, python).

args
array

Command arguments for stdio transport.

url
string

Server URL for http transport.

env
object

Environment variables to pass to the server process.

enabled
boolean = true

Whether to enable the server immediately.

Response

status string
"ok" on success
Terminal window
curl -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" }
Request
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))
}
Response
Send a request to see the response