# Source: https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/site-mcp-servers.md

# Site MCP servers

Manage Model Context Protocol (Mcp) servers used by your site.

## The SiteMcpServer object

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"components":{"schemas":{"SiteMcpServer":{"type":"object","properties":{"object":{"type":"string","enum":["site-mcp-server"]},"id":{"type":"string","description":"Unique identifier for the MCP server"},"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the MCP server in the API","format":"uri"}},"required":["location"]}},"required":["object","id","name","url","headers","urls"]},"SiteMcpServerName":{"type":"string","description":"Name of the MCP server","minLength":1,"maxLength":100},"URL":{"type":"string","format":"uri","maxLength":2048},"SiteMcpServerHeaders":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"description":"HTTP headers sent with requests to this server"}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/mcp-servers

> List all MCP servers for a site

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-mcp-servers","description":"Manage Model Context Protocol (Mcp) servers used by your site.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteMcpServer\" grouped=\"false\" %}\n    The SiteMcpServer object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"listPage":{"name":"page","in":"query","description":"Identifier of the page results to fetch.","schema":{"type":"string"}},"listLimit":{"name":"limit","in":"query","description":"The number of results per page","schema":{"type":"number","minimum":0,"maximum":1000}}},"schemas":{"List":{"type":"object","properties":{"next":{"type":"object","properties":{"page":{"type":"string","description":"Unique identifier to query the next results page"}},"required":["page"]},"count":{"type":"number","description":"Total count of objects in the list"}}},"SiteMcpServer":{"type":"object","properties":{"object":{"type":"string","enum":["site-mcp-server"]},"id":{"type":"string","description":"Unique identifier for the MCP server"},"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the MCP server in the API","format":"uri"}},"required":["location"]}},"required":["object","id","name","url","headers","urls"]},"SiteMcpServerName":{"type":"string","description":"Name of the MCP server","minLength":1,"maxLength":100},"URL":{"type":"string","format":"uri","maxLength":2048},"SiteMcpServerHeaders":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"description":"HTTP headers sent with requests to this server"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/mcp-servers":{"get":{"operationId":"listSiteMcpServers","summary":"List all MCP servers for a site","tags":["site-mcp-servers"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/listPage"},{"$ref":"#/components/parameters/listLimit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SiteMcpServer"}}}}]}}}}}}}}}
```

## POST /orgs/{organizationId}/sites/{siteId}/mcp-servers

> Create a new MCP server

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-mcp-servers","description":"Manage Model Context Protocol (Mcp) servers used by your site.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteMcpServer\" grouped=\"false\" %}\n    The SiteMcpServer object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}}},"schemas":{"SiteMcpServerName":{"type":"string","description":"Name of the MCP server","minLength":1,"maxLength":100},"URL":{"type":"string","format":"uri","maxLength":2048},"SiteMcpServerHeaders":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"description":"HTTP headers sent with requests to this server"},"SiteMcpServer":{"type":"object","properties":{"object":{"type":"string","enum":["site-mcp-server"]},"id":{"type":"string","description":"Unique identifier for the MCP server"},"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the MCP server in the API","format":"uri"}},"required":["location"]}},"required":["object","id","name","url","headers","urls"]}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/mcp-servers":{"post":{"operationId":"createSiteMcpServer","summary":"Create a new MCP server","tags":["site-mcp-servers"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"}},"required":["name","url","headers"]}}}},"responses":{"201":{"description":"MCP server created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteMcpServer"}}}}}}}}}
```

## GET /orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}

> Get a site MCP server

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-mcp-servers","description":"Manage Model Context Protocol (Mcp) servers used by your site.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteMcpServer\" grouped=\"false\" %}\n    The SiteMcpServer object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteMcpServerId":{"name":"siteMcpServerId","in":"path","required":true,"description":"The unique id of the MCP server","schema":{"type":"string"}}},"schemas":{"SiteMcpServer":{"type":"object","properties":{"object":{"type":"string","enum":["site-mcp-server"]},"id":{"type":"string","description":"Unique identifier for the MCP server"},"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the MCP server in the API","format":"uri"}},"required":["location"]}},"required":["object","id","name","url","headers","urls"]},"SiteMcpServerName":{"type":"string","description":"Name of the MCP server","minLength":1,"maxLength":100},"URL":{"type":"string","format":"uri","maxLength":2048},"SiteMcpServerHeaders":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"description":"HTTP headers sent with requests to this server"}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}":{"get":{"operationId":"getSiteMcpServerById","summary":"Get a site MCP server","tags":["site-mcp-servers"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteMcpServerId"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteMcpServer"}}}}}}}}}
```

## DELETE /orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}

> Delete a site MCP server

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-mcp-servers","description":"Manage Model Context Protocol (Mcp) servers used by your site.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteMcpServer\" grouped=\"false\" %}\n    The SiteMcpServer object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteMcpServerId":{"name":"siteMcpServerId","in":"path","required":true,"description":"The unique id of the MCP server","schema":{"type":"string"}}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}":{"delete":{"operationId":"deleteSiteMcpServerById","summary":"Delete a site MCP server","tags":["site-mcp-servers"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteMcpServerId"}],"responses":{"204":{"description":"MCP server did not exist"},"205":{"description":"MCP server deleted"}}}}}}
```

## PATCH /orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}

> Update a site MCP server

```json
{"openapi":"3.0.3","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"site-mcp-servers","description":"Manage Model Context Protocol (Mcp) servers used by your site.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"SiteMcpServer\" grouped=\"false\" %}\n    The SiteMcpServer object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"type":"string"}},"siteId":{"name":"siteId","in":"path","required":true,"description":"The unique id of the site","schema":{"type":"string"}},"siteMcpServerId":{"name":"siteMcpServerId","in":"path","required":true,"description":"The unique id of the MCP server","schema":{"type":"string"}}},"schemas":{"SiteMcpServerName":{"type":"string","description":"Name of the MCP server","minLength":1,"maxLength":100},"SiteMcpServerHeaders":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"description":"HTTP headers sent with requests to this server"},"SiteMcpServer":{"type":"object","properties":{"object":{"type":"string","enum":["site-mcp-server"]},"id":{"type":"string","description":"Unique identifier for the MCP server"},"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"$ref":"#/components/schemas/URL"},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"type":"string","description":"URL of the MCP server in the API","format":"uri"}},"required":["location"]}},"required":["object","id","name","url","headers","urls"]},"URL":{"type":"string","format":"uri","maxLength":2048}}},"paths":{"/orgs/{organizationId}/sites/{siteId}/mcp-servers/{siteMcpServerId}":{"patch":{"operationId":"updateSiteMcpServerById","summary":"Update a site MCP server","tags":["site-mcp-servers"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/siteId"},{"$ref":"#/components/parameters/siteMcpServerId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/SiteMcpServerName"},"url":{"type":"string","format":"uri","maxLength":2048},"headers":{"$ref":"#/components/schemas/SiteMcpServerHeaders"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteMcpServer"}}}}}}}}}
```