Skip to main content
Glama
README.md
# ERIC MCP App

An MCP server for [ERIC](https://eric.ed.gov/) (Education Resources Information Center), the U.S. Department of Education's index of education research, with interactive views for hosts that support [MCP Apps](https://modelcontextprotocol.io).

ERIC holds more than two million records from 1966 on: journal articles, and a large body of reports, conference papers, dissertations and other grey literature, much of it with free full text. Ask your assistant to search it, read a record, find the ERIC descriptors used for a topic, list an author's works, or export results to Zotero or LaTeX. In hosts that render MCP Apps, such as Claude Desktop and claude.ai, each answer also appears as a view with result cards, filters, paging and export buttons. In hosts that don't, such as Claude Code, the same tools work as ordinary text tools.

No API key is needed. This is a TypeScript port of [eric-mcp-server](https://github.com/SMABoundless/eric-mcp-server) (Python), with the same six tool names; this project adds the views. It is not affiliated with or endorsed by ERIC, the Institute of Education Sciences or the U.S. Department of Education.

## Tools

| Tool | What it does |
|---|---|
| `eric_search` | Search by keyword, title, author, subject descriptor, source, or advanced query; filter by peer review, free full text, publication years and education level; page through results |
| `eric_get_record` | Everything ERIC holds about one record, by ERIC number: abstract, descriptors, audience, sponsor, IES grants, What Works Clearinghouse review |
| `eric_thesaurus_search` | The ERIC descriptors (controlled vocabulary) most often assigned to records on a topic |
| `eric_author_search` | Works by an author, optionally narrowed by topic |
| `eric_export_ris` | Export records as RIS (Zotero, EndNote, Mendeley) |
| `eric_export_bibtex` | Export records as BibTeX |

All tools are read-only.

Things to know about searching ERIC:

- **A keyword search matches records containing any of the words**, and ranks those with more of them first. Put a phrase in quotes or join words with `AND` to require all of them: `"flipped classroom" AND engagement`.
- Results come in ERIC's relevance order. The API offers no other sort.
- Searches return up to 200 results per call; `start` pages further.
- ERIC's API has no thesaurus lookup, so `eric_thesaurus_search` counts the descriptors on a sample of matching records (200 by default, up to 2,000).
- ERIC has no author identifiers, so a common name matches several people.

The export tools take an optional `eric_ids` list (up to 200). Without it they export the most recent page of search results. Exports carry volume, issue and pages, the DOI, ISSN or ISBN, descriptors as keywords, the abstract (unless `include_abstracts` is false) and a link to the full-text PDF where ERIC holds one.

## The views

| View | Shown for | What you can do in it |
|---|---|---|
| Records | `eric_search`, `eric_author_search` | Switch the peer-reviewed and full-text filters, page, open a record's abstract and descriptors, press a descriptor to search by it, tick records across pages and export them as RIS or BibTeX, follow links to the free PDF, the publisher, full text through your library ([LibKey](https://libkey.io)) and the record on eric.ed.gov |
| Record | `eric_get_record` | Read the abstract and descriptors, see What Works Clearinghouse and IES funding marks, copy the DOI or ERIC number, export the record |
| Descriptors | `eric_thesaurus_search` | Compare how often each descriptor is used, press one to list its records in place, copy the list |
| Export | `eric_export_ris`, `eric_export_bibtex` | Download the file or copy its text |

Nothing is fetched in the background: a view asks ERIC for more only when you press something. The views carry no ERIC or Department of Education logo, and say "Unofficial app" in their header.

## Requirements

- Node.js 22 or later

## Install

```bash
git clone https://github.com/SMABoundless/eric-mcp-app.git
cd eric-mcp-app
npm install
npm run build
```

## Use with Claude Desktop

Add this to `claude_desktop_config.json` (on macOS: `~/Library/Application Support/Claude/`), then restart Claude Desktop:

```json
{
  "mcpServers": {
    "eric": {
      "command": "node",
      "args": ["/absolute/path/to/eric-mcp-app/dist/server/index.js"]
    }
  }
}
```

If the Python `eric-mcp-server` is also configured, remove it or give this one a different name: both define the same six tool names.

## Use with Claude Code

```bash
claude mcp add eric -- node /absolute/path/to/eric-mcp-app/dist/server/index.js
```

## Configuration

| Variable | Purpose | Default |
|---|---|---|
| `TRANSPORT` | `stdio`, or `http` | `stdio` |
| `PORT` | Port for the HTTP transport | `3000` |
| `HOST` | Address the HTTP transport listens on | `127.0.0.1` |
| `MCP_AUTH_TOKEN` | Optional secret for the HTTP transport, presented as `Authorization: Bearer <secret>` or `/mcp?key=<secret>` | none |

The HTTP transport (`POST /mcp`, `GET /health`) listens on `127.0.0.1` unless `HOST` says otherwise, and sends no CORS headers. One thing changes when several people share an HTTP server: "export the most recent results" means the most recent search by anyone. Exports that name their records with `eric_ids`, which is what the views do, are unaffected.

### What the server keeps

Nothing is written to disk. While it runs, the server holds in memory the last page of results (for "export those") and up to 1,000 records it has shown (so records ticked on several pages can be exported without asking ERIC again). All are gone when the server stops.

## Development

```bash
npm test             # offline: unit tests, and end-to-end tests with ERIC replaced by canned replies
npm run build        # type-checks the views against the server's output types, then builds everything
npm run test:live    # the built server against the real API; needs the network, makes about 10 requests
npm run preview      # writes dist/preview/*.html: each view with made-up data, to open in a browser
```

`test/contrast.test.ts` checks every text and background colour pairing in both themes against WCAG AA.

The preview pages check layout and colour only. Links, the clipboard, downloads and tool calls from a view go through the host, so test those in Claude Desktop.

### Layout

- `server/tools/` holds the tools; `server/services/` the ERIC client, the record cleaning and query building, and the RIS and BibTeX writers; `server/output-types.ts` the structured data each tool returns.
- `ui/` holds one page per view and `ui/shared/` the components and styles. Each view is built into a single self-contained HTML file with fonts inlined, because views run in a sandboxed frame with no network.
- The look is a house style shared with sibling apps. An app sets only `--app-accent` and `--app-accent-soft` at the top of `ui/shared/styles/base.css`; this one uses plum.

### Quirks of ERIC's API that the server handles

- A refused query (bad syntax, unknown field) comes back with HTTP status 200 and an error in the body.
- `e_fulltextauth` is `1` or `0`, not `T` or `F`; `peerreviewed` is `T` or `F`.
- Text carries HTML entities (`&apos;`), and `issn`, `isbn` and `language` are lists with labels such as `ISSN-`.
- Volume, issue and pages exist only inside the `sourceid` text (`v51 n4 p420-443 Dec 2019`).
- Records with full text have a PDF whether their number starts `ED` or `EJ`.

## License

MIT. The bundled fonts (Fraunces, Inter, JetBrains Mono) are under the SIL Open Font License; see `ui/shared/fonts/`.