Treat the Bearer as a LIME passport: verify it is genuine for your hostname, take agent_id, then use that identity in your tools — nothing else.
Protected tools run only with a real hostname-bound MCP JWT and a known agent_id.
TokenVerifier(expected_domain=your hostname without port). If valid — take agent_id and run the tool. If missing or fake — reject.
from lime_mcp_server import TokenVerifier
MCP_ACCESS_TOKEN = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
# expected_domain = public hostname THIS server serves (no port).
verifier = TokenVerifier(expected_domain="your-mcp-rs.example")
result = verifier.verify(MCP_ACCESS_TOKEN)
if result.is_valid:
print(result.agent_id, result.domain)AssertTokenVerifier.is_valid; result.agent_id for ACL; aud=mcp, TTL ~300s.
The agent never sends LIME_AGENT_TOKEN here. You only see a short passport JWT. Your RS chooses the HTTP/JSON-RPC error body on failure.
missing/invalid Bearer → your 401 / JSON-RPC auth error| Scope | Status | Code | When | What to do |
|---|---|---|---|---|
| Your RS | 401 | missing_bearer | Authorization absent or not Bearer | Require Bearer MCP JWT before protected tools; map to your transport error |
| Your RS | 401 | invalid_mcp_jwt | Signature, aud=mcp, TTL, or domain pin fails in TokenVerifier | Reject the call; do not run the tool |
| Your RS | 403 | domain_mismatch | JWT domain claim ≠ expected_domain | Align agent mint domain with TokenVerifier(expected_domain=…) |