Skip to main content

MCP Server

The CodeNOW MCP (Model Context Protocol) server allows AI assistants and tools to interact with the CodeNOW platform programmatically. MCP is an open standard that enables AI models to discover and use external tools in a structured way — the CodeNOW MCP server exposes platform operations as MCP tools that any compatible AI client can call.

Why Use the MCP Server?​

While the REST API is designed for traditional integrations and automation scripts, the MCP server is optimized for AI-driven workflows. It enables AI assistants (such as Claude, Cursor, or other MCP-compatible clients) to:

  • Query and manage applications, components, and deployments
  • Trigger builds and deployments
  • Inspect environment status and logs
  • Perform platform operations using natural language through an AI assistant

Prerequisites​

  • A CodeNOW user account
  • An MCP-compatible AI client (e.g., Claude Desktop, Claude Code, Cursor, or any client supporting the MCP standard)

Authentication​

The MCP server supports two authentication methods — OAuth 2.0 and API Key. Not every MCP client supports OAuth flows and not every client supports custom HTTP headers, so both methods are provided for broad compatibility across different clients.

Option 1: OAuth 2.0 (Recommended)​

When your AI client connects for the first time, you are redirected to the CodeNOW login screen. After successful login, the MCP server uses your JWT token for all subsequent requests.

This is the recommended method because it gives you access to all your accounts and does not require managing static credentials.

Supported clients

The OAuth flow is accessible from any MCP-compatible client running locally on your machine (e.g., Claude Code, Cursor) and from claude.ai on the web. Remote or server-side MCP clients that cannot handle browser-based OAuth redirects should use the API Key method instead.

Configuration:

{
"mcpServers": {
"codenow": {
"type": "http",
"url": "https://mcp.cloud.codenow.com/mcp",
"oauth": {
"clientId": "codenow-api-mcp",
"callbackPort": 8080
}
}
}
}

Option 2: API Key​

For clients that do not support the OAuth flow, you can authenticate using a personal API key passed via a custom HTTP header. API keys are issued per user and are bound to a single account.

This method is useful when you want to connect an automated agent with limited permissions or when your MCP client does not support browser-based OAuth redirects.

To generate an API key, go to Keys & Tokens in your user profile.

Configuration:

{
"mcpServers": {
"codenow": {
"type": "http",
"url": "https://mcp.cloud.codenow.com/mcp/",
"headers": {
"X-Codenow-Api-Key": "<your-api-key>"
}
}
}
}
caution

Keep your API key secret. Do not commit it to version control or share it publicly. If compromised, you can suspend or delete it in Keys & Tokens.

Comparison​

OAuth 2.0API Key
Access scopeAll user accountsSingle account
Client requirementMust support OAuth / browser redirectsMust support custom HTTP headers
Best forInteractive use with AI assistantsAutomated agents, CI/CD, headless clients
Credential managementAutomatic (token refresh)Manual (generate, rotate, suspend)

The exact location of the MCP configuration depends on your AI client — consult your client's documentation for details.

Available Tools​

Once connected, the MCP server exposes CodeNOW platform operations as tools that the AI assistant can discover and call. The available tools mirror the capabilities of the REST API and respect the same RBAC permissions as your user account.

Templates​

Change the template or template version of application components, libraries and containers, also in batches. The flow, the arguments and the results are described in Change the Template.

ToolDescription
application_components_template_preview / library_template_preview / container_template_previewPreview a template change of an application component, a library or a container
application_components_template_preview_file / library_template_preview_file / container_template_preview_fileRead a scaffold file of a template change preview
application_components_template_change / library_template_changeChange the template of an application component or a library
container_template_changeChange the template version of a container. Containers have a single template, so only the version changes
templates_versions_listList versions of a template (application component, library, agent or container), newest first
templates_getGet a template version: the customizable properties of one version

There are no template change tools for agents; change an agent's template through the REST API or the Portal.

Users and Teams​

ToolDescription
user_getThe calling user (GET /user)
user_detailDetail of a user in the account, including the user's teams — account Owner/Admin
user_listUsers of the account; optional expand=teams adds each user's teams — account Owner/Admin
user_team_listTeams of a user — the user themself or an account Owner/Admin
user_directoryMinimal user lookup (username, name, email) for any account member; parameters q, notMemberOf (leave out a team's members), limit (default 50)
team_list / team_getTeams of the account and a team's detail — visible to every account member
team_list_mineYour teams with your effective levels on each
team_member_permissions_listMembers of a team with their effective levels (member, admin, service-account-manager)
team_create / team_deleteCreate a team (you become its admin) / delete a team
team_member_addAdd one or several users to a team at once, optionally with the admin and/or service-account-manager level; reports the result per user
team_member_deleteRemove a member from a team

By design, the MCP server has no tool for changing a team member's permission levels (this is possible only in the CodeNOW UI — levels can be set via MCP only when adding members) and no tools for managing service accounts (only for looking them up and auditing their credentials). Users are read-only through MCP — there is no tool to delete a user (use the CodeNOW UI or the public API). For teams, only the create, delete and member add/remove operations listed above change anything.

Service Accounts​

Service accounts are read-only through MCP — they and their keys, tokens and secrets are created and changed in the CodeNOW UI.

ToolDescription
service_account_listService accounts you may manage, with their lifecycle state; with usable: true the ones you may set as an agent's service account; optional team filter (GET /service-accounts)
service_account_getOne service account by ID (UUID) or username sa-<account>_<name> — only one you may use, otherwise not found (GET /service-accounts/{idOrUsername})
service_account_credential_listThe API keys, Git HTTPS tokens and SSH keys of one service account — metadata only, never a secret
service_account_credential_searchThe credentials of every service account you manage, filtered by kind, state, origin, serviceAccount, expiresWithinDays, unusedForDays

When setting an agent's service account (agentGateway.serviceAccountId in agent_swarm_deployment_config_store), you can pass the ID or the username — it is stored as the ID; an unknown one is rejected with 400, one you may not use with 403. agent_swarm_deployment_config_detail returns the read-only agentGateway.serviceAccountUsername and agentGateway.serviceAccountTeam. See Service Accounts.

Check the warnings the credential tools return (GIT_UNAVAILABLE, TRUNCATED, UNKNOWN_CREDENTIAL). Details, filters and what is not included: Audit service-account credentials.

Secrets of services​

Secret values of services are masked by default:

ToolDefaultWith revealSecrets: true
connected_service_getSecret values come back as value: null, hidden: truePlain values, but only for callers with the permission to show values of that service (account Owners and Admins; other users only when it is granted on the service) — everyone else still gets them masked
hosted_service_schema_getGenerated credentials (e.g. database passwords), output fields and secret-mapped fields come back as ****Plain values only for callers who may see them (Admin and Operator of the service) — Viewer and Permission Editor still get ****
warning

A revealed secret enters the AI model's context (and possibly the client's conversation history and logs). Ask for revealSecrets only when the plain value is really needed.

When updating, the masked values keep the stored secrets:

  • connected_service_update — a non-empty values replaces the whole stored set; any key you leave out is deleted (leave values out or empty to change nothing). To keep a stored secret, send {key, hidden: true} without value.
  • hosted_service_values_update — send only the fields you change; a field sent as **** keeps its stored value. Generated values are never sent and are always kept.

Through the Agent Gateway​

If your account has Agent Gateways, the CodeNOW MCP server is also registered in every gateway at https://agent-gateway.<data plane host>/mcp/codenow, so agents can reach it with the token of their service account (see Agent Runtime) and MCP clients with a token from that gateway's client. The caller's token is passed through, so the same RBAC applies.

Security and RBAC​

The MCP server enforces the same Role-Based Access Control as the REST API. All operations are executed with the permissions of the authenticated user. See Authentication for more details on the CodeNOW RBAC model.