The MCP (Model Context Protocol) server is the control plane for Tentacular. It runs inside your Kubernetes cluster and provides a secure API that the tntc CLI and AI agents use to manage tentacles. The CLI has no direct Kubernetes API access — all cluster operations route through this server.
Note: If auth.token is not specified, the Helm chart auto-generates a secure 64-character token. The token is preserved across helm upgrade. To provide your own token, add --set auth.token="$(openssl rand -hex 32)". To retrieve the auto-generated token:
Add the MCP endpoint to your CLI configuration. If using OIDC, mcp_token_path is optional (used as admin fallback). If using bearer-token only, point it at a file containing the token:
~/.tentacular/config.yaml
environments:
dev:
mcp_endpoint: http://<node-ip>:30080/mcp
mcp_token_path: ~/.tentacular/mcp-token# optional with OIDC
The MCP server supports three authentication paths:
Method
Client
Deployer Provenance
Flow
CLI OIDC
tntc CLI
Yes — records who deployed
Device-code grant (browser)
Claude Code OAuth
Claude Code
Yes — records who deployed
Authorization-code + PKCE (browser)
Bearer tokens
Any HTTP client
No — anonymous deploys
Static token file
All OIDC-authenticated requests carry deployer identity (email, subject, display name) which is recorded as ownership annotations on namespaces and tentacles. Bearer-token requests have no identity and bypass authorization.
For deployer provenance and SSO, configure OIDC via the Helm chart. When using the tentacular-platform chart, the Keycloak realm and client are created automatically via --import-realm — no manual Keycloak configuration is needed.
The externalURL value enables RFC 9728 Protected Resource Metadata — the server advertises its authorization server at /.well-known/oauth-protected-resource, allowing OAuth clients to auto-discover how to authenticate. When externalURL is not set, clients must be configured with the auth server URL manually.
The default Keycloak realm configuration sets access token lifetime to 12 hours, SSO session idle timeout to 12 hours, and SSO session max lifetime to 24 hours. This allows agents to operate for extended sessions without requiring human re-authentication via the device flow.
Claude Code connects to the MCP server as a remote HTTP MCP server and authenticates via OAuth 2.0. When externalURL is configured (see above), auth discovery is automatic. Configure .mcp.json in your workspace:
{
"mcpServers": {
"tentacular-mcp": {
"type": "http",
"url": "http://<mcp-endpoint>/mcp",
"oauth": { "clientId": "tentacular-mcp" }
}
}
}
On first connection, Claude Code:
Fetches /.well-known/oauth-protected-resource from the MCP server
Discovers the Keycloak authorization server URL
Opens a browser for Keycloak login
Stores the resulting tokens in the macOS system keychain
Attaches the JWT to all subsequent MCP requests
The JWT carries the same OIDC identity as tntc login — namespaces and tentacles created via Claude Code have proper ownership annotations.
If externalURL is not configured, add authServerMetadataUrl to the OAuth config as a manual fallback:
Note: The Keycloak client must have all scopes that Claude Code requests as optional client scopes. Claude Code requests all scopes listed in the Keycloak discovery document. If scopes are missing, you will see an invalid_scope error during authentication.
The MCP server includes an internal cron scheduler (robfig/cron/v3). When a tentacle is deployed with cron triggers, the schedule is stored as a tentacular.io/cron-schedule annotation on the Deployment. The scheduler reads these annotations and fires HTTP POST to the tentacle’s /run endpoint on schedule. No CronJob resources are created.
The MCP server operates with scoped RBAC — it can only manage tentacular-related resources (Deployments, Services, ConfigMaps, Secrets, NetworkPolicies, Namespaces with specific labels). It cannot access resources outside its scope.
When OIDC authentication is configured, the MCP server enforces POSIX-like permissions on workflow operations. Authorization is enabled by default. The default mode for new deployments is group-read (rwxr-x---): owner has full access, group members can read and execute.
To disable authorization entirely (kill switch), set the environment variable on the MCP server:
Terminal window
TENTACULAR_AUTHZ_ENABLED=false
Bearer-token requests always bypass authorization regardless of this setting — permissions are only evaluated for OIDC-authenticated requests.
Note: The tentacular.dev/* annotation namespace has been replaced by tentacular.io/*. Existing deployments using old annotations will not have authorization enforced until redeployed.