anthropics / anthropics/claude-cookbooks

Cookbook recipe: Trust-gated MCP tool calls with behavioral scoring

Abierto
#656 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
52.7k
Forks
6.3k
Merge medio
25 min
PR fusionados (30 d)
6

Descripción

## Proposed cookbook recipe

A notebook showing how to add trust verification to MCP tool calls before Claude executes them. With 14,820+ MCP servers in the wild, agents need a way to verify server reliability before calling tools.

## What it would cover

1. **Query trust scores** before executing MCP tool calls
2. **Set minimum thresholds** — block servers below a configurable score (0-100)
3. **Get attestation receipts** — cryptographic proof that a trust check happened
4. **Fallback strategies** — what to do when a server is untrusted

## Code sketch

```python
import httpx

async def check_trust(server_url: str, min_score: int = 60) -> dict:
resp = await httpx.AsyncClient().get(
"https://dominion-observatory.sgdata.workers.dev/api/trust",
params={"server": server_url}
)
data = resp.json()
if data["trust_score"] < min_score:
raise Exception(f"Server below threshold: {data['trust_score']}/{min_score}")
return data
```

## Why this matters

- **14,820+ MCP servers** tracked with behavioral data
- **MiCA Article 12** (EU, July 2026) requires audit trails for AI-driven compliance
- Attestation receipts provide cryptographic proof for regulatory compliance

## Resources

- Live API: https://dominion-observatory.sgdata.workers.dev
- Demo: https://dominion-observatory.sgdata.workers.dev/get-started
- CTEF spec: https://doi.org/10.5281/zenodo.20285663

Happy to write the full notebook if there's interest.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.