Home / Servers / Cloudflare API / workers_kv_namespace_write_key_value_pair_with_metadata

Write a key-value pair with optional metadata

An MCP tool from the Cloudflare API server, hosted on mcp.hjlabs.in.

Write a key-value pair with optional metadata Writes a value under the specified key in the Workers KV namespace, creating the key-value pair or… [PUT /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}]

Name on the gateway: cloudflare_api__workers_kv_namespace_write_key_value_pair_with_metadata · may change things.

Parameters

NameTypeDescription
account_id requiredstringaccount_id parameter
namespace_id requiredstringnamespace_id parameter
key_name requiredstringkey_name parameter
expirationnumberExpires the key at a certain time, measured in…
expiration_ttlnumberNumber of seconds until the key expires. Must be…
metadatastringAssociates arbitrary JSON data with a key/value…
value requiredstringA byte sequence to be stored, up to 25 MiB in…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "cloudflare_api__workers_kv_namespace_write_key_value_pair_with_metadata",
  "arguments": {
    "account_id": "…",
    "namespace_id": "…",
    "key_name": "…",
    "value": "…"
  }
}

Or connect the Cloudflare API server directly, which lists 3,127 tools including this one:

Run in your terminal
claude mcp add --transport http hj-cloudflare-api https://mcp.hjlabs.in/mcp/cloudflare-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the write a key-value pair with optional metadata tool with account_id set to ….

More from Cloudflare API