Problem
fastapi_mcp exposes FastAPI endpoints as MCP tools with auth support. But current auth is designed for human users. As AI agents become primary consumers of MCP tools, we need a way to verify which agent is calling and how trustworthy it is.
Proposal
Add optional middleware/dependency that verifies the calling agent's identity via the Solana Agent Trust Protocol (SATP):
from fastapi_mcp import AgentIdentity
@app.get("/sensitive-data")
@AgentIdentity(min_trust_score=50)
async def get_data(agent: VerifiedAgent):
# agent.wallet, agent.trust_score, agent.verifications available
return {"data": "..."}
What This Enables
- Trust-gated endpoints — require minimum trust score to access sensitive tools
- Agent audit trail — log which verified agent called which endpoint
- Zero-knowledge verification — on-chain identity, no centralized auth server needed
Implementation Sketch
- New
AgentIdentity dependency that extracts agent wallet from request header
- Verify wallet signature against SATP on-chain PDA
- Fetch trust score from AgentFolio API (
GET /api/agents/{wallet})
- Inject
VerifiedAgent object into endpoint
Why fastapi_mcp?
With 11K+ stars and auth already built in, this is the natural place to add agent-native identity. Human auth + agent auth = complete MCP security.
Happy to contribute a PR for the middleware.
Links: AgentFolio | SATP
Problem
fastapi_mcp exposes FastAPI endpoints as MCP tools with auth support. But current auth is designed for human users. As AI agents become primary consumers of MCP tools, we need a way to verify which agent is calling and how trustworthy it is.
Proposal
Add optional middleware/dependency that verifies the calling agent's identity via the Solana Agent Trust Protocol (SATP):
What This Enables
Implementation Sketch
AgentIdentitydependency that extracts agent wallet from request headerGET /api/agents/{wallet})VerifiedAgentobject into endpointWhy fastapi_mcp?
With 11K+ stars and auth already built in, this is the natural place to add agent-native identity. Human auth + agent auth = complete MCP security.
Happy to contribute a PR for the middleware.
Links: AgentFolio | SATP