Metadata-Version: 2.5
Name: pancite
Version: 0.4.0
Summary: Evidence-backed scholarly discovery and citation tools for MCP, from open metadata to institutional databases.
Project-URL: Homepage, https://github.com/PanStudio/pancite
Project-URL: Issues, https://github.com/PanStudio/pancite/issues
Author: Anthony Kougkas
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: anyio<5,>=4.9
Requires-Dist: bibtexparser<2,>=1.4.3
Requires-Dist: defusedxml<1,>=0.7.1
Requires-Dist: httpx2<3,>=2.5
Requires-Dist: mcp<3,>=2.2
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: python-dotenv<2,>=1.1
Description-Content-Type: text/markdown

# PanCite MCP

<img src="https://raw.githubusercontent.com/PanStudio/pancite/v0.4.0/assets/pancite.svg" alt="PanCite" width="88" height="88" align="right">

**Scholarly discovery and citations with evidence you can trace.**

PanCite connects research assistants to open scholarly metadata, specialist academic indexes,
and optional commercial databases through the Model Context Protocol. Search without an API key,
resolve stable identifiers, check references against their sources, and export citations without
asking a language model to invent the missing fields.

This is a citation and metadata service for the assistant you already use. It works alongside
reference managers such as Zotero and writing environments that support MCP.

**PanCite 0.4.0** includes the MCP service and the `pancite-panwrite` companion.
The PanWrite integration needs a PanWrite release that speaks `pancite.panwrite/v1`. Marketplace listings and native
client plugin qualification are tracked independently.

[Quick start](#quick-start) · [PanWrite integration](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/panwrite.md) ·
[Provider guide](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/providers.md) · [Troubleshooting](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/troubleshooting.md) ·
[Release information](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/release/README.md)

- **Useful without credentials:** Crossref, DataCite and Europe PMC are the default search sources.
  arXiv and Semantic Scholar are also available without mandatory keys.
- **Optional specialist and commercial access:** OpenAlex, Google Scholar through SerpAPI or SearchApi,
  Scopus and Web of Science Starter have explicit configuration and provider selection.
- **Source-backed records:** namespaced identifiers, retrieval timestamps, field attribution,
  incomplete-author warnings and provider-specific citation counts.
- **Deterministic export:** BibTeX, RIS and CSL-JSON from retrieved metadata. No model is required.
- **Current MCP:** Python SDK 2.2, the **2026-07-28** specification, structured tool results,
  resources, prompts, skills, tasks, experimental file arguments, progress, stdio and Streamable HTTP.
  Earlier clients remain supported by the SDK's legacy protocol path.

## Quick start

Python 3.11+ and [uv](https://docs.astral.sh/uv/) are required.

```bash
uvx --from pancite==0.4.0 pancite --version
uvx --from pancite==0.4.0 pancite --no-env-file --list-providers
```

For an MCP client with a `mcpServers` configuration:

```json
{
  "mcpServers": {
    "pancite": {
      "command": "uvx",
      "args": ["--from", "pancite==0.4.0", "pancite", "--no-env-file"]
    }
  }
}
```

The client starts MCP over stdio. No API key or `.env` file is required. Running the server
command directly waits for a client; it is not an interactive search shell. If your client
cannot find `uvx`, use its absolute executable path. The first run downloads the package and
its dependencies.

For a persistent installation, including the PanWrite companion:

```bash
uv tool install pancite==0.4.0
pancite-panwrite --check
```

The diagnostic starts the actual MCP service and lists providers without querying vendor APIs.
See the [PanWrite setup](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/panwrite.md) for the separate integration and executable-path setting.

For local HTTP clients:

```bash
uvx --from pancite==0.4.0 pancite --no-env-file --transport streamable-http --port 8000
```

Connect to `http://127.0.0.1:8000/mcp`. The CLI binds only to loopback and serves a single trust
boundary. A public, multi-user deployment needs authentication, credential isolation and its
own deployment integration; the CLI does not supply those features.

### Agent Plugin

The `pancode/` directory is PanCite's Agent Plugin; it launches this release with `uvx`. Claude
Code and Codex install the repository root instead, from `.claude-plugin/`, `.codex-plugin/` and
`.mcp.json`, with the same launch. In PanCode:

```bash
pancode hub install <checkout>/pancode --user
pancode mcp trust pancite
pancode mcp trust pancite --surface   # prints the digest; repeat with --hash <digest>
```

PanCode passes the server no key from your shell. Keyed providers need your own user-scope
declaration with the keys in its `env`. See the
[plugin page](https://github.com/PanStudio/pancite/blob/master/pancode/README.md).

## Sources and access

| Provider ID | Coverage | Access | Setup |
|---|---|---|---|
| `crossref` | Publisher-deposited DOI metadata and citation counts | Free; default | Optional `PANCITE_CONTACT_EMAIL` for the polite pool |
| `datacite` | Datasets, software and other DOI-registered research outputs | Free; default | None |
| `europe_pmc` | Biomedical literature, PubMed/PMC records, references and citations | Free; default | None |
| `arxiv` | Preprints in physics, mathematics, computing and related fields | Free | Select explicitly; paced to one request per three seconds |
| `semantic_scholar` | Academic Graph discovery and citation traversal | Free/shared anonymous limits; optional key | Optional `SEMANTIC_SCHOLAR_API_KEY` |
| `openalex` | Multidisciplinary research graph | Free credits / metered account access | `OPENALEX_API_KEY` |
| `serpapi` | Google Scholar through SerpAPI vendor API | Commercial; account allowances vary | `SERPAPI_API_KEY` |
| `searchapi` | Google Scholar through SearchApi.io vendor API | Commercial; account allowances vary | `SEARCHAPI_API_KEY` |
| `scopus` | Elsevier's curated literature index | Institutional/commercial entitlement | `SCOPUS_API_KEY`; optional `SCOPUS_INSTTOKEN` |
| `wos` | Clarivate Web of Science Starter | Institutional/commercial entitlement | `WOS_API_KEY` |

`find-open-access` can additionally enrich DOI records with **Unpaywall** when
`UNPAYWALL_EMAIL` is configured. It returns reported legal OA locations and licensing information;
it does not download PDFs or bypass access restrictions.

Free access is subject to provider rate limits and terms. Anonymous Semantic Scholar can be
heavily throttled. OpenAlex access policies have changed over time; PanCite requires a key for
that adapter even when an anonymous request happens to succeed. Institution keys do not by
themselves guarantee subscription access or access outside an institution's network.

Commercial and metered adapters are called only when selected explicitly, when resolving their
own namespaced IDs, or when deliberately configured as search defaults. Setting a key alone does
not add a vendor to default searches. `list-providers` reports configuration, capabilities and
documentation links without testing access or revealing key values.

## Research workflows

Use PanCite to build a literature shortlist, repair an uncertain reference, check the source
behind a citation count, or prepare a bibliography for your writing tool. For a full writing
workflow, the [PanWrite companion](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/panwrite.md) connects discovery to evidence tables, outlines
and manuscript work while keeping candidate references visible for review.

Ask your assistant to use the tools directly, or start with the `literature-review` and
`bibliography-audit` MCP prompts. Example tool arguments:

```json
{"query": "reproducible machine learning benchmarks", "providers": ["crossref", "arxiv"], "limit": 5}
```

```json
{"identifier": "10.1038/nature14539", "format": "bibtex"}
```

```json
{"citation": "10.1038/nature14539", "expected_title": "Deep learning", "expected_year": 2015}
```

```json
{"identifier": "PMID:26017442", "direction": "references", "provider": "europe_pmc", "limit": 10}
```

```json
{"identifiers": ["10.1038/nature14539", "arxiv:1706.03762"], "format": "csl-json"}
```

| Tool | Purpose |
|---|---|
| `list-providers` | Inspect source capabilities, access tiers and credential configuration |
| `search-papers` | Concurrent federated search, conservative deduplication and per-source pagination |
| `resolve-paper` | Retrieve and validate a DOI or namespaced identifier; optionally merge selected sources |
| `get-citation` | Export one resolved record as `bibtex`, `ris` or `csl-json` |
| `verify-citation` | Check that an identifier or BibTeX entry exists and matches supplied title and year; never checks claim support |
| `batch-citations` | Resolve and export 1–20 identifiers with ordered results, partial failures and progress |
| `related-papers` | Page through a source's citations or references |
| `paper-metrics` | Return observed citation counts, separated by provider and index |
| `citation-impact` | Citation and influential-citation counts for 1–25 works by identifier or checked title match; Semantic Scholar first, OpenAlex as fallback |
| `find-open-access` | Find source-reported OA locations, with optional Unpaywall enrichment |
| `enhance-citation` | Normalize BibTeX formatting while preserving supplied bibliographic facts |
| `find-scholar-id` | Legacy Scholar discovery through SerpAPI or SearchApi; returns candidates for review |

`search-papers` defaults to 10 results **per provider**, not 10 overall. Results interleave each
provider's ranking, then merge compatible records. `limit` is 1–50, or at most 20 when using
SerpAPI or SearchApi. Use each provider's `next_offsets` with the **same limit**, selecting that provider for
the next call. Europe PMC search uses `next_cursors` instead: pass its token as `cursor`,
select only `europe_pmc`, keep the same query and limit, and leave `offset` at zero.
Offsets must be multiples of the limit, up to 10,000. `year_from`, `year_to` and
`open_access_only` filter the fetched page; unknown values are excluded. Ordering interleaves each
provider's own ranking, so the first record is the first selected provider's top hit. For
computer-science topics, select `arxiv` and `semantic_scholar`; plain arXiv queries require every
non-stopword term, while explicit `ti:`, `abs:`, `AND` or `OR` syntax passes through unchanged. Abstracts are omitted
from search results by default; set `include_abstract: true` or resolve a record to retrieve them.
Search records are compact by default: `field_sources` is empty while `sources` still names every
provider. Set `detail: "full"` or resolve a record for per-field provenance. For small context
windows, `detail: "minimal"` returns only id, title, year, the first three authors, venue and
DOI/arXiv/PMID, and `limit_total` caps records across all providers:
`{"query": "burst buffers", "limit": 5, "limit_total": 5, "detail": "minimal"}`.
A record without an abstract carries `abstract: null` and `abstract_missing_reason`.
Provider search languages differ: explicit advanced queries use that provider's syntax.

Supported identifiers include `10.1038/nature14539`, `arxiv:1706.03762`, `PMID:26017442`,
`PMC12345`, `openalex:W2919115771`, `s2:<paperId>`, `s2:CorpusId:<number>`,
`scholar:<numericClusterId>`, `scopus:<numericId>`, and `WOS:<recordId>`. DOI, arXiv and PubMed
URLs are recognized. Arbitrary URLs are not fetched, and unprefixed numeric strings are not
assumed to be PubMed or Scholar IDs.

DOI resolution tries Crossref, DataCite and Europe PMC in order until a matching record is
retrieved. An explicit `providers` list instead checks each compatible selected source and
retains evidence and disagreements. Native identifiers route to their corresponding source.
A title search always returns candidates; it never silently declares the first result a match.

Read the MCP resources `pancite://methodology`, `pancite://providers` and
`pancite://workflows` for machine-accessible guidance. Clients that support the
`io.modelcontextprotocol/skills` extension also get four skills through `skills/list`:
`evidence-policy`, `research-workflows`, `literature-review` and `bibliography-audit`. Each
`SKILL.md` is readable as a `skill://pancite/<name>/SKILL.md` resource, and the listing carries
its SHA-256 digest and size.

File arguments are experimental and follow the draft `io.modelcontextprotocol/files` extension.
`verify-citation` (one BibTeX entry, RIS record or CSL-JSON item, or text holding an identifier)
and `enhance-citation` (BibTeX) include an optional `file` argument beside the existing `citation`
and `bibtex` strings. Files are sent inline as base64 `data`, at most 100,000 bytes each; PanCite
has no upload storage. Size and any SHA-256 digest are checked before the tool runs. Clients
without the extension keep using the `citation` and `bibtex` strings.

## What “verified” means

Verification establishes that an identifier exists in retrieved metadata and checks any supplied
title and year. It does **not** establish that a paper's findings are correct, that every author
is present, that the paper supports a specific claim, or that no retraction exists. A provider
outage produces `unavailable`, rather than a claim that the citation is fabricated.
`verify-citation` reports `match: "identifier"` when only the identifier was checked and
`match: "metadata"` when a supplied title or year also matched; `claim_support` is always
`not_checked`.

Exports omit unavailable metadata. Partial author lists generate warnings; BibTeX uses `others`
where appropriate. Citation counts retain their source, index and observation timestamp and are
never summed across databases. Counts from different providers are not directly interchangeable.
Metadata can contain errors or conflicting publication years, and an absent retraction flag is
not proof that a paper is unretracted.

CSL-JSON is structured bibliographic data. Use a CSL processor or your reference manager to render
APA, IEEE or a journal's house style. `enhance-citation` supports `default` and `compact` formatting;
it does not infer keywords, awards, impact factors or missing authors.

## Configuration

PanCite reads its settings from the process environment. Pass the variables through your MCP
client's `env` block, or copy `.env.example` to a file and name it with `--env-file PATH`. The CLI
never reads a `.env` file implicitly, so a `.env` in the directory a client launches from is
ignored. Existing process environment variables take precedence over the named file. Importing the
Python package does not read `.env` or call external services. `--no-env-file` is the default
behaviour; it stays accepted so existing launch configurations keep working.

| Variable | Default | Meaning |
|---|---|---|
| `PANCITE_DEFAULT_PROVIDERS` | `crossref,datacite,europe_pmc` | Explicit search source IDs, comma separated |
| `PANCITE_TIMEOUT` | `12` | Timeout in seconds for each HTTP request |
| `PANCITE_OPERATION_TIMEOUT` | `40` | Time budget for a provider operation or identifier resolution |
| `PANCITE_RETRIES` | `1` | Retries for transport failures, HTTP 429 and 5xx responses |
| `PANCITE_CONCURRENCY` | `6` | Maximum simultaneous outbound requests |
| `PANCITE_CACHE_TTL` | `300` | In-process response-cache lifetime in seconds; `0` disables it |
| `PANCITE_CACHE_SIZE` | `256` | Maximum cached responses; `0` disables caching |

Cached records retain their original retrieval and citation-observation timestamps. The cache is
bounded and partitions responses by credentials. Responses larger than 8 MB are rejected. Long
`Retry-After` cooldowns return a provider issue instead of holding the call open. Keys and upstream
error bodies are excluded from tool errors. Local stderr logging keeps stdout clean for MCP.

See [provider details](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/providers.md), [migration notes](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/migration.md), and
[product direction](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/product-direction.md) for access nuances and boundaries.

## Development and verification

To work from source:

```bash
git clone https://github.com/PanStudio/pancite.git
cd pancite
uv sync --locked
uv run ruff check src tests scripts
uv run ruff format --check src tests scripts
uv run mypy src/pancite
uv run python scripts/prepare_release.py --check
uv run pytest -q
uv build
```

The automated suite uses synthetic provider fixtures and mock HTTP, plus real local stdio and
Streamable HTTP processes. It requires no vendor credentials and blocks external network access
from the test process. Paid and institutional adapters have fixture-based contract coverage;
live entitlement testing requires an account with access.

An explicit public-API smoke test is available separately:

```bash
uv run python scripts/smoke_public.py
```

It ignores account credentials and only contacts Crossref, DataCite, Europe PMC, arXiv and
anonymous Semantic Scholar. Rate limits and network failures are reported as outcomes.

Clients that declare the official MCP Tasks extension (`io.modelcontextprotocol/tasks`) get a task
from `batch-citations` and from `search-papers` across more than one provider, then poll
`tasks/get` and may stop the work with `tasks/cancel`. A task run has no
`PANCITE_OPERATION_TIMEOUT` budget and sends no progress notifications. Tasks are kept in server
memory: they expire an hour after creation, at most 64 exist at once (further calls run
directly), and a restart loses them. Any client holding a task ID can read or cancel that task.
Other clients get the result directly, with progress and cancellation. [The roadmap](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/product-direction.md) describes the criteria for adding durable
tasks, local libraries and further licensed providers.

See [data handling](https://github.com/PanStudio/pancite/blob/v0.4.0/docs/data-handling.md) before configuring optional providers or hosting.

## License

[Apache-2.0](https://github.com/PanStudio/pancite/blob/v0.4.0/LICENSE). Copyright 2026 PanStudio; see [NOTICE](https://github.com/PanStudio/pancite/blob/v0.4.0/NOTICE). Provider content, API access and redistribution remain subject to each source's terms.

<!-- mcp-name: io.github.PanStudio/pancite -->
