Skip to main content
Glama

Agent Brain MCP

A scientific provenance layer for AI-assisted research programs. Tracks results, equations, papers, datasets, and headline numerical outputs across multiple repositories -- queryable by any AI agent via the Model Context Protocol (MCP).

What It Does

Agent Brain gives your AI agents a persistent, structured memory:

  • Results: Track every computation with lifecycle status (ACTIVE/DEAD/QUARANTINED), evidence grade (PROVEN/MEASURED/PARTIAL), and one-paragraph summaries

  • Outputs: Store headline numbers from computations (not raw data -- just the 3-10 key values per computation that you'd actually query)

  • Papers: Index papers by usage type (DATA/EQUATION/CONTEXT) with equations tracked to file+line

  • Artifacts: List and fetch computation output files through the MCP without filesystem access

  • Events: Append-only mutation log for full audit trail

Related MCP server: agent-context-substrate

Quick Start

  1. Install:

uv add agent-brain-mcp
  1. Configure your repos:

# ~/.agent-brain/config.yaml
domains:
  my-project:
    repo_root: /path/to/my/research
    active: true
  1. Add to Claude Desktop config:

{
  "mcpServers": {
    "brain": {
      "command": "uv",
      "args": ["run", "agent-brain"]
    }
  }
}
  1. Start querying:

    • "What did comp42 find?" -> query_results(computation_id="comp42")

    • "All fitted values" -> query_outputs(key_pattern="fit.%")

    • "Papers about clusters" -> query_papers(text="cluster")

Tools (17 total)

Core provenance

Tool

Purpose

record_result

Create a new result

update_result_status

Change lifecycle/grade

check_status

Look up one result

query_results

Filter results

record_assumption

Track assumptions

link_results

Create inter-result links

get_domain_summary

Domain overview

reconcile_disk_state

DB-to-disk consistency check

Computation outputs

Tool

Purpose

record_output

Store a headline number

query_outputs

Search outputs by key pattern

Paper tracking

Tool

Purpose

record_paper

Add a paper

query_papers

Search papers

link_paper_to_result

Paper-to-result link

Artifact access

Tool

Purpose

list_artifacts

List files in a result's output dir

fetch_artifact

Read a specific artifact file

Configuration

All configuration is via environment variables with sensible defaults:

Variable

Default

Purpose

AGENT_BRAIN_DB_PATH

~/.agent-brain/brain.db

SQLite database location

AGENT_BRAIN_CONFIG_PATH

~/.agent-brain/config.yaml

Domain/repo config

AGENT_BRAIN_HOST_KEY

localhost

Host identifier for multi-machine setups

AGENT_BRAIN_CONSTANTS_PATH

(empty)

Optional project constants file for reconciliation

AGENT_BRAIN_CUSTOM_MARKERS

(empty)

JSON dict of extra marker files, e.g. {"BUGGY.txt": "QUARANTINED"}

AGENT_BRAIN_ARTIFACT_MAX_BYTES

1048576

Max artifact file size (1 MB)

AGENT_BRAIN_ARTIFACT_MAX_LIST_ITEMS

200

Max items from list_artifacts

AGENT_BRAIN_ARTIFACT_ALLOW_SUPERSEDED

false

Allow fetching dead/superseded artifacts

Design Principles

  1. Filesystem is ground truth -- the DB mirrors on-disk state

  2. Metadata tier + fetch-on-demand artifact tier -- summaries are always available, files on request

  3. No schema changes for new research -- the same tables work for any domain

  4. Structured output keys -- category.target pattern (verdict.main, fit.slope, count.galaxies)

  5. Path security -- artifact fetching enforces allowlisted roots, blocks traversal

Who This Is For

Research groups using AI agents (Claude, GPT, Codex) for computational science. If your agents run computations, produce results, and need to remember what they found -- this is the memory layer.

Documentation

License

MIT

Available Tools

15 tools
check_statusCheck StatusC

Look up the current classification of a named result.

Inputs: name (required), domain_key (required). Returns: object

fetch_artifactFetch ArtifactC

Fetch a specific artifact file's content.

Returns UTF-8 text or binary flag. artifact_name is relative to the result's output directory.

Inputs: domain_key (required), result_name (required), artifact_name (required), max_bytes, +1 more. Returns: object

get_domain_summaryGet Domain SummaryB

Get an overview of a domain's provenance state for session bootstrap.

Inputs: domain_key (required). Returns: object

list_artifactsList ArtifactsB

List artifact files for a result.

Uses evidence_relpath to find the output directory. Non-fetchable for SUPERSEDED/DEAD/QUARANTINED unless include_superseded=True.

Inputs: domain_key (required), result_name (required), include_superseded. Returns: object

query_outputsQuery OutputsC

Query computation outputs.

key_pattern uses SQL LIKE (e.g., 'fit.%' for all fit values, '%.target%' for a specific system).

Inputs: limit, domain_key, key_pattern, result_name, +1 more. Returns: object

query_papersQuery PapersC

Query papers with filters.

Search by usage_type (DATA/EQUATION/BOTH/CONTEXT), domain_tag, text, computation_id, or year range.

Inputs: text, limit, year_max, year_min, +3 more. Returns: object

query_resultsQuery ResultsC

Query results with filters. Returns matching results ordered by last update.

Inputs: domain_key (required), text, limit, branch_name, +4 more. Returns: object

reconcile_disk_stateReconcile Disk StateA

Reconcile the provenance DB against on-disk truth.

Checks marker files, artifact existence, and optional project constants quarantine state. Returns structured diff: {missing_in_db, stale_in_db, conflicts, warnings}. NEVER silently overwrites conflicting DB state.

Inputs: domain_key. Returns: object

record_assumptionRecord AssumptionC

Record a named assumption or caveat.

Inputs: name (required), statement (required), domain_key (required), risk, +4 more. Returns: object

record_outputRecord OutputC

Record a headline quantitative result.

key format: 'category.target' (e.g., 'verdict.main', 'fit.slope', 'count.galaxies'). Exactly one of value_num or value_str must be set.

Inputs: key (required), domain_key (required), result_name (required), units, +5 more. Returns: object

record_paperRecord PaperC

Record a paper that provided data or equations.

usage_type: DATA, EQUATION, BOTH, CONTEXT

Inputs: title (required), authors (required), cite_key (required), doi, +11 more. Returns: object

record_resultRecord ResultC

Record a new scientific result in the provenance database.

Inputs: name (required), summary (required), domain_key (required), notes, +9 more. Returns: object

update_result_statusUpdate Result StatusC

Update the status of an existing result. At least one field must change.

Inputs: name (required), domain_key (required), notes, outcome_type, +3 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 15 tools

    Disambiguation4/5

    Most tools have clearly distinct resource+action targets (papers, results, outputs, artifacts), and the record_/query_ pairs are easy to tell apart. The main soft spots are check_status vs query_results (both read result classification) and record_result vs record_output, though the descriptions of 'headline quantitative value' vs 'scientific result' provide enough separation.

    Naming Consistency4/5

    All names are snake_case verb_noun (record_paper, query_results, link_results, fetch_artifact), which is a consistent and predictable pattern. The only minor deviation is the mix of read verbs (get_domain_summary, check_status, query_*, list_*, fetch_*), but each read verb maps to a genuinely different access mode.

    Tool Count4/5

    15 tools is at the upper edge of a well-scoped set but each maps to a distinct provenance operation (record/query/link for papers, results, outputs, plus disk reconciliation and artifact access). No tool appears redundant, though the set is close to feeling heavy for the domain.

    Completeness3/5

    Core write/read coverage exists for results, papers, and outputs, plus linking and artifact retrieval, but there is no delete/retire or update path for papers or outputs, and record_assumption has no corresponding query or update tool. Read-side traversal of links (e.g., list_links/query_links) is also missing, so an agent can create relationships but cannot inspect them except indirectly.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Durable, inspectable memory for MCP agents. Preserves decisions, preferences, and project knowledge across sessions with full provenance and version history.
      3
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents and MCP clients to run research as an explicit scientific process: forming hypotheses, designing and executing sealed experiments, capturing observations and artifacts, linking claims to supporting evidence, and reviewing provenance. Exposes coordinated MCP services so users can inspect, reproduce, and audit every step from question to conclusion rather than trusting an opaque final answer.
      46
      21
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Gives MCP-compatible AI assistants one shared, append-only memory stored as a graph, so facts persist across tools and sessions with their full reasoning chain. Enables finding disagreements between tools, resolving them by recording a winner, and seeing which downstream decisions become stale.
      9
      MIT