sourcerykit MCP server
Commit Nov 3, 2026Enables AI agents to self-verify API and MCP calls against recorded source evidence using portable cryptographic proofs.
Also known as ProvablyAI/sourcerykit
- Stars
- 21
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 3, 2026
- License
- —
What is sourcerykit MCP?
sourcerykit enables AI agents to self-verify API and MCP calls against recorded source evidence using portable cryptographic proofs.
Summary generated from the project's README
About sourcerykit MCP server
Verifying that AI agents are reporting accurate data from tool calls is the primary function of sourcerykit. This Python SDK allows developers to detect tool calling errors and data hallucinations by comparing agent claims against recorded source evidence. It works by using an HTTP interceptor to automatically record API and MCP requests and responses, committing this evidence to a QEDB-backed verifiable database.
Developers can integrate this into existing workflows using frameworks like LangChain, CrewAI, LangGraph, or the OpenAI and Claude Agent SDKs. The setup requires Python 3.12 or higher and is initialized via a CLI command that handles account provisioning and credential management. Once configured, the system provides deterministic verdicts of PASS, CAUGHT, or ERROR. This allows downstream workflows to automatically trigger retries or repair processes when an agent provides incorrect information.
What you can do with it
- 1Detecting data hallucinationsAn AI agent can use this tool to identify when its reported values do not match the actual API response.
- 2Securing agent network accessDevelopers can prevent agents from making requests to unauthorized or untrusted web destinations.
- 3Automating workflow repairsSystems can use cryptographic proofs to decide when to restart a failed process or fix a broken agent task.
- 4Verifying SQL query resultsThe underlying database technology ensures that data retrieved via queries is computed correctly.
Written from the project's README. Every use case is checked against a quote from it.
Configuration
PROVABLY_ACCESS_TOKENPROVABLY_REFRESH_TOKENSOURCERYKIT_ORG_IDSOURCERYKIT_POSTGRES_URL
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachableprovablyai/sourcerykit is public and reachablegithub.com/provablyai/sourcerykit ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-11-03github.com/provablyai/sourcerykit ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubSourceryKit is the Python SDK for Provably. Agents self verify API and MCP calls against recorded source evidence and create portable proofs. SourceryKit detects 100% of covered tool calling errors and data hallucinations (see our benchmark). Downstream agents and workflows use those proofs to trigger retries, repair workflows and increase accuracy.
SourceryKit is powered by Provably's QEDB verifiable database, accepted at ACM CCS 2026. QEDB proves that SQL query results were computed correctly over the complete committed data, producing small, database size independent proofs averaging around 1 KB that can be proven and verified in milliseconds.
⚠️ IMPORTANT: Upgrading from a previous version? See the Migration Guides.
Features
- Verifiable claim evaluation — allows the source agent or another agent or system to verify a claim against a portable proof of the recorded tool call.
- Automatic HTTP interception — records supported API and MCP requests and responses, then commits the evidence to a QEDB-backed verifiable database with no changes to your agent code.
- Endpoint allow-listing — blocks requests to untrusted destinations at the source.
- Deterministic verdicts — every run resolves to
PASS,CAUGHT, orERRORagainst cryptographically anchored records. - Framework-agnostic — drops into OpenAI Agents SDK, LangChain, Claude Agent SDK, CrewAI, and LangGraph.
Under the hood, these are the pieces doing the work:
- HTTP Interceptor: Patches your HTTP libraries to watch and log outbound calls, blocking untrusted requests on the spot.
- Trusted Endpoints: A database allow-list of approved destinations for your agent.
- Intercepts Table: A QEDB-backed verifiable database table that logs and commits every request and response for auditing, proof generation and independent verification.
- SourceryKitAgentResponse: A Pydantic model used as the structured response_format for your agent. Enforces a typed response contract with a
claimed_valueslist of extracted values. - Handoff Payload: A clean data bundle containing the claims your agent is making about its external actions.
- Evaluator: Compares the handoff payload against records in the Provably backend to give you a clear verdict.
- Provably Backend: The source of truth that turns your local intercepts into anchored verification proofs.
Quickstart
Requires Python 3.12+.
pip install sourcerykit
sourcerykit init # one-time setup: account, sandbox, credentials
Prefer installing from source?
git clone git@github.com:ProvablyAI/sourcerykit.git
pip install -e ./sourcerykit
Give your agent SourceryKitAgentResponse as its output type, run it inside an intercept context, then check the verdict before you trust its claims:
import uuid
import httpx
import sourcerykit
from agents import Agent, Runner
from sourcerykit import SourceryKitAgentResponse
async def run_verifiable_agent():
# 1. Fire up the system
await sourcerykit.bootstrap_system()
# 2. Tell the registry which URL is allowed
await sourcerykit.insert_trusted_endpoint(url="https://api.example.com/data")
# 3. Make a network call inside an intercept context
async with sourcerykit.async_intercept_context(agent_id="demo-agent", action_name="get_data"):
async with httpx.AsyncClient() as client:
response = await client.get(
"https://api.example.com/data",
params={"query": "example_parameter"}
)
response.raise_for_status()
# 4. Run agent with SourceryKitAgentResponse as the output format
# (e.g., output_type=... for OpenAI, response_format=... for LangChain, output_format=... for Claude).
# The output is a structured response containing `claimed_values`.
prompt = "You are a helpful assistant."
agent = Agent(
name="demo-agent",
instructions=prompt,
tools=[...],
model="model-name",
output_type=SourceryKitAgentResponse,
)
result = await Runner.run(agent, prompt)
final_output: SourceryKitAgentResponse = result.final_output
# 5. Build the handoff payload from the agent's structured output
payload_data = {
"answer": final_output.answer,
"claims": [
{
"action_name": "get_data",
"claimed_value": final_output.claimed_values,
"verification_mode": "field_extraction",
}
],
}
payload = await sourcerykit.build_handoff_payload(
payload_data,
run_id=uuid.uuid4(),
prompt=prompt,
intercept_agent_id="demo-agent",
)
# 6. Ask the evaluator for a verdict
result = await sourcerykit.evaluate_handoff(payload=payload)
print(f"Evaluation Outcome: {result.get('outcome')}") # PASS, CAUGHT, or ERROR
Configuration
To get things running, SourceryKit must be configured with your project variables. The interactive CLI handles account provisioning, organization workspace initialization, database validation, and persists credentials globally (OS application folder) and locally (project .env).
sourcerykit init
The wizard will guide you through:
- Account Login (OAuth): Log in securely with your browser and select your organization workspace.
- API Key Generation: Automatically fetch your SDK API-KEY from your account profile.
- Database Provisioning: Creates a hosted sandbox database automatically. To use your own PostgreSQL instead, pass
--postgres-url. - Save Config: Automatically write your credentials and tokens straight to a local .env file.
⚠️ IMPORTANT: The wizard only configures SOURCERYKIT_* variables. It does not handle third-party LLM provider infrastructure keys, which must still be exported separately.
Manual configuration (fallback)
Already have credentials, or need to bypass the wizard (CI, containers, debugging)? Environment variables override the stored config:
export PROVABLY_ACCESS_TOKEN="..."
export PROVABLY_REFRESH_TOKEN="..."
export SOURCERYKIT_ORG_ID="..."
export SOURCERYKIT_POSTGRES_URL="postgresql://user:password@host:5432/db"
[!NOTE]
SOURCERYKIT_POSTGRES_URLis set automatically when using a sandbox. Only set it manually if you're using your own database.
For a full list of CLI commands, check out the CLI Documentation file, or simply run:
sourcerykit --help
For a full list of environment variables, see .env.example.
More Docs
Want to dig into the details? Check out our documentation and specific guides:
- Official Documentation: Visit provably.ai/docs for the complete reference.
- End-to-End Walkthrough — Get up and running from scratch.
- Cookbooks & Examples — Practical recipes and code samples.
Technical Guides
Contributing
We welcome fixes, features, and doc updates! Check out CONTRIBUTING.md to see how to run tests and open up a pull request.
License
This project is licensed under the Business Source License 1.1.
- Copyright © 2026 Provably Technologies LTD
- You may not offer the Software as a commercial hosted service without purchasing a commercial license from Provably Technologies Ltd.
- On 2029-05-07, the license will automatically convert to GPL-3.0-or-later.
See the LICENSE file for full terms and details.
sourcerykit MCP questions
What frameworks does SourceryKit support?
It is framework-agnostic and works with OpenAI Agents SDK, LangChain, Claude Agent SDK, CrewAI, and LangGraph.
Can I use my own database instead of the provided sandbox?
Yes, you can use your own PostgreSQL database by passing the --postgres-url flag during setup.
What are the possible evaluation outcomes?
Every run resolves to one of three deterministic verdicts: PASS, CAUGHT, or ERROR.