Turn AI Agents Into Evidence-Driven Research Systems.
Agletras Intelligence is an open-source, local-first Model Context Protocol (MCP) server that connects frontier AI agents to structured, bounded multi-source research pipelines, SQLite WAL evidence indexing, and automated epistemic claim verification with zero mandatory paid APIs.
Interactive Research Cockpit
Inspect an illustrative execution trace demonstrating how Agletras Intelligence bounds subquestions, fetches multi-format sources with outbound SSRF protection, indexes passages with exact character offsets, and verifies claims into explicit epistemic states via standard MCP integration. All displayed timings, sample entities, and passage counts are simulated examples demonstrating actual tool capabilities, not live server execution.
[F1] The entity maintains active statutory registration in Nashik, Maharashtra (PIN 422003) as confirmed by official filings [S1:p3]. SUPPORTED
[F2] Capitalization disclosures exhibit irreconcilable dates: filing A records $12M Series A closing August 2024 [S2:p1], whereas registry B records $8.5M aggregate funding [S3:p4]. CONFLICTING EVIDENCE — UNRESOLVED
[F3] Claims of dominant regional market share lack corresponding primary documentation. UNVERIFIED
{
"jsonrpc": "2.0",
"id": 104,
"method": "tools/call",
"params": {
"name": "verify_claims",
"arguments": {
"run_id": 1,
"claim_ids": [42],
"method": "deterministic"
}
}
} {
"jsonrpc": "2.0",
"id": 104,
"result": {
"run_id": 1,
"verifications_evaluated": 1,
"claims": [
{
"claim_id": 42,
"claim_text": "Registered corporate office located in Nashik, Maharashtra, PIN 422003",
"epistemic_status": "SUPPORTED",
"matched_passage_id": 12,
"term_coverage": 0.94,
"exact_quote_match": true,
"source_locator": "page 3, sec: Statutory Registration",
"sha256": "4b2f8a19c3e218e87d0921473fa0081d6..."
}
],
"unresolved_conflicts_surfaced": 0
}
} Connect AI Agents to Evidence-Driven Intelligence
Agletras Intelligence exposes a standardized Model Context Protocol (MCP) server that connects frontier models directly to local-first evidence pipelines. Through 40 registered MCP tools across 6 suites, agents can orchestrate investigations, retrieve multi-format sources, index passages, and verify factual claims through evidence-backed claim verification. Public web search and URL retrieval require internet access with strict outbound SSRF protections, while parsing, evidence indexing, and claim verification run entirely locally with zero mandatory paid APIs.
Agent Runtimes & Client Layer
Standard Model Context Protocol Integration
Bidirectional JSON-RPC 2.0 message framing over standard input/output (stdio). Zero Code Mode wrappers required.
Subprocess boundary isolation: agent runtime executes server in a sandboxed child process with inherited stdio streams.
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "start_research_run",
"arguments": {
"query": "Target Entity Corporate Ownership & Directorships"
}
},
"id": 101
} Protocol Gateway & Dispatcher
Server Core & Registered Tool Suites
40 registered @mcp.tool entrypoints across 6 suites. Deterministic argument type validation and structured ToolError handling.
Input sanitization: string limits, integer ranges, and mandatory argument verification prevent malformed payloads.
# FastMCP Server Gateway Registration (src/agletras_mcp/server.py)
mcp = FastMCP("agletras_mcp", dependencies=["pypdf"])
@mcp.tool()
def verify_claims(run_id: int, claim_ids: list[int] | None = None, method: str = "deterministic") -> dict:
"""Evaluates claims against passage text into 6 unambiguous epistemic states."""
... Outbound NetPolicy & Ingestion
SSRF-Guarded Multi-Format Fetchers
All outbound HTTP(S) fetches pass through SafeRedirectHandler. Local reads bounded to AGLETRAS_LOCAL_ROOTS.
SSRF Guard: Resolves DNS and blocks loopback (127.0.0.1), RFC1918 private IPs, CGNAT (100.64.0.0/10), and cloud metadata (169.254.169.254).
# Outbound SSRF Protection (src/agletras_mcp/netpolicy.py)
_EXTRA_BLOCKED_NETS = (
"0.0.0.0/8", "100.64.0.0/10", "192.0.0.0/24",
"192.0.2.0/24", "198.18.0.0/15", "198.51.100.0/24",
"203.0.113.0/24", "2001:db8::/32"
)
# Normalizes IPv4-mapped IPv6 (::ffff:10.0.0.1) and rejects private ranges Local Evidence Store & SQLite WAL
Content-Addressed Passage Indexing
Zero cloud database dependencies. Single-file SQLite WAL store (research.db) with FTS5 passage index and schema migrations.
Deduplication by SHA-256 fingerprinting. Passage character boundaries (start_offset, end_offset) prevent hallucinated citations.
-- Content-Addressed Passage Record in SQLite (research.db)
CREATE TABLE passages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source_id INTEGER NOT NULL REFERENCES sources(id),
sha256 TEXT NOT NULL,
start_offset INTEGER NOT NULL,
end_offset INTEGER NOT NULL,
locator TEXT NOT NULL DEFAULT '',
verbatim_text TEXT NOT NULL
);
CREATE VIRTUAL TABLE passages_fts USING fts5(verbatim_text, content=passages); Epistemic Engine & Synthesis
Six-State Verification & Word DOCX
Deterministic claim evaluation against exact passage text. Bounded budgets: max 8 subquestions, 2 rounds, 20 unique sources.
Validation gatekeeper: validate_report() enforces zero dangling citations and ensures structural completeness before release.
{
"claim_id": 42,
"claim_text": "Registered corporate office located in Nashik, Maharashtra, PIN 422003",
"epistemic_status": "SUPPORTED",
"term_coverage": 0.94,
"exact_quote_match": true,
"attached_citations": [
{ "source_id": 1, "passage_id": 12, "locator": "page 3, sec: Statutory Registration" }
],
"structural_integrity": "PASSED (0 dangling citations)"
} Multi-Source Ingestion & Extraction
Equips agents with search_web, fetch_url, extract_pdf, extract_document (DOCX/XLSX/CSV), and collect_local_folder. Public web retrieval requires internet access, guarded by outbound NetPolicy blocking loopback, RFC1918 private IPs, and cloud metadata.
Content-Addressed Evidence Store
Every source undergoes change detection through SHA-256 content hashing in local SQLite WAL storage. Text is segmented into deterministic passage slices with exact character offsets and page locators. Searchable via SQLite FTS5 with citations pointing to exact verified text.
Claim Extraction & Epistemic Engine
Extracts factual statements and maps them to exact passage locators. Evaluates claims into 6 unambiguous epistemic states: SUPPORTED, PARTIALLY SUPPORTED, CONTRADICTED, CONFLICTING EVIDENCE, UNSUPPORTED, and UNVERIFIABLE.
Autonomous Orchestration & Planning
Orchestrates primary OpenCode research agents under bounded execution budgets (subquestions, rounds, candidate caps). Enforces stopping rationale, logs immutable audit events, and automatically populates validated corporate DOCX deliverable packages.
Continuous Monitoring & Project Memory
Recalls verified evidence and findings across historical research runs. Registers web pages and file targets for periodic change detection checks with SHA-256 diff hashing and historical modification tracking.
Visual Analysis & Image Research
Queries visual source metadata for candidate discovery across research targets. Performs visual analysis and OCR extraction via local image paths or optional external vision endpoints without breaking local-first workflows.
SOURCE-VERIFIED MCP TOOL DIRECTORY // 40 REGISTERED TOOLS IN CODE Inspect All 40 Tools
Every tool listed below is registered in src/agletras_mcp/server.py and implemented across local modules. No invented, duplicate, or unverified tools exist. Public web retrieval requires internet access with outbound SSRF protections, while evidence indexing, SQLite WAL storage, and deterministic claim verification execute locally.
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| health_check | src/agletras_mcp/server.py | Liveness probe: verifies local server and storage connectivity. (no args) |
| fetch_url | src/agletras_mcp/webfetch.py | SSRF-guarded HTTP/HTTPS page retrieval with readable text extraction. (url, max_chars, save, title, notes) |
| search_web | src/agletras_mcp/search.py | Multi-provider web search (DuckDuckGo, Wikipedia) with normalized results. (query, max_results) |
| extract_pdf | src/agletras_mcp/pdf.py | Page-by-page PDF extraction using pypdf with character locator tracking. (source, max_pages, max_chars, save, title, notes) |
| collect_sources | src/agletras_mcp/collect.py | Parallel ingestion across URLs, local files, and search queries with deduplication. (sources, search, search_limit, max_chars, save, include_text, concurrency) |
| collect_local_folder | src/agletras_mcp/localfs.py | Recursive directory traversal with path-containment guards for approved folders. (folder, recursive, extensions, max_files, save, include_text) |
| extract_document | src/agletras_mcp/officedoc.py | Unified text extraction from DOCX, XLSX, CSV, and Markdown without external runtime deps. (source, max_chars, save, title, notes) |
| save_source | src/agletras_mcp/storage.py | Persists an extracted source record with SHA-256 fingerprint into SQLite. (kind, title, content, url, path, notes) |
| get_source | src/agletras_mcp/storage.py | Retrieves a stored source record by ID with metadata and passages. (source_id, include_content, include_passages) |
| list_sources | src/agletras_mcp/storage.py | Lists stored source records with pagination, ordered newest first. (limit, offset, kind, source_type) |
| search_sources | src/agletras_mcp/storage.py | Full-text keyword search across stored source titles and extracted content. (query, limit) |
| export_report | src/agletras_mcp/report.py | Compiles collected sources into a structured Markdown summary report. (title, source_ids, query, limit, include_excerpts) |
| stats | src/agletras_mcp/storage.py | Returns operational storage metrics: total sources, passages, runs, and DB size. (no args) |
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| start_research_run | src/agletras_mcp/evidence.py | Initializes a tracked research run with configuration presets and isolation. (query, config) |
| save_evidence | src/agletras_mcp/evidence.py | Persists source text into evidence library with SHA-256 passage segmentation. (source, source_id, text, title, url, path, notes, run_id, refresh, max_chars) |
| search_evidence | src/agletras_mcp/evidence.py | Full-text passage search via SQLite FTS5 for claim matching. (query, limit, run_id) |
| register_claim | src/agletras_mcp/evidence.py | Records an atomic factual proposition for epistemic evaluation. (run_id, claim_text) |
| attach_citation | src/agletras_mcp/evidence.py | Links a claim to an exact passage offset and derives verified epistemic status. (claim_id, passage_id, source_id, quote, locator, relation, metadata) |
| get_claim_citations | src/agletras_mcp/evidence.py | Retrieves all attached citations, source locators, and quotes for a claim. (claim_id) |
| get_research_history | src/agletras_mcp/evidence.py | Retrieves historical research run execution traces and evidence chains. (run_id, limit) |
| generate_report | src/agletras_mcp/evidence.py | Builds a validated claims and citations deliverable with stable reference IDs. (run_id, title) |
| validate_report | src/agletras_mcp/synthesis.py | Re-validates structural completeness, citation resolution, and epistemic consistency. (report_id) |
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| extract_claims | src/agletras_mcp/verification.py | Deterministic sentence splitter extracting verifiable factual candidate statements. (run_id, text, source_ids, max_claims, register, claim_type) |
| verify_claims | src/agletras_mcp/verification.py | Evaluates claims against passage text into 6 unambiguous epistemic states. (run_id, claim_ids, apply_citations, method) |
| analyze_conflicts | src/agletras_mcp/verification.py | Surfaces evidential contradictions and conflicting claims across independent sources. (run_id, include_sources) |
| generate_markdown_report | src/agletras_mcp/synthesis.py | Generates comprehensive 10-section verified synthesis report with reference registry. (run_id, title, include_source_assessment) |
| get_report | src/agletras_mcp/synthesis.py | Retrieves stored Markdown or JSON synthesis report deliverables by ID. (report_id, include_content) |
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| save_research_plan | src/agletras_mcp/planner.py | Persists execution bounds (max 8 subquestions, 2 rounds, 4 candidates, 20 sources). (run_id, objective, subquestions, scope, assumptions, limits) |
| update_subquestion | src/agletras_mcp/planner.py | Updates status of an inquiry subquestion (answered, partial, unanswered, conflicting). (run_id, subquestion_id, status, note) |
| log_run_event | src/agletras_mcp/planner.py | Appends an immutable audit event to the research_run_events log table. (run_id, kind, message, subquestion_id, source_id, payload) |
| start_followup_round | src/agletras_mcp/planner.py | Advances to a follow-up inquiry round while enforcing maximum round bounds. (run_id, reason, subquestion_id) |
| finish_research_run | src/agletras_mcp/planner.py | Records stopping rationale (completed, budget exhausted, error) and closes run. (run_id, status, reason, error) |
| get_engagement | src/agletras_mcp/engagement.py | Returns the frozen commercial engagement snapshot and deliverable record. (run_id, engagement_id) |
| generate_client_report | src/agletras_mcp/engagement.py | Executes full reporting pipeline to produce Markdown or validated Word DOCX. (run_id, force, format) |
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| search_memory | src/agletras_mcp/memory.py | Recalls verified evidence and findings across historical research runs. (query, project, limit, max_age_days) |
| monitor_add_target | src/agletras_mcp/monitor.py | Registers a web page or file target for continuous change detection monitoring. (target, name, project, kind) |
| monitor_check | src/agletras_mcp/monitor.py | Executes periodic change detection checks over registered targets with diff hashing. (target_ids, project, parallel) |
| monitor_changes | src/agletras_mcp/monitor.py | Returns detected content diffs, structural changes, and historical modification records. (target_id, project, meaningful_only, since_days, limit) |
| Registered Tool | Implementation File | Verified Purpose & Parameters |
|---|---|---|
| search_images | src/agletras_mcp/images.py | Queries visual source metadata and returns normalized discovery candidates. (query, provider, max_results) |
| analyze_image | src/agletras_mcp/images.py | Performs visual analysis and OCR extraction via optional external vision endpoint. (image_url, image_urls, local_path, source_id, save, prompt) |
Enterprise-Grade Security Architecture Grounded in Code
Agletras Intelligence is designed for sensitive corporate intelligence and regulated research environments. Every security control below is implemented in tested Python source code.
Local-First SQLite Storage & Zero Remote Leakage
All collected sources, passage offsets, and research runs are stored strictly on the local machine in SQLite WAL mode. Zero data is transmitted to external cloud servers.
Single-file SQLite store (research.db) with PRAGMA journal_mode=WAL, foreign keys enabled, and busy timeouts. No ORM, no external analytics, no telemetry beacons.
Socket-Level SSRF Guard & Redirect Validation
All outbound HTTP(S) fetches validate resolved DNS addresses against a comprehensive denylist before initiating connections, neutralizing internal network pivot attacks.
Blocks RFC 1918 private ranges (10/8, 172.16/12, 192.168/16), loopback (127.0.0.1), CGNAT, and cloud metadata (169.254.169.254). SafeRedirectHandler re-validates each redirect hop.
Filesystem Boundary Confinement & Symlink Defense
Local document extraction is confined to explicit allowed roots. Symlinks resolving outside the configured root directory are refused with access_denied.
Directory traversal guards with path containment checks. Automatically skips editor locks, temporary files (~, .tmp), and system files (.ds_store, desktop.ini). Logs never record file contents.
Deterministic Budget Bounding & Runaway Prevention
Autonomous research agents operate within hard execution caps to prevent infinite loops, rate-limit bans, and runaway resource consumption.
Default limits enforced in code: max 8 subquestions, max 2 follow-up rounds, max 4 candidates per question, and max 20 unique sources per run. Append-only SQLite event audit trail.
Agletras Intelligence strictly conducts lawful, passive research using publicly accessible records, corporate registries, official gazettes, and user-provided documents. The server contains zero functionality for port scanning, credential stuffing, vulnerability exploitation, or unauthorized portal access.
Four Grounded Use Cases for Enterprise Intelligence
How autonomous agents and analytical teams deploy Agletras Intelligence across corporate entity tracing, executive vetting, digital threat mapping, and compliance verification with verifiable passage citations, character-offset anchors, and deterministic claim evaluation.
Corporate Entity & Beneficial Ownership Diligence
Autonomous agents bound multi-source inquiries across corporate registries, official gazettes, and cross-border holding networks. Extracts shareholder networks and ultimate beneficial ownership structures directly linked to verifiable primary filings.
Leadership Background & Credential Verification
Systematic evaluation of executive employment timelines, past directorships, regulatory compliance records, and public digital exposure. Deterministic number and date checks immediately flag timeline conflicts.
Brand Impersonation & Digital Attack Surface
Investigate external digital threats, fraudulent lookalike domain registrations, and deceptive counterparties targeting your organization. Socket-level NetPolicy prevents SSRF pivots during threat intelligence gathering.
Regulatory & Compliance Evidence Provenance
Audit-ready evidentiary dossiers with unbroken citation chains for legal counsel, auditors, and compliance officers. Every assertion is tied to character offsets and SHA-256 hashes with zero dangling citations.
Fast-Track Onboarding & Client Integration
Follow the 5-step journey to discover, install, configure, connect, and execute Agletras Intelligence v0.2.0. Connect directly via standard Model Context Protocol (stdio) or model-free CLI.
From Zero to First Verified Research Run in 5 Steps
Agletras Intelligence is designed for rapid local developer setup. Zero cloud accounts, zero API keys required, and zero network telemetry. Follow the path below to stand up your local research node.
What is Agletras Intelligence?
Agletras is a production-grade Model Context Protocol (MCP) server written in pure Python. It equips autonomous AI agents with tools to discover open-web sources, extract documents with SSRF security guardrails, index discrete passages with SHA-256 offsets into local SQLite WAL storage, and verify factual assertions without hallucinations.
Clone Repository & Install Dependencies
Create an isolated Python virtual environment and perform an editable package install. The project intentionally has only four runtime dependencies (mcp, pypdf, python-docx, rich) — all pure Python.
# 1. Clone repository
git clone https://github.com/Agletras/Agletras-mcp.git
cd Agletras-mcp
# 2. Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 3. Install tested pinned dependencies and editable package
pip install -r requirements.txt
pip install -e .
# 4. Generate sample verification fixtures
python scripts/make_sample_pdf.py Configure Security Boundaries and Storage Paths
Agletras works immediately with zero configuration. To customize storage directories or enforce domain whitelisting, copy the annotated configuration template:
# Optional: Copy config.example.toml to your project home
cp config.example.toml agletras.toml
# Example custom settings:
[paths]
data_dir = "data" # SQLite research.db storage directory
reports_dir = "reports" # Exported Markdown & DOCX dossiers
[security]
allow_private_hosts = false # Strict SSRF guard: blocks RFC 1918 & 169.254.169.254
allowed_domains = [] # Optional: Restrict fetches to explicit suffixes (e.g. ["sec.gov"])
[fetch]
timeout = 20.0 # Socket timeout ceiling (seconds)
max_bytes = 10485760 # 10 MiB raw fetch size ceiling Register Agletras in Your Preferred MCP Client
The Agletras server speaks standard JSON-RPC 2.0 over standard input/output. Point your agent client to the Python executable executing module agletras_mcp.
{
"mcpServers": {
"agletras": {
"command": "/absolute/path/to/Agletras-mcp/.venv/bin/python",
"args": ["-m", "agletras_mcp"],
"env": {
"AGLETRAS_STORAGE_DIR": "/absolute/path/to/Agletras-mcp/data"
}
}
}
} Run Environment Doctor & Execute Your First Research Run
Verify your environment using the built-in diagnostic doctor. You can run research interactively through your AI agent, or execute model-free research runs via the CLI:
# 1. Run comprehensive local health diagnostics
python -m agletras_mcp.cli doctor
# Expected Output:
# [OK] Python runtime: 3.11.x (supported)
# [OK] Packages: mcp >= 2.3, pypdf >= 6.21
# [OK] SQLite: 3.42.0 (WAL + FTS5 enabled)
# [OK] Writable directories: data, reports, cache, logs
# [OK] NetPolicy: SSRF private IP blocker active
# Doctor check: 7/7 required checks passed.
# 2. Run model-free pipeline demo
python scripts/demo_research.py Verified Harness Configurations & Wire Protocols
Agletras operates strictly over standard input/output (stdio) with JSON-RPC 2.0 envelopes. Below are verified configuration files for tested agent environments and exact wire protocol messages.
{
"mcpServers": {
"agletras": {
"command": "/absolute/path/to/Agletras-mcp/.venv/bin/python",
"args": ["-m", "agletras_mcp"],
"env": {
"AGLETRAS_STORAGE_DIR": "/absolute/path/to/Agletras-mcp/data",
"AGLETRAS_ALLOWED_DOMAINS": "sec.gov,companieshouse.gov.uk,wikipedia.org"
}
}
}
} %APPDATA%\Claude\claude_desktop_config.json (use Scripts\\python.exe)~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"agletras": {
"command": "${workspaceFolder}/.venv/bin/python",
"args": ["-m", "agletras_mcp"],
"env": {
"AGLETRAS_STORAGE_DIR": "${workspaceFolder}/data"
}
}
}
} ${workspaceFolder}/.venv/bin/python with ${workspaceFolder}\\.venv\\Scripts\\python.exe{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"agletras": {
"type": "local",
"command": [
".venv/bin/python",
"-m",
"agletras_mcp"
],
"codemode": false
}
}
}
} # Spawn MCP server process directly over standard input/output:
python -m agletras_mcp
# Or via package entry point:
agletras-mcp
# Invariant: Nothing ever writes to stdout except valid JSON-RPC 2.0 frames.
# All logging, diagnostics, and errors are emitted strictly to stderr. // 1. INCOMING REQUEST (STDIN):
{
"jsonrpc": "2.0",
"id": 42,
"method": "tools/call",
"params": {
"name": "verify_claims",
"arguments": {
"run_id": 1,
"claims": ["Entity incorporated in UK under registry number 0984219."]
}
}
}
// 2. OUTGOING RESPONSE (STDOUT):
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"content": [
{
"type": "text",
"text": "{"ok": true, "evaluated_claims": [{"claim": "Entity incorporated in UK under registry number 0984219.", "status": "SUPPORTED", "corroborating_sources": [{"source_id": 1, "passage_id": 4, "locator": "page 1, sec: Incorporation"}]}]}"
}
]
}
} The Five-Stage Research Workflow
How autonomous agents advance an inquiry from initial hypothesis to validated findings and delivery packages.
Plan & Bound
Formulate 3–8 targeted subquestions, establish scope, and set strict source budgets to bound execution.
Multi-Source Ingest
Collect web pages, PDFs, and local documents through SSRF-guarded fetchers with automatic format routing.
Passage Indexing
Segment text into deterministic character slices with SHA-256 hashes, page locators, and FTS5 search indexing.
Claim Verification
Extract candidate statements and compare them against stored passage text to derive explicit epistemic statuses.
Synthesis & Delivery
Render 10-section Markdown synthesis reports and populate corporate DOCX packages with citation and structural report validation.
Human-Led Research
Lawful, human-led corporate investigations conducted by experienced intelligence analysts to support critical business decisions, counterparty evaluations, executive vetting, and strategic risk management.
Partner & Company Checks
Rigorous public-record evaluations of prospective commercial counterparties, suppliers, and acquisition targets before signing binding agreements.
Ownership & Relationships
Systematic tracing of corporate shareholding networks, parent entities, holding jurisdictions, and ultimate beneficial ownership structures.
Leadership Backgrounds
Verifying executive credentials, past corporate directorships, regulatory compliance records, and public digital exposure.
Online Threats & Impersonation
Investigating external digital threats, fraudulent domain registrations, brand cloning, and rogue counterparties targeting your organization.
Commission a Scoped Corporate Investigation
All investigations strictly observe our non-intrusion charter using lawful public records. Discuss your scope with our intelligence team.
Transparent Platform Trajectory
We believe in technical transparency. Below is our verified status distinguishing current implemented capabilities from active development and future architectural targets.
Local-First Evidence Store & MCP Protocol Reference
The foundation of the Agletras platform. Connects autonomous AI agents directly to local-first evidence pipelines and verification logic via standard Model Context Protocol.
- 40 registered @mcp.tool entrypoints across 6 suites
- Local SQLite 3 storage with Write-Ahead Logging (WAL)
- Outbound NetPolicy SSRF guard blocking RFC 1918 & cloud metadata
- Deterministic 6-state epistemic claim verification engine
- Content-addressed passage indexing with SHA-256 and FTS5 search
- 10-section Markdown synthesis and validated Word (.docx) generation
Streaming Telemetry & Multi-Format Extractors
Extending protocol observability and ingestion format support for high-throughput enterprise research engagements.
- Standardized JSON-RPC progress streaming (notifications/progress)
- Multi-format extractors for ePub, structured XML, and multi-sheet XLSX
- Automated content diff notifications for registered monitor targets
- Pre-flight environment doctor enhancements (SQLite FTS5 versioning check)
- Extended client snippets for Zed IDE and Claude Code CLI
Batch Worker Pools & Hybrid Passage Retrieval
Scaling research capacity across large-scale corporate document archives while preserving strict local privacy guarantees.
- Parallel worker pooling for bulk PDF and registry archive ingestion
- Hybrid semantic vector search extension layered over SQLite FTS5
- Automated entity resolution across multiple contradictory registry filings
- Configurable rate-limiting policies for custom search provider plugins
Enterprise Air-Gapped Intelligence Distribution
Hardened distributions for regulated institutions, defense evaluators, corporate legal counsel, and sovereign research environments.
- Air-gapped containerized distributions (OCI compliant)
- Multi-tenant workspace isolation profiles with RBAC policies
- Cryptographically signed audit chains for courtroom-admissible evidence
- Formal SOC 2 Type II compliance audit and external penetration test review
System Manual, Specifications & Repository Deep Dive
Exhaustive architectural specifications, runtime prerequisites, storage and evidence models, and GitHub repository internals.
System Architecture, Configuration & Storage Specification
Comprehensive technical manual grounded directly in the tested Python implementation of the Agletras research MCP server.
Prerequisites & Runtime Boundaries
Agletras is engineered with strict supply chain hygiene. It requires zero cloud subscriptions, zero external databases, and zero external container runtimes.
| Component | Minimum Requirement | Purpose / Verification |
|---|---|---|
| Python Runtime | 3.10, 3.11, 3.12, 3.13 | Core MCP server, standard library HTTP and SQLite bindings |
| SQLite Database | 3.35.0+ (FTS5 enabled) | Atomic transactions, Write-Ahead Logging (WAL), passage search |
| mcp SDK | >= 2.3 | Model Context Protocol standard stdio transport implementation |
| pypdf | >= 6.21 | Pure-Python PDF text and metadata extraction with page locators |
| python-docx | >= 1.1.0 | Client report generation into official branded template |
| rich | >= 13.0 | Interactive two-terminal monitoring CLI and progress dashboard |
Environment Variables & Configuration Precedence
Configuration resolution follows strict precedence: CLI flags > Environment variables > agletras.toml > Built-in defaults. Secrets are never saved in config files and are redacted from all diagnostic logs.
| Environment Variable | Default Value | Operational Function |
|---|---|---|
AGLETRAS_STORAGE_DIR | ./data | Directory where SQLite research.db and run databases reside |
AGLETRAS_ALLOWED_DOMAINS | "" (Unrestricted) | Comma-separated list of domain suffixes allowed for outbound HTTP |
AGLETRAS_ALLOW_PRIVATE_HOSTS | 0 (False) | Set to 1 only for trusted local dev; blocks private RFC 1918 by default |
AGLETRAS_LOCAL_ROOTS | ./samples | Approved directory roots for local document and folder scanning |
AGLETRAS_MAX_BYTES | 10485760 (10 MiB) | Maximum byte ceiling for single HTTP web fetches |
AGLETRAS_CACHE_TTL | 86400 (24h) | Time-to-live for cached content blobs before forced re-validation |
AGLETRAS_FTS | auto | Full-text search engine mode (auto selects FTS5 with LIKE fallback) |
Five-Tier Layered Architecture
The system cleanly decouples external agent client reasoning from local deterministic execution:
Listens on stdin, emits exclusively valid JSON-RPC 2.0 frames on stdout. All diagnostic logs, error backtraces, and progress bars are routed to stderr.
Enforces DNS resolution inspection before socket open, blocking RFC 1918, CGNAT, loopback, and cloud metadata. Re-validates every redirect hop.
Converts PDFs, DOCX, XLSX, CSV, and HTML into normalized SourceRecords with provenance, timestamps, and de-duplication hashes.
Splits sources into character-offset passages with SHA-256 fingerprints. Evaluates factual claims into 6 deterministic truth states.
Persists relational entities with foreign keys and WAL crash safety. Generates verified 10-section Markdown and DOCX client deliverables.
Relational Evidence Schema & Cryptographic Integrity
All state is maintained in a single SQLite 3 database (research.db) governed by strict relational constraints (PRAGMA foreign_keys = ON;).
Tracks execution sessions, target entity queries, execution logs, and stopping conditions.
Canonical record of web URLs, local paths, retrieval timestamps, and extraction statuses.
Reusable raw text cache keyed by SHA-256 content hash, preventing redundant remote fetches.
Content-addressed passages with exact character start/end offsets, page markers, and FTS5 indices.
Discrete factual propositions evaluated against evidence into 6 deterministic epistemic states.
Cryptographic link linking a claim to an exact passage offset. Fabricated quotes are rejected.
Security Architecture & Non-Intrusion Guarantees
Agletras is built for sensitive corporate investigations where internal network pivoting and confidential data leakage are unacceptable risks:
- Socket-Level SSRF Blocking: Resolves DNS before initiating any HTTP connection. Drops requests resolving to
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.0/8, or AWS/GCP cloud metadata169.254.169.254. - Redirect Hop Re-validation: Custom
SafeRedirectHandlerinspects every intermediate HTTP redirect destination before following, capping chains at 10 hops. - Local Filesystem Confinement: Folder scanning is restricted to explicitly configured local directory roots. Symlinks pointing outside permitted boundaries are aborted.
- Passive OSINT Boundary: The server contains zero functionality for port scanning, brute-force authentication, or vulnerability exploitation. All research is passive and lawful.
Troubleshooting & Environment Diagnostics
When an error occurs, run agletras doctor to execute bounded, non-destructive health checks across your runtime, dependencies, and storage paths:
# Run built-in doctor command
python -m agletras_mcp.cli doctor
# Common issues & resolutions:
# 1. "SQLite FTS5 not available" -> Re-install Python with SQLite FTS5 extension enabled.
# 2. "SSRF guard blocked host" -> Host resolves to a private IP. Check AGLETRAS_ALLOW_PRIVATE_HOSTS.
# 3. "Permission denied data/research.db" -> Ensure user write permissions on the data directory.
# 4. "tools/call internal error" -> Inspect stderr stream for structured backtrace logs. Agletras MCP Repository & Developer Tooling
Agletras Intelligence is developed openly with high test coverage, deterministic execution standards, and clean architecture boundaries.
Agletras MCP is a local, zero-cost research MCP server for AI agent harnesses. It provides open-web search with query politeness, web retrieval with socket-level SSRF defenses, PDF/DOCX/XLSX/CSV document extraction, SQLite-backed source/citation tracking, and Markdown/DOCX dossier exports.
All 40 Registered MCP Tools by Suite
Every entry point below is decorated with @mcp.tool in server.py and available over stdio.
SUITE 1: INGESTION & RETRIEVAL (8 TOOLS) health_check · fetch_url · search_web · extract_pdf...
health_check — Returns server health, active SQLite schema, and tool status.fetch_url — SSRF-protected HTTP/HTTPS page fetcher with HTML-to-text conversion.search_web — Open-web search (DuckDuckGo HTML / Wikipedia API) with pacing.extract_pdf — Pure-Python PDF text extraction with page boundary markers.collect_sources — Multi-source concurrent gatherer with failure isolation.collect_local_folder — Safe folder scanner with path boundary confinement.extract_document — Unified parser for DOCX, XLSX, CSV, Markdown, and text.save_source — Persists source metadata with SHA-256 de-duplication.SUITE 2: EVIDENCE & STORE MANAGEMENT (7 TOOLS) get_source · list_sources · search_sources · save_evidence...
get_source — Retrieves stored source records by integer ID.list_sources — Paginated listing of stored sources with kind and date filters.search_sources — Keyword and full-text search across stored source contents.export_report — Exports collected research sources into Markdown format.stats — Diagnostic statistics on sources, storage footprint, and cache hit rates.save_evidence — Stores evidence with canonical deduplication and passage indexing.search_evidence — FTS5 passage search with exact snippet matches and locators.SUITE 3: EPISTEMIC CLAIM & CITATION ENGINE (7 TOOLS) start_research_run · register_claim · attach_citation...
start_research_run — Initializes an isolated research session and audit log.register_claim — Records a discrete factual proposition for validation.attach_citation — Links a claim to an exact passage offset with quote validation.get_claim_citations — Retrieves all supporting, conflicting, or context citations.get_research_history — Fetches complete execution history for a research run.generate_report — Compiles citation-validated report with references register.validate_report — Re-validates citations, quotes, and passage offsets in a report.SUITE 4: AUTONOMOUS PLANNER & ORCHESTRATION (7 TOOLS) save_research_plan · update_subquestion · log_run_event...
save_research_plan — Persists structured decomposition of subquestions and budget caps.update_subquestion — Updates execution status, answer text, and evidence links.log_run_event — Records structured events to the append-only SQLite log.start_followup_round — Triggers bounded follow-up research rounds (max 2).finish_research_run — Closes run, records stopping condition, and finalizes audit trail.get_engagement — Checks current client engagement stage and deliverable readiness.generate_client_report — Compiles official DOCX client deliverable via Word package.SUITE 5: VISUAL RESEARCH & CONFLICT VERIFICATION (7 TOOLS) search_images · analyze_image · extract_claims · verify_claims...
search_images — Discovers images via Wikimedia Commons with verified metadata.analyze_image — Opt-in visual inspection via local/OpenAI-compatible endpoint.extract_claims — Extracts candidate factual statements from stored sources.verify_claims — Evaluates claims into 6 deterministic epistemic states.analyze_conflicts — Detects contradictory claims, date mismatches, and turnover disparities.generate_markdown_report — Formats 10-section synthesis dossier with stable IDs.get_report — Retrieves compiled report text and structural validation status.SUITE 6: LONG-TERM MEMORY & TARGET MONITORING (4 TOOLS) search_memory · monitor_add_target · monitor_check · monitor_changes
search_memory — Recalls previously verified evidence across historical runs.monitor_add_target — Registers an external URL or file target for change detection.monitor_check — Checks registered targets using conditional HTTP (ETag/Last-Modified).monitor_changes — Computes structured content diffs and alerts on meaningful changes.End-to-End System Flow Diagram
┌────────────────────────────────────────────────────────────────────────┐
│ AI AGENT CLIENT (Claude / Cursor / OpenCode) │
└────────────────────────────────────┬───────────────────────────────────┘
│ JSON-RPC 2.0 (stdio)
┌────────────────────────────────────▼───────────────────────────────────┐
│ AGLETRAS MCP SERVER (python -m agletras_mcp) │
│ │
│ ┌────────────────────────┐ ┌──────────────────────────────┐ │
│ │ NetPolicy Gateway │ │ Unified Parsers │ │
│ │ SSRF & IP Denylist │ │ PDF, DOCX, XLSX, CSV, HTML │ │
│ └───────────┬────────────┘ └──────────────┬───────────────┘ │
│ │ │ │
│ ┌───────────▼─────────────────────────────────────▼───────────────┐ │
│ │ Evidence Library Engine │ │
│ │ Passage Splitting · SHA-256 Hashes · Epistemic Truth Matrix │ │
│ └───────────────────────────────────┬─────────────────────────────┘ │
└───────────────────────────────────────┼────────────────────────────────┘
│ Atomic WAL Transactions
┌───────────────────────────────────────▼────────────────────────────────┐
│ LOCAL PERSISTENCE LAYER (data/research.db) │
│ research_runs · sources · contents · passages · claims │
└────────────────────────────────────────────────────────────────────────┘ Contributing Standards & MIT License
We welcome contributions that adhere to the project's zero-cost, zero-dependency, and deterministic verification principles.
tests/. Run with python -m unittest discover -s tests -t . -v.ToolError and return {"ok": false} envelopes. Never crash the stdio server process.Agletras Technical Reference
Read the complete reference documentation for all 40 registered MCP tools, input schemas, SSRF network policies, and epistemic verification standards.
Inspect the Product Repository
Agletras Intelligence is open, auditable Python software. Review the hermetic test suite, run the offline CLI demo, and inspect tool registrations on GitHub.
Commercial Practice Intake
Have questions or need dedicated investigative resources? Connect directly with our team at info.agletras@gmail.com or submit a project brief.