Skip to main content
Glama
SourceAtlas MCP

SourceAtlas MCP

README.md
<img align="right" src="assets/logo.svg" width="190" alt="SourceAtlas catalog mark">

# SourceAtlas MCP

### The evidence desk

A local research companion for organizing the references already in your hands.

| Catalog entry | Details |
| :--- | :--- |
| Edition | 0.1.0 |
| Interface | MCP over stdio |
| Storage | In-memory; no persistent dossier |
| Scope | Caller-provided public-source metadata |
| Verification | Formatting and metadata only |

[![License: MIT](https://img.shields.io/badge/License-MIT-8a5a32?style=flat)](LICENSE) [![Runtime: offline](https://img.shields.io/badge/Runtime-offline-377466?style=flat)](#provenance-and-boundaries)

---

SourceAtlas turns public-source metadata you already possess into organized research
notes. It validates identifier syntax, detects duplicates and conflicting metadata,
flags age and missing fields, and drafts citations and evidence tables. No web
retrieval, browser connection, authentication, or source verification is performed.

## Open your workspace

Use Python 3.10 or newer in a virtual environment. Dependency installation requires
package access; the server itself processes metadata locally.

```bash
git clone https://github.com/ahmedsaeed1-eng/sourceatlas-mcp.git
cd sourceatlas-mcp
python -m venv .venv
# Activate the virtual environment for your OS.
python -m pip install .
python -m sourceatlas_mcp
```

The final command launches an MCP server over stdio. It waits for protocol messages;
it does not display an interactive terminal interface.

Configure an MCP-compatible client with an absolute path to the Python executable
in the environment where the package is installed. Adapt this generic stdio
example to your client's format:

```json
{
  "mcpServers": {
    "sourceatlas": {
      "command": "/absolute/path/to/venv/bin/python",
      "args": ["-m", "sourceatlas_mcp"]
    }
  }
}
```

On Windows, use the virtual environment's `.venv\Scripts\python.exe` path and
escape backslashes in JSON.

## Evidence desk · catalog tools

| Tool | Input | Output |
| --- | --- | --- |
| `normalize_source` | one record | normalized URL/DOI and validated fields |
| `group_sources` | 1–100 records | unique groups, conflicting values, member indexes |
| `format_citation` | one record | plain-language draft citation |
| `check_recency` | records, reference date, max age | recency statuses and missing metadata |
| `build_evidence_table` | records | Markdown evidence inventory |

Each record requires a title and at least one URL or DOI.
Optional fields: `publisher`, `published` (YYYY-MM-DD), `kind` (primary,
secondary, tertiary, unknown), `claim`, and `summary`.
Unknown fields are rejected. Strings are bounded and control characters rejected.

## Reference card · example

Pass an array of record objects to `group_sources`:

```json
[
  {
    "title": "Example public report",
    "url": "https://example.org/report?id=1&utm_source=newsletter#top",
    "publisher": "Example publisher",
    "published": "2024-01-01",
    "kind": "primary"
  },
  {
    "title": "Example public report",
    "url": "https://EXAMPLE.org:443/report?id=1",
    "published": "2024-01-02"
  }
]
```

These illustrative records group together because the normalized URLs match.
The differing publication dates are preserved as a conflict. SourceAtlas keeps
the first supplied nonempty value for display and reports all distinct
conflicting values. Input positions are zero-based. A record sharing both a
DOI and URL can connect groups; conflicting identifiers are explicitly reported.

The reference-date check classifies records as recent, stale, missing, future or
conflicting. The threshold is inclusive; the default is 365 days. It does not
estimate credibility or validate a publisher's reputation.

## Provenance and boundaries

- No HTTP requests, browser automation, account access, cookies or source downloads.
- URL normalization is only for grouping identity. It lowercases scheme/host,
  strips default port, fragment, and common tracking parameters; query fields
  are decoded and re-encoded in existing order. It does not establish that a
  domain resolves to a public address, and is not a security URL validator.
- DOI validation checks common DOI syntax only. Neither references nor claims
  are verified. Draft citations are not compliance guarantees for formal styles.
- No storage, background research, external services, or automatic publication.
- Metadata is untrusted text; Markdown table delimiters and markup are escaped.
  Do not submit private records, access tokens, or signed URLs.

## Validation checklist

```bash
python -m unittest discover -s tests -v
```

The suite covers URL/DOI normalization, connected duplicate groups, conflicts,
invalid input, recency, Markdown escaping, and a real stdio MCP client session
exercising all five tools. CI is configured for Linux, Windows and macOS.

## License

MIT. See [LICENSE](LICENSE) and [third-party credits](THIRD_PARTY.md).
This project is independent and does not incorporate Agent Reach source code.