Repository navigation
Description
SEP-1415: HTTP Message Signing for MCP Client Authentication
Author: @dickhardt
Status: draft
Type: Standards Track
Created: 2025-01-04
Abstract
This SEP proposes adding HTTP Message Signing (RFC 9421) as an optional client authentication method for MCP. This provides cryptographic proof of possession, enabling MCP Servers to establish authenticated sessions with clients without relying solely on bearer tokens. The proposal maintains full backward compatibility while addressing security concerns around session binding and client identity verification.
Motivation
Current MCP implementations rely primarily on bearer tokens (OAuth access tokens and MCP-Session-Id) for client identification and session continuity. This creates several security and architectural limitations:
- Bearer Token Vulnerabilities: Access tokens are vulnerable to exfiltration attacks on client devices
- Weak Session Binding: Only bearer tokens provide session continuity, with no cryptographic client verification
- Limited Client Identity: No trusted mechanism for servers to verify client instance identity
- OAuth Complexity Overhead: Full OAuth flows add significant complexity when only simple client-to-server authentication is needed
- Bearer Token Possession Risk: OAuth flows often result in MCP Clients possessing access tokens intended for MCP Server to resource server communication, violating the principle of least privilege and creating unnecessary token exposure
Architectural Alignment
With SEP1036 being accepted, URL elicitation now enables MCP Servers to obtain access tokens directly from authorization servers, and there is an opportunity to realign the architecture. This proposal positions MCP Clients as general-purpose clients that can connect to any MCP Server, similar to how web browsers can connect to any web server.
This architectural alignment mirrors the web model:
- Web browsers are general-purpose clients that can connect to any web server
- Web servers provide specific functionality and manage user authentication and resource access
- Browser-server sessions are established for state management between requests
- Web servers act as OAuth clients when they need to access protected resources on behalf of users
Similarly, in the MCP model:
- MCP Clients are general-purpose clients that can connect to any MCP Server
- MCP Servers provide specific functionality through tools and resources
- Client-server sessions are established for state management between requests
- MCP Servers authenticate users and obtain access tokens for protected resources when needed
This proposal specifies how the client-server session can be established by demonstrating proof of possession rather than bearer tokens.
Related Issues
- Issue 544: Security concerns with bearer token access
- Issue 990: Client identity presentation mechanisms
Specification
HTTP Message Signing Profile
MCP Clients MAY authenticate using HTTP Message Signatures (RFC 9421) with the following profile:
Key Management
Clients generate a public/private key pair per MCP Server using Ed25519:
{
"kty": "OKP",
"crv": "Ed25519",
"x": "base64url-encoded-public-key",
"d": "base64url-encoded-private-key"
}Example Key:
{
"kty": "OKP",
"crv": "Ed25519",
"x": "3TQjAzEPW-sE81J4eWUuI2ZQCRJKELwdco_cJa7e9pM",
"d": "hOMEcdDFPWvkw-OyC-cVABnPaA6yKqrdWVoFw6bvqaM"
}The keyid is the JWK thumbprint per RFC 7638.
The corresponding keyid (JWK thumbprint) for the example key would be:
7CECy79zsOm80SK3EgvHmsLM39PfUmbfSTxqOLhfgsM
Client Initialization
Clients include their public key in the initialize request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"clientInfo": {
"name": "example-client",
"version": "1.0.0",
"cnf": {
"jwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "3TQjAzEPW-sE81J4eWUuI2ZQCRJKELwdco_cJa7e9pM"
}
}
}
}
}Extensible Key Communication
While the basic cnf.jwk approach provides cryptographic binding, implementations MAY use tokens with bound keys to communicate additional claims about the MCP Client or the user alongside the public key. These tokens would be signed by an issuer trusted by the MCP Server.
Required Signature Components
Every signed MCP request MUST include these HTTP headers and signature components:
Content-Digest: sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:
Signature-Input: sig1=("@method" "@target-uri" "content-digest" "mcp-session-id" "created");created=1756801769;keyid="7CECy79zsOm80SK3EgvHmsLM39PfUmbfSTxqOLhfgsM";alg="ed25519"
Signature: sig1=:LAH8BjcfcOcLojiuOBFWBo0hWDdMOGvAdEBM0h/MIRoNfj6Ae==:Signed Fields (included in signature base string):
@method- HTTP method@target-uri- Full request URIcontent-digest- SHA-256 of request bodymcp-session-id- Session identifier (after initialization)created- Signature creation timestamp (Unix epoch seconds)
Signature Parameters (metadata, not signed):
keyid- JWK thumbprint identifying the verification keyalg- Signature algorithm (ed25519)
Replay Protection
- Signatures MUST include
createdtimestamp (Unix epoch seconds) - Servers MUST reject signatures older than 300 seconds (5 minutes)
- Servers SHOULD maintain a cache of seen request signatures to prevent replay attacks
Example Signed initialize Request
POST /mcp HTTP/1.1
Host: server.example.com
Content-Type: application/json
Content-Digest: sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:
Signature-Input: sig1=("@method" "@target-uri" "content-digest" "created");created=1756801769;keyid="7CECy79zsOm80SK3EgvHmsLM39PfUmbfSTxqOLhfgsM";alg="ed25519"
Signature: sig1=:LAH8BjcfcOcLojiuOBFWBo0hWDdMOGvAdEBM0h/MIRoNfj6Ae5OOKlEOUcKTOvXsyHkC5bV9D6m9QQDnR3QxDw==:
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"roots": {
"listChanged": true
},
"sampling": {}
},
"clientInfo": {
"name": "example-client",
"version": "1.0.0",
"cnf": {
"jwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "3TQjAzEPW-sE81J4eWUuI2ZQCRJKELwdco_cJa7e9pM"
}
}
}
}
}Note that the initialize request does not include mcp-session-id in the signature since the session has not been established yet.
Example Signed tools/call Request
POST /mcp HTTP/1.1
Host: server.example.com
Content-Type: application/json
Content-Digest: sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:
MCP-Session-Id: sess_abc123
Signature-Input: sig1=("@method" "@target-uri" "content-digest" "mcp-session-id" "created");created=1756801769;keyid="7CECy79zsOm80SK3EgvHmsLM39PfUmbfSTxqOLhfgsM";alg="ed25519"
Signature: sig1=:LAH8BjcfcOcLojiuOBFWBo0hWDdMOGvAdEBM0h/MIRoNfj6Ae5OOKlEOUcKTOvXsyHkC5bV9D6m9QQDnR3QxDw==:
{
"jsonrpc": "2.0",
"id": "request_12345",
"method": "tools/call",
"params": {
"name": "example_tool",
"arguments": {}
}
}Server Behavior
Servers that support HTTP Message Signing:
- MUST validate signature cryptographically using the client's public key
- MUST verify the
createdtimestamp is within acceptable bounds - SHOULD cache request signatures to prevent replay attacks
- MAY use the
keyid(JWK thumbprint) as a stable client identifier - MUST continue to support clients not using message signing
Cryptographic Agility
To ensure interoperability and future-proofing, servers MUST communicate their supported signature algorithms to clients when an unsupported algorithm is encountered.
Algorithm Support Discovery
When a server receives a request with an unsupported signature algorithm, it MUST respond with an MCP error containing the list of supported algorithms:
{
"jsonrpc": "2.0",
"id": "request_12345",
"error": {
"code": -32602,
"message": "Unsupported signature algorithm",
"data": {
"error": "unsupported_algorithm",
"supported_algorithms": [
"rsa-v1_5-sha256",
"ecdsa-p256-sha256"
]
}
}
}Standard Algorithm Identifiers
Servers MUST use IANA-registered algorithm identifiers from the "HTTP Signature Algorithms" registry in the "HTTP Message Signatures" IANA registry at https://www.iana.org/assignments/http-message-signature/http-message-signature.xhtml
Client Algorithm Selection
Upon receiving an unsupported_algorithm error, clients SHOULD:
- Parse the
supported_algorithmslist from the error response - Select a mutually supported algorithm based on security preferences
- Generate a new signature using the selected algorithm
- Retry the request with the updated signature
Rationale
Alternative Approaches Considered
Mutual TLS (mTLS):
- Pros: Transport-level security, well-established
- Cons: TLS termination at CDN/load balancer breaks client cert visibility, complexity for local development
Signed JSON-RPC:
- Pros: Protocol-native approach
- Cons: No HTTP header protection, backward compatibility issues, replay vulnerabilities
HTTP Message Signatures:
- Pros: Application-layer security, transport-independent, backward compatible, comprehensive request protection
- Cons: Per-request signature computation overhead
HTTP Message Signatures provide the optimal balance of security, compatibility, and implementability.
Benefits
- Enhanced Security: Cryptographic proof of client identity and request integrity
- Session Binding: Strong cryptographic binding between client instances and sessions
- Replay Protection: Built-in timestamp and signature caching prevents replay attacks
- Backward Compatibility: Existing clients continue to work unchanged
- Enterprise Ready: Provides authentication strength suitable for high-security environments
- Transport Independence: Works over HTTP/HTTPS without requiring specific TLS configurations
Backward Compatibility
This proposal is fully backward compatible:
- New
cnffield (contains the public key) ininitializeis optional - Servers can support both signed and unsigned clients simultaneously
- Existing OAuth flows remain unchanged
- No breaking changes to existing message formats
Security Considerations
Security Improvements
- Private Key Security: Ed25519 provides strong cryptographic guarantees
- Request Integrity: Full HTTP request signed, preventing tampering
- Session Security: Cryptographic binding prevents session hijacking
- Replay Protection: Timestamp validation and signature caching
Implementation Security
Client Implementations:
- Generate unique key pairs per server relationship
- Use secure key storage (OS keychain, hardware security modules)
- Implement proper signature timing to prevent side-channel attacks
Server Implementations:
- Validate signatures with constant-time operations
- Implement proper timestamp window validation
- Use cryptographically secure signature caching
- Rate limit signature validation attempts
Threat Mitigation
| Threat | Before | After |
|---|---|---|
| Token Theft | Bearer tokens vulnerable on client | Only private keys on client (standard key management) |
| Session Hijacking | Bearer token theft enables takeover | Cryptographic binding prevents hijacking |
| Client Impersonation | No cryptographic client verification | Ed25519 signature provides proof of possession |
| Request Tampering | No request integrity protection | Full HTTP request cryptographically signed |
Reference Implementation
None at this time. A reference implementation would include:
- Ed25519 key generation utilities
- HTTP Message Signature creation and verification
- Example client and server integration code
Open Questions
- Should Ed25519 remain the RECOMMENDED algorithm, or should we recommend a different default based on implementation feedback?
This SEP focuses specifically on adding HTTP Message Signing as a client authentication option. Future SEPs may address server-side authorization management and interaction request mechanisms.
Activity
[-]SEP-XXXX: HTTP Message Signing for MCP Client Authentication[/-][+]SEP-1415: HTTP Message Signing for MCP Client Authentication[/+]dickhardt commentedon Sep 2, 2025
This proposal replaces #1299
jricher commentedon Sep 2, 2025
Some notes per RFC9421:
All signature parameters are signed. Both
keyidandalgare of the same class ascreated. What's not signed is the signature label, as that's part of the packaging and could be changed in transit.Furthermore, it's recommended by RFC9421 to not use
algbut instead to derive the algorithm from the key material or a higher order protocol. If desired, this seems like it could be easily accomplished in this proposal by having a JOSE algorithm identifier in the key material itself and enforcing the application of that JWA entry to the signature.covia-dev commentedon Sep 5, 2025
@dickhardt Very useful proposal, valuable for those of us building decentralised / P2P MCP capabilities.
On the open question: Standardising on Ed25519 is a good idea, it's a strong algorithm, has compact keys / signatures and is widely supported. I don't think there is a better option out there right now.
dickhardt commentedon Sep 5, 2025
Where is that in the spec @jricher ? ... if it is not recommended, then why is it used in the samples?
I'm unclear on what the rest of your message is saying -- I'm not an HTTP Message signing expert -- but you are! What needs to be corrected?
jricher commentedon Sep 5, 2025
The signature algorithm selection path lists the explicit field last in precedence order: https://www.rfc-editor.org/rfc/rfc9421.html#section-3.2-3.6.1
Use of JOSE / JWA is listed here, which explicitly states not to use the
algparameter: https://www.rfc-editor.org/rfc/rfc9421.html#name-json-web-signature-jws-algoThe section defining the
algparameter registry value says this: "However, the use of the alg parameter needs to be treated with caution to avoid various forms of algorithm confusion and substitution attacks, as discussed in Section 7.", where Section 7 is the security considerations. One specific item, which is based on documented exploits of JWTalgsubstitution attacks, is discussed here: https://www.rfc-editor.org/rfc/rfc9421.html#name-key-and-algorithm-specifica -- specific text to note is "while this specification does allow runtime specification of the algorithm using the alg signature parameter, applications are encouraged to use other mechanisms such as static configuration or a higher-protocol-level algorithm specification instead, preventing an attacker from substituting the algorithm specified."Your question about examples doesn't make sense. Not all examples use
alg, but it's an option in the right circumstances. Why wouldn't some examples show an option? We did seek to be comprehensive with examples so of course we'll have ones that show options.For this application, if you're specifying the
ed25519algorithm path statically as seems to be the case, then it's actually better to specify it outside of the on-the-wire protocol and prohibit use of thealgparameter entirely, as given by example in the "Enforcing Application Requirements" section: "Prohibiting certain signature metadata parameters, such as runtime algorithm signaling with the alg parameter when the algorithm is determined from the key information" https://www.rfc-editor.org/rfc/rfc9421.html#section-3.2.1-3.4If this proposal seeks to profile HTTP Message Signatures, it should follow the guidelines in section 1.4 of that specification which lays out a set of application requirements for doing so: https://www.rfc-editor.org/rfc/rfc9421.html#name-application-of-http-message
For a good example of a specification that deliberately profiles RFC9421 for protecting an application using TOFU style key introduction of clients and getting access tokens out the back, I once again recommend following RFC9635 for details: https://www.rfc-editor.org/rfc/rfc9635.html#name-http-message-signatures
spacewander commentedon Sep 8, 2025
It seems that the MCP Server can also pre-generate a public / private key pair and distribute it to the client. In this way, only the allowed clients can access this MCP server, and the server knows the client's permission when it receives the keyid.
spacewander commentedon Sep 12, 2025
If the key pairs can be pre-generated by the MCP server, we don't need the clients to include their public key in the
initializerequest. This can make the HTTP Message Signing more stateless. The server instances still need to know all the keys (via connecting to the same db cluster or something else), but we don't need to ensure the client sessions are shared between different server instances.dickhardt commentedon Sep 12, 2025
How would the client get the private key to sign the request? I'm not sure you understand the principles of proof of possession - if the server generates the key pair - the private key is not secret to the client
3 remaining items
spacewander commentedon Sep 22, 2025
@dickhardt
Same as the cloud vendor's API key - only the cloud vedndor and the customer should know the private key.
The benefit is that the communication can be stateless. The server instances don't need to ensure the session is shared among all the server instances.
Otherwise, if different requests in the same session are handled by different server instances, they may not know the public key. The OAuth approach doesn't have this problem because every server instance can verify the token with the same Authorization server.
spacewander commentedon Sep 22, 2025
If the key is pre-generated by the server, we can also use this way to authorize. Since the key is distributed by the server and the server can assign its ability.
dickhardt commentedon Sep 23, 2025
Perhaps send the key in a new header rather than in initialize? And define an error the server returns if it does not have the key.
dickhardt commentedon Sep 23, 2025
Verifying a token with the AS is unusual for most AS
If the MCP servers are maintaining session state, then the public key is in session data.
spacewander commentedon Sep 24, 2025
Theoretically, yes. In reality, it is hard. Common session sharing mechanisms usually provide eventual consistency. For example, Redis replica is async by default. Stronger consistency, higher cost. That's why the trend of MCP is to make it as stateless as possible, like #1442.
Sending the public key in a new header is a solution, and we need to evaluate the cost. The public key is usually hundreds of bytes. But since we already accept the access token per request, which is also big, accepting public key + signature may be acceptable too.
dadrus commentedon Oct 16, 2025
I have some comments/questions.
According to Creating Signature Base of the RFC, all signature parameter are included in the signature. It is not possible to specify a single specific parameter -
createdhere - to be included.Additionally, message components without
@at the beginning of their names must be HTTP Fields (HTTP header) - see also HTTP Message Components.Both means
Signature-Input: sig1=("@method" "@target-uri" "content-digest" "mcp-session-id" "created");created=1756801769;keyid="7CECy79zsOm80SK3EgvHmsLM39PfUmbfSTxqOLhfgsM";alg="ed25519"is invalid and compliant implementations (e.g. httpsig) will refuse such requests.Why not relying on the
nonceparameter - a per request unique value - and thecreatedtimestamp for the same purpose? Here the relevant contents from the Signature Replay section of the RFC:Event though the RFC uses labels a lot, like you are also using in your examples -
Signature-Input: sig1=(...(sig1 is a label). Labels do not identify applications, they identify signatures. There is also discrepancy in the RFC: While Chapter 5.2 - Processing an Accept-Signature mandates thatthis requirement conflicts with Chapter 7.2.5 - Signature Labels, which clearly states:
Therefore, it might be beneficial to make use of the
tagflag and "bind" the signature verification key to it. That way the identity of the client will stay stable even in the event of key rotation, especially for trust on first use approaches as e.g. described in this SEP. I don't think it could result in privacy issues as possible tracking would be related to MCP clients and not humans.Why not using the
Signature-Acceptheader for this? The RFC provides already an answer for that concern in the Request Signatures section:The only limitation is that there is no way to inform the client about the list of algorithms which are supported, but the specification of a single algorithm using the
algparameter is perfectly possible, as well as informing the client about what else might be wrong with the current signature - like missing signature parameters and alike.Frankly speaking it feels a bit strange to tunnel errors related to HTTP Message Signatures through the MCP protocol.
Looking forward for your responses and thank you in advance.
dadrus commentedon Oct 16, 2025
Regarding resolving keys for http message signatures: I just found https://datatracker.ietf.org/doc/draft-meunier-http-message-signatures-directory/03/ - a pretty early "HTTP Message Signatures Directory" draft, which imo looks nice. It basically defines a new header
Signature-Agentwhich can either be set to a JWKS url, or contain the actual key(s) . Does it maybe make sense to use that approach instead of relying on the existence of theinitializerequest with thecnfentry?dickhardt commentedon Oct 17, 2025
@dadrus thanks for all the feedback!
Per your comments on what to sign -- I'm not an HTTP Message signing expert -- and Justin's feedback was too obtuse for me to understand -- happy to fix if there is interest in this approach!
I have no strong opinion on how JWKS url is passed, and am not tracking MCP enough to know if a session without
initializemakes sense, so will defer to others. Using a JWKS url does not easily work for desktop clientshttps://github.com/dickhardt/openid-key-binding was finally adopted by the OpenID Connect WG. This binds a key to an id_token, allowing the MCP Client to prove which user it has authenticated by using the same key to sign the HTTP Messages. This of course would require an MCP Server that would know how to use the id_token.
A number of these features would benefit from a metadata discovery mechanism of an MCP Server by an MCP Client -- which could be happening somewhere. :)
dadrus commentedon Oct 19, 2025
Thank you for your answer @dickhardt.
Not sure I could call myself an HTTP Message Signing expert either — I’m just one of those who had to dive deep into the spec to build a compliant implementation. ;)
I’m also not an MCP expert — just a security guy who strongly believes this SEP, if supported by the MCP spec, could address some important security issues in the protocol today. From that perspective, regardless of the SEP’s future, I think its description should at least use HTTP Message Signatures correctly — which simply means removing the
createdfield from the signature base.I’m not sure whether your comment above also referred to Justin’s note on the use of
alg. Knowing your background, I assume no :) Still, here’s my 5 cts: we shall removealgfrom the request'sSignature-Inputheader to avoid potential security pitfalls and prevent the rise of naive implementations as this was the case with early JWT libraries, where thealgclaim was used to dynamically select the signing algorithm for a given key.That’s definitely true. However, the idea behind the
Signature-Agentheader isn’t limited to passing a JWKS URL. It can also use adata:URI schema:data:application/http-message-signatures-directory+json[;base64],<JWKS>.Fully agree. However, I think the signaling of expectations (e.g., supported algorithms) in case of errors should happen at the level of the used protocol. To illustrate, consider this sequence:
So what should that error look like? In my view, it should be aligned with the HTTP Message Signatures protocol. In that case the response could look as follows:
Instead of
Since the MCP Client was misbehaving, the MCP Server would signal it expectations. Here, the
algparameter would represent the preferred algorithm of the MCP Server. This would even work without any type of discovery and IMO would make the implementation of e.g. proxies much simpler. At least I believe this approach is much more cohesive.This is indeed nice for first-party use cases! I'm wondering however how it relates to this SEP? According to my understanding the idea is to not have the MCP Client act as an OAuth2/OIDC client to avoid the need of DCR.
github-actions commentedon Jan 19, 2026
Friendly Reminder
Hi @dickhardt!
This SEP proposal has been inactive for 90 days.
We wanted to check in:
If this proposal is no longer being pursued, please let us know and we can close it. Otherwise, any update on the current status would be appreciated!
This is an automated message from the SEP lifecycle bot.
dsp-ant commentedon Jan 26, 2026
Thank you for submitting this SEP proposal! Unfortunately, this proposal has been open for over 5 months without finding a sponsor from the core maintainer team.
We're marking this as dormant and closing it for now. This doesn't mean the idea isn't valuable—it simply hasn't gained the traction needed to move forward at this time.
If you or someone else would like to revive this proposal in the future, please feel free to open a new issue referencing this one. We'd be happy to reconsider it with a sponsor's support.
Thank you for your contribution to MCP! 🙏
njdawn commentedon May 13, 2026
bumping this! very valuable for all products that rely on private keys / sensitive info that can't be exposed to server.