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.
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>"
}
}
}
}
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.0 | API Key | |
|---|---|---|
| Access scope | All user accounts | Single account |
| Client requirement | Must support OAuth / browser redirects | Must support custom HTTP headers |
| Best for | Interactive use with AI assistants | Automated agents, CI/CD, headless clients |
| Credential management | Automatic (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.
| Tool | Description |
|---|---|
application_components_template_preview / library_template_preview / container_template_preview | Preview a template change of an application component, a library or a container |
application_components_template_preview_file / library_template_preview_file / container_template_preview_file | Read a scaffold file of a template change preview |
application_components_template_change / library_template_change | Change the template of an application component or a library |
container_template_change | Change the template version of a container. Containers have a single template, so only the version changes |
templates_versions_list | List versions of a template (application component, library, agent or container), newest first |
templates_get | Get 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
| Tool | Description |
|---|---|
user_get | The calling user (GET /user) |
user_detail | Detail of a user in the account, including the user's teams — account Owner/Admin |
user_list | Users of the account; optional expand=teams adds each user's teams — account Owner/Admin |
user_team_list | Teams of a user — the user themself or an account Owner/Admin |
user_directory | Minimal user lookup (username, name, email) for any account member; parameters q, notMemberOf (leave out a team's members), limit (default 50) |
team_list / team_get | Teams of the account and a team's detail — visible to every account member |
team_list_mine | Your teams with your effective levels on each |
team_member_permissions_list | Members of a team with their effective levels (member, admin, service-account-manager) |
team_create / team_delete | Create a team (you become its admin) / delete a team |
team_member_add | Add 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_delete | Remove 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.
| Tool | Description |
|---|---|
service_account_list | Service 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_get | One 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_list | The API keys, Git HTTPS tokens and SSH keys of one service account — metadata only, never a secret |
service_account_credential_search | The 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:
| Tool | Default | With revealSecrets: true |
|---|---|---|
connected_service_get | Secret values come back as value: null, hidden: true | Plain 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_get | Generated 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 **** |
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-emptyvaluesreplaces the whole stored set; any key you leave out is deleted (leavevaluesout or empty to change nothing). To keep a stored secret, send{key, hidden: true}withoutvalue.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.