NAME

Claude::Agent::MCP::HTTPServer - A remote MCP server reached over streamable HTTP

SYNOPSIS

use Claude::Agent::MCP::HTTPServer;

my $server = Claude::Agent::MCP::HTTPServer->new(
    url     => 'https://api.example.com/mcp',
    headers => { Authorization => "Bearer $token" },
);

DESCRIPTION

Configuration for an MCP server the CLI connects to over streamable HTTP. The URL must use the http or https scheme.

Header values that look sensitive (Authorization, X-API-Key and the like, plus anything named in sensitive_headers) are redacted in debug output; see Claude::Agent::MCP::HeaderUtils.

ATTRIBUTES

url

The server's URL. Required.

headers

HashRef of request headers.

sensitive_headers

ArrayRef of header names to redact in debug output, beyond the ones recognised automatically.

type

Always http. Read only.

METHODS

new

Takes a flat list of name/value pairs. Unknown names are ignored.

is_sensitive_header

if ($server->is_sensitive_header('Authorization')) { ... }

True when the header would be redacted.

redacted_headers

my $safe = $server->redacted_headers;

The headers with sensitive values replaced, for logging.

to_hash

my $hash = $server->to_hash;

{ type, url, headers }, the --mcp-config entry.

AUTHOR

LNATION, <email at lnation.org>

LICENSE

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under The Artistic License 2.0 (GPL Compatible).