MCP Tool Access Authorization

MCP servers expose tools that AI agents can call. Without authorization, any agent can call any tool with any parameters. SAPL adds per-tool, per-parameter access control with obligations that can transform tool responses, require approval, or enforce audit trails.

What this demo shows

Architecture

The MCP server is a Spring AI application with @PreEnforce on tool methods. SAPL policies evaluate the user identity, tool name, and call parameters. The PDP runs embedded in the same process. Obligations can modify tool responses before they reach the agent.

Run the demo

git clone https://github.com/heutelbeck/sapl-demos
cd sapl-demos/mcp-clinical-trial
docker compose up -d
mvn spring-boot:run

Full source: sapl-demos/mcp-clinical-trial