Securely Attest MCP Server Integrity
A remotely attestable MCP server that proves its running code via an SGX-backed RA-TLS certificate before a client connects.
Why it matters
Establish cryptographically verifiable trust for your MCP server by leveraging remote attestation within a Trusted Execution Environment (TEE). Ensure the integrity of your server code before establishing connections.
Outcomes
What it gets done
Implement remote attestation using RA-TLS for MCP servers.
Verify server code integrity via cryptographic means before connection.
Optionally enable MCP servers to remotely attest MCP clients.
Generate signed attestations of code running inside a TEE.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-attestable-mcp | bash Overview
Attestable MCP Server
A remotely attestable MCP server that proves its running code via an SGX-backed RA-TLS certificate, built and signed inside a trusted execution environment. Use when an MCP client needs cryptographic proof a server is running unmodified code before connecting, in a confidential-computing deployment.
What it does
This is an MCP server that is remotely attestable by MCP clients, using a trusted execution environment (TEE) to generate a certificate representing the exact code currently running. The server presents this certificate during the TLS handshake, before an MCP client connects, using RA-TLS - an extension to TLS that adds machine- and code-specific measurements a client can independently verify. The certificate embeds an SGX quote in the standardized X.509 extension field defined by the TCG DICE "tagged evidence" OID, which in turn carries the full SGX report and Intel SGX certificate chain, plus evidence claims including a "pubkey-hash" claim - the hash of the ephemeral public key (DER format) the TEE generates for the running server's memory image. A client can independently rebuild the same code (on emulated or secure hardware) and confirm the resulting values match what the running server presents, proving the server is running the exact code built on GitHub Actions. Signed artifacts are produced by a self-hosted GitHub runner running inside a TEE: the action builds a Docker container for the server and generates a signed attestation of the code running inside the TEE, with the resulting image signed by GitHub.
When to use - and when NOT to
Use it when an MCP client needs cryptographic proof that a server is running specific, unmodified code - for example, verifying a hosted MCP server hasn't been tampered with before sending it sensitive requests. It optionally supports the reverse direction too: an MCP server can remotely attest its clients. Do NOT expect a ready-made MCP client demonstrating RA-TLS verification yet - the project's own TODO list still has this as unimplemented, along with publishing Intel-signed measurements in the README for simpler independent verification. Running it requires Intel SGX hardware (or emulation) plus Gramine, Python 3.13, Ubuntu 22.04, and the Intel SGX SDK & PSW - it is not a lightweight or hardware-agnostic deployment.
Capabilities
Remote code attestation via an RA-TLS certificate embedding an SGX quote and a pubkey-hash claim tied to the TEE's ephemeral key, verifiable by rebuilding the same code independently. Optional reverse attestation of MCP clients by the server. Signed, reproducible build artifacts produced via a self-hosted GitHub Actions runner inside a TEE. Roadmapped but not yet shipped: JSON Web Key (JWK) attestation claim validation, per the project's own future-plans notes.
How to install
Requires Intel SGX Hardware, Gramine, Python 3.13, Ubuntu 22.04, and the Intel SGX SDK & PSW. Build and package the server through Gramine's gsc tool, then run the resulting image with device mounts for the SGX provisioning and enclave devices on secure hardware, or without them for local development.
uv sync
docker build -t attestable-mcp-server .
gramine-sgx-gen-private-key
git clone https://github.com/gramineproject/gsc docker/gsc
cd docker/gsc
uv run ./gsc build-gramine --rm --no-cache -c ../gramine_base.config.yaml gramine_base
uv run ./gsc build -c ../attestable-mcp-server.config.yaml --rm attestable-mcp-server ../attestable-mcp-server.manifest
uv run ./gsc sign-image -c ../attestable-mcp-server.config.yaml attestable-mcp-server "$HOME"/.config/gramine/enclave-key.pem
uv run ./gsc info-image gsc-attestable-mcp-server
Who it's for
Teams running or consuming an MCP server in a context where verifiable, tamper-evident code execution matters - confidential-computing and security-conscious deployments that need cryptographic proof of what code is actually running.
Source README
➡️ attestable-mcp-server
remotely attestable MCP server
Overview
This project contains an MCP Server that is remotely attestable by MCP clients. To achieve this, a trusted execution environment is used, which generates a certificate representing the currently-running code of the attestable-mcp-server. The attestable-mcp-server sends this certificate in the TLS handshake to an MCP client before connecting that proves the code it's running is the same code built on github actions, and can be independently validated by building and running the code locally on emulated hardware or secure hardware; these values will be the same. The protocol used for client <-> server remote attestation is RA-TLS, an extension to TLS that adds machine and code specific measurements that can be verified by an MCP client.
The most important concept behind this RA-TLS certificate is that it embeds an SGX quote in the standardized X.509 extension field with the TCG DICE "tagged evidence" OID, which in turn embeds the SGX report and the complete Intel SGX certificate chain. In addition to the SGX quote, the certificate also contains the evidence claims, with the most important one being the "pubkey-hash" claim that contains the hash of the ephemeral public key (in DER format) generated by the TEE of the memory image of the running MCP server.
Features
- MCP Clients can remotely attest the code running on any MCP Server
- MCP Servers can optionally remotely attest MCP Clients
Producing Signed Artifacts
The github action script in this repo runs on a self-hosted github runner inside of a trusted execution environment (TEE). The action script will build a docker container containing the attestable-mcp-server and generate a signed attestation of the code running inside the TEE. This docker image is then signed by github. You can independently generate the same values with or without secure hardware, and query our running server and get the same values.
Dependencies
- Intel SGX Hardware
- Gramine
- python 3.13
- Ubuntu 22.04
- Intel SGX SDK & PSW
Quickstart
uv sync
docker build -t attestable-mcp-server .
gramine-sgx-gen-private-key
git clone https://github.com/gramineproject/gsc docker/gsc
cd docker/gsc
uv run ./gsc build-gramine --rm --no-cache -c ../gramine_base.config.yaml gramine_base
uv run ./gsc build -c ../attestable-mcp-server.config.yaml --rm attestable-mcp-server ../attestable-mcp-server.manifest
uv run ./gsc sign-image -c ../attestable-mcp-server.config.yaml attestable-mcp-server "$HOME"/.config/gramine/enclave-key.pem
uv run ./gsc info-image gsc-attestable-mcp-server
Starting Server on Secure Hardware
docker run -itp --device=/dev/sgx_provision:/dev/sgx/provision --device=/dev/sgx_enclave:/dev/sgx/enclave -v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket -p 8000:8000 --rm gsc-attestable-mcp-server
Starting Server on local development machine
docker run -p 8000:8000 --rm gsc-attestable-mcp-server
TODO
- add MCP client demonstrating ra-tls
- add intel-signed measurements from our github action to this readme for simple independent verification
Future Plans
- JSON Web Key (JWK) attestation claim validation
cobrowser.xyz
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.