MCP

MCP Examples

Practical JSON-RPC examples for Secryn MCP tools.

MCP Examples

All examples assume:

  • Endpoint: https://your-mcp-host/mcp
  • Header: Mcp-Session-Id: YOUR_SESSION_ID
  • Content-Type: application/json

Example - secrets.list

curl --request POST \
  --url "https://your-mcp-host/mcp" \
  --header "Content-Type: application/json" \
  --header "Mcp-Session-Id: YOUR_SESSION_ID" \
  --data '{
    "method": "tools/call",
    "params": {
      "name": "secrets.list",
      "arguments": {
        "namesOnly": true,
        "vault": {
          "id": "Test Vault",
          "vaultId": "Test Vault",
          "accessKey": "37w57Ow9fYGju6fB7xcmoBgF5vbeHUHv",
          "baseUrl": "https://demo-rc.secryn.io/api"
        },
        "credentials": {
          "vaultId": "secryn-dev",
          "accessKey": "D3tWmzG7ajewYEEqN3rAbHKH5MjUPr6X",
          "baseUrl": "https://kv.emrystech.dev/api"
        }
      }
    }
  }'

Example - secrets.get

curl --request POST \
  --url "https://your-mcp-host/mcp" \
  --header "Content-Type: application/json" \
  --header "Mcp-Session-Id: YOUR_SESSION_ID" \
  --data '{
    "method": "tools/call",
    "params": {
      "name": "secrets.get",
      "arguments": {
        "name": "DB_PASSWORD",
        "includeValue": true,
        "vault": {
          "vaultId": "Test Vault",
          "accessKey": "VAULT_ACCESS_KEY",
          "baseUrl": "https://demo.secryn.io/api"
        }
      }
    }
  }'

Example - keys.get (Public Mode)

curl --request POST \
  --url "https://your-mcp-host/mcp" \
  --header "Content-Type: application/json" \
  --header "Mcp-Session-Id: YOUR_SESSION_ID" \
  --data '{
    "method": "tools/call",
    "params": {
      "name": "keys.get",
      "arguments": {
        "id": "8b280b73-4ff5-4fa3-972b-008c1563b730",
        "preferPublic": true,
        "code": "RESOURCE_PUBLIC_TOKEN"
      }
    }
  }'