CKEditor AI On-Premises – MCP support
The On-Premises version of the CKEditor AI provides basic functionality for connecting to MCP servers using the Streamable HTTP transport.
To integrate an external MCP server, you need to supply the appropriate configuration for the MCP client.
{
"mcp_servers": {
"<MCP SERVER NAME>": {
"url": "<MCP SERVER URL>"
}
}
}
The configuration also supports specifying additional HTTP headers (e.g., an authorization token) that will be included with each request sent to the MCP server:
{
"mcp_servers": {
"<MCP SERVER NAME>": {
"url": "<MCP SERVER URL>",
"headers": {
"Authorization": "Bearer QUkgc2VydmljZUFJIHNlcnZpY2VBSSBzZXJ2aWNlQUkgc2VydmljZQ==",
"<HEADER NAME>": "<HEADER VALUE>"
}
}
}
}
For some MCP servers, you may want to disable specific tools to prevent the LLM from making harmful or dangerous actions. You can do this by providing the names of the tools to disable in the tools.disabled array.
{
"mcp_servers": {
"<MCP SERVER NAME>": {
"url": "<MCP SERVER URL>",
"headers": {
"Authorization": "Bearer QUkgc2VydmljZUFJIHNlcnZpY2VBSSBzZXJ2aWNlQUkgc2VydmljZQ==",
"<HEADER NAME>": "<HEADER VALUE>"
},
"tools": {
"disabled": ["<NAME OF THE TOOL TO DISABLE>"]
}
}
}
}
You can also configure additional options for the MCP client by providing them in the options object. Currently we support the following options:
callToolTimeout(optional, default: 60 seconds) – the timeout for the MCP tool call in seconds.
{
"mcp_servers": {
"<MCP SERVER NAME>": {
"url": "<MCP SERVER URL>",
"options": {
"callToolTimeout": 300
}
}
}
}
For MCP servers that require OAuth 2.0 authorization instead of a static access token in the Authorization header, you can configure CKEditor AI to act as an OAuth client. The service implements the OAuth 2.0 Authorization Code flow with PKCE and supports Dynamic Client Registration (RFC 7591) for servers that allow it.
End users authorize the connection through their browser. Each user authorizes independently, and the resulting access token is reused on their subsequent requests. CKEditor AI refreshes the access token automatically when it expires.
Enabling OAuth for an MCP server requires two configuration changes:
- A top-level
mcp_oauth_callback_url– the URL of the OAuth callback page hosted by your integrating web application. CKEditor AI uses this URL as the OAuthredirect_uriparameter for all OAuth-enabled MCP servers (unless overridden per server). - An
oauthblock inside the entry undermcp_servers.<MCP SERVER NAME>.
{
"mcp_oauth_callback_url": "https://your-app.example.com/oauth/callback",
"mcp_servers": {
"<MCP SERVER NAME>": {
"url": "<MCP SERVER URL>",
"oauth": {
"clientId": "<OAUTH CLIENT ID>",
"clientSecret": "<OAUTH CLIENT SECRET>",
"scopes": ["<OAUTH SCOPE>"]
}
}
}
}
All fields inside oauth are optional:
clientId– OAuth 2.0 client identifier issued by the MCP server. Omit to perform Dynamic Client Registration.clientSecret– OAuth 2.0 client secret. Used together withclientIdfor confidential clients.scopes– an array of OAuth scopes to request from the authorization server. Omit to use default server scopes.callbackUrl– per-server override of the top-levelmcp_oauth_callback_url. Useful when different MCP servers must redirect to different pages in your web application.
If the MCP server supports RFC 7591 Dynamic Client Registration, you can omit clientId and clientSecret from the oauth block. CKEditor AI will register itself with the MCP server automatically on the first authorization attempt and reuse the resulting registration for later flows.
The OAuth flow is driven by your integrating web application. The AI service exposes the REST endpoints listed below; your application is responsible for orchestrating the redirects and forwarding the authorization code.
- Initialize. Your application calls
POST /v1/mcp/oauth/{serverName}/initializefor the signed-in user. The response contains either:{ "connected": true }– the user already has a valid access token; nothing more to do.{ "connected": false, "authorizationUrl": "..." }– redirect the user’s browser toauthorizationUrl.
- User consents. The MCP server’s authorization page opens in the user’s browser. After the user approves the request, the server redirects back to the URL configured as
mcp_oauth_callback_url(oroauth.callbackUrl) withcodeandstatequery parameters appended. - Complete. Your callback page extracts
codeandstatefrom the query string and forwards them toPOST /v1/mcp/oauth/{serverName}/completewith body{ "code": "...", "state": "..." }. On success the user’s connection becomes active and subsequent AI conversations for that user can use the MCP server’s tools.
CKEditor AI does not host the callback page itself. You must register mcp_oauth_callback_url (or each per-server oauth.callbackUrl) as an authorized redirect URI with the MCP server – either through the server’s developer console or, with Dynamic Client Registration, automatically.
The authorization session is valid for ten minutes after initialize. If the user takes longer than that to finish the authorization page, the complete call returns a mcp-oauth-invalid-state error and the flow must be restarted from initialize.
All endpoints below are authenticated with the same token used for other AI service endpoints. The acting user is identified by the token; each user has their own connection state per MCP server.
| Method | Path | Description |
|---|---|---|
GET |
/v1/mcp/oauth/status |
Returns the connection status for every OAuth-enabled MCP server, with connected and an optional expiresAt timestamp for the calling user. |
POST |
/v1/mcp/oauth/{serverName}/initialize |
Starts the OAuth flow. Returns either { "connected": true } or { "connected": false, "authorizationUrl": "..." }. |
POST |
/v1/mcp/oauth/{serverName}/complete |
Finishes the OAuth flow. Body: { "code": "...", "state": "..." }. On success returns { "connected": true }. |
DELETE |
/v1/mcp/oauth/{serverName} |
Removes the stored token (and any in-progress authorization state) for the calling user. |
These endpoints are available once OAuth is configured for at least one MCP server.
OAuth connections are established per user and do not carry over between users or environments.
To revoke the calling user’s connection, send DELETE /v1/mcp/oauth/{serverName}.
Once the MCP client is configured, it will automatically establish a connection to the MCP server and retrieve the list of available tools. These tools will then be accessible to AI models during conversations (not in reviews or quick actions), enabling them to determine when and how to use them as needed.
For OAuth-enabled MCP servers, the connection is established only after each user completes the authorization flow; until then, the server’s tools are not exposed to that user.