# scientific-figure-library [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/xuzhougeng/ScientificFigureLibrary  
**GitHub Stars:** 131  
**npm Downloads (last month):** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/scientific-figure-library

## Description
Local image-code knowledge library with native macOS and local Web clients, plus MCP and Skill for Pi, DeepSeek Harness (dsh), Claude, Codex, Cursor, and Wisp.

## Tools
Capabilities this server exposes over MCP:

- **figure_library_get_skill** — Start here for SFL guidance and host capabilities. Returns the same bundled SKILL.md without requiring Library setup. Use only listed document IDs for on-demand references; does not install a Skill or execute helper code.
- **figure_library_get_candidate_images** — Get up to 12 current-result thumbnails as standard MCP images with exact candidate labels. Display a page for user selection; do not iterate the entire result set. Does not confirm exact previews or create materialization receipts.
- **figure_library_open** — Open the read-only candidate workbench. New installs return setup_required until the global Library and Local workspace are bound; otherwise ask for an uploaded reference, data profile, or plotting goal before searching.
- **figure_library_search** — Search Local Published, FigureYa, Open Figure Modules and opted-in personal Providers. Present candidates using host thumbnail resources/image tools or the optional App, then wait for selection. Community is explicit-only; Working, Capture and flat-v1 entries are excluded.
- **figure_library_search_page** — Paginate an existing search result set for the host Agent or App. Keep the resultSetId and opaque cursor unchanged.
- **figure_library_describe** — Describe an exact Local Published release, bundled/personal public template, or commit-pinned FigureYa module. A bare templateId is deliberately insufficient.
- **figure_library_preview** — Return one selected preview as standard MCP image content and optionally copy it to a trusted absolute directory. This compatibility tool does not authorize materialization.
- **figure_library_preview_exact** — App-only exact preview. It returns image bytes only to the component and issues a session-bound confirmation challenge.
- **figure_library_preview_exact_headless** — Model-visible exact preview. Call only after the user selects a candidate, explicitly delegates visual review, or an App updateModelContext handoff selects one candidate; do not iterate all results.
- **figure_library_create_plot_task_headless** — Create the same v2 plotting-task handoff used by the App after the user selects candidates in an agent-only session. Selections must belong to the current cached result set. This read-only tool does not preview, materialize, execute code, or install dependencies.
- **figure_library_confirm_selection** — App-only confirmation. The candidate workbench calls this only after the exact image load event and an explicit user click.
- **figure_library_confirm_selection_headless** — Model-visible confirmation after figure_library_preview_exact_headless. Use only after a user selection, explicit delegation, or an App updateModelContext handoff when serverTools is unavailable; this call cannot prove UI visibility.
- **figure_library_record_ui_event** — Internal App-only structured diagnostics. It accepts a fixed event enum and no arbitrary log text.
- **figure_library_export_diagnostics** — Export a bounded, secret-safe diagnostic ZIP for the current server session. Defaults to sanitized_bundle, excludes user text and absolute paths, and never uploads data.
- **figure_library_source_status** — Return complete text and structured status for the global portable Library, immutable lifecycle, write lock, and every registered Local, Community, FigureYa, or personal Provider. Community is reported as frozen and excluded from default search. Capture/project-pin status is intentionally absent. New installs report setup_required until both the global Library and Local workspace are bound.
- **figure_library_plan_bind_global** — Validate the user-selected global Library directory and optionally stage a non-destructive flat-v1 copy. This read-only plan never chooses a project directory implicitly.
- **figure_library_apply_bind_global** — Apply the exact reviewed binding plan using operation-id idempotency and stale-plan checks.
- **figure_library_plan_bind_workspace** — Validate the user-selected Local workspace directory. First-time machine confirmation only; later starts reuse the saved locator. Never infers the current project folder.
- **figure_library_apply_bind_workspace** — Apply the exact reviewed workspace binding plan. After this first confirmation, later MCP starts reuse the same directory across projects.
- **figure_library_plan_recover_write_lock** — Inspect one exact Library write lock. The user must stop every Wisp, Codex, Claude, and other writer before approving recovery; locks are never auto-stolen.
- **figure_library_apply_recover_write_lock** — Archive the exact unchanged abandoned lock and write a recovery receipt after all writers are confirmed stopped.
- **figure_library_review_open** — Host-neutral read-only inspection of Working, Published, history, Diff, and Review findings.
- **figure_library_preview_working_revision** — Return the canonical image for an exact active pending Working plan or current Working Head. This read-only tool does not create a preview receipt or authorize materialization.
- **figure_library_template_history** — Return immutable Content Revision and Release history.
- **figure_library_diff_revisions** — Compare complete revision fields and asset inventories without modifying either revision.
- **figure_library_plan_working_revision** — Validate user-confirmed image/code intake and return an immutable Working Revision plan. The operations never calls a model or executes code.
- **figure_library_apply_working_revision** — Reverify source bytes and apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_review_gate_update** — Create a read-only lifecycle plan. No files or pointers are changed.
- **figure_library_apply_review_gate_update** — Apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_publish_working_revision** — Create a read-only lifecycle plan. No files or pointers are changed.
- **figure_library_apply_publish_working_revision** — Apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_discard_working_revision** — Create a read-only lifecycle plan. No files or pointers are changed.
- **figure_library_apply_discard_working_revision** — Apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_restore_release** — Create a read-only lifecycle plan. No files or pointers are changed.
- **figure_library_apply_restore_release** — Apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_adopt_versioning** — Create a read-only lifecycle plan. No files or pointers are changed.
- **figure_library_apply_adopt_versioning** — Apply the exact cached plan with operation-id idempotency and stale-state checks.
- **figure_library_plan_materialize** — Require a one-time confirmed exact preview receipt, then resolve the provider-qualified selector and check the destination without writing files.
- **figure_library_apply_materialize** — Apply the cached exact plan once. All failures are terminal and must not be retried with another mode, provider, downloader, or substitute template.
- **figure_library_plan_bundle_export** — Inventory either the authoritative Library (excluding rebuildable indexes/runtime locks) or one exact reachable Published Release. Produces a directory-bundle plan and writes nothing.
- **figure_library_apply_bundle_export** — Reverify the exact source inventory and visible expectedTarget, write a new directory bundle without overwrite, and persist an idempotent export receipt. A durable pre-write intent can recover a completed target after operations restart.
- **figure_library_plan_full_restore** — Verify a full backup directory. Restore preserves libraryId and requires explicit authority transfer; Fork creates a new libraryId with fork provenance.
- **figure_library_apply_full_restore** — Restore/fork into an absent target, verify every byte, and write an immutable operation receipt. It never changes the active locator automatically.
- **figure_library_plan_template_bundle_import** — Verify an exact Published-template bundle, copy its immutable assets into a new local candidate, and plan a Working Revision. Source approval is provenance only and is never inherited.
- **figure_library_apply_template_bundle_import** — Reverify the exact bundle and apply only the planned Working Revision. Local review and publish remain mandatory.
- **figure_library_github_auth_status** — Read-only check of the official gh login and central repository permissions. SFL never reads or prints the token.
- **figure_library_github_auth_instructions** — Return a terminal command for the user to run. This tool never launches a browser or login process.
- **figure_library_plan_publication_pr** — Read-only Archive or Catalog PR Plan. Archive uses one sanitized submission; Catalog requires a manually merged Archive PR and re-verifies its fixed merge commit and ZIP.
- **figure_library_apply_publication_pr** — Re-check the gh account, permissions, source, merge gate, base, and file identities; then create a branch/commit/PR through Git Data API. Never merges the PR.
- **figure_library_plan_open_figure_module_pr** — Sanitize one exact Local Published Release into an Open Figure module, search FigureYa and Open Figure Modules for similar figures, and show a GitHub PR Plan without writing or merging. Path collisions fail closed. Similar hits require user review in the SFL window before Apply.
- **figure_library_apply_open_figure_module_pr** — Re-check GitHub identity, module path collisions, optional similar-search confirmation, and file identities; then create a two-commit PR through the Git Data API. Never merges.
- **figure_library_plan_publication_export** — Resolve one exact reachable Local Published Release and show every included/excluded asset, rights declaration, public metadata conflict, render trace, and target without writing files.
- **figure_library_apply_publication_export** — Revalidate the exact Local Published Release and selected asset bytes, then atomically create one deterministic sanitized submission at a new target. This call never uses the network, signs content, or creates a PR.
- **figure_library_list_provider_sources** — Read the configured personal provider sources and their last-known-good snapshot identities without making any network request. The raw trusted public key is never returned.
- **figure_library_plan_provider_source_change** — Plan Add, Update, Configure, Remove, or explicit Trust Reset for a signed personal provider. Network access occurs only when the requested action must verify a snapshot. Planning never writes configuration or snapshots.
- **figure_library_apply_provider_source_change** — Apply the exact cached provider-source plan with stale-state checks and operation-id replay protection. Apply never accepts a raw public key or endpoint override.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "scientific-figure-library": {
    "command": "npx",
    "args": ["-y","scientific-figure-library"]
  }
}
```

## Documentation

## What scientific-figure-library does

scientific-figure-library manages a machine-local collection of scientific figure templates. Each template can include an image and its source code, along with requirement, biological use-case, data-profile, input, code, and package details. The workflow supports intake, review, immutable revisions, and published releases.

A single Library directory can be shared across projects and supported hosts. The server also provides an MCP App gallery for browsing local templates, inspecting an exact release, and confirming a template before materializing it into a project. Backup, restore, and fork operations support moving or maintaining the library.

Optional providers extend search beyond Local Published entries. The default order checks Local Published first, followed by FigureYa, Open Figure Modules, and enabled personal providers. Local Published remains the source of truth for the user's own figures.

## How it works

The server runs locally through Node.js 22 or newer and communicates with an MCP host over stdio. A typical configuration starts `dist/index.js` with Node and registers the server under `figure-library`. The library location is selected on the machine and recorded through the local locator; an administrator can override it with `FIGURE_LIBRARY_DIR`.

SFL hashes and versions imported material, applies review gates, and publishes releases. It does not run R or Python plotting code and does not include a separate model. The host agent inspects files, while SFL handles storage, identity, validation state, search, and publication. Approved runtimes and host execution or image tools are still needed when a user wants to draw a figure.

Search and materialization are deliberately separate. An agent can inspect source status, search or paginate results, view candidate images, and open the workbench. The user then confirms one exact release before the template is planned for materialization into a project.

## Setup and configuration

Install the published npm package for a supported host or build from source. Source development uses `npm ci`, followed by `npm run check`; the built entry point is launched with `node dist/index.js`. Node.js 22+ is required.

Bind one absolute, global Library directory before using the library. If the server reports `setup_required`, bind a Local workspace as well before searching. The first setup check can use `figure_library_source_status`; `figure_library_plan_bind_global` and `figure_library_apply_bind_global` handle choosing and applying the Library location.

Pi installs the `pi-mcp-adapter` and `scientific-figure-library` npm packages. DeepSeek Harness adds the package with a required profile, such as `dsh plugin --profile web add scientific-figure-library`. Claude, Codex, Cursor, and other stdio hosts can register the built server directly. Cursor and Wisp have package workflows described by the project, using `npm run package:cursor` and `npm run package:wisp` respectively.

Do not clone the repository as the Pi installation method, and do not add a second MCP entry when a host-specific package already registers the server. Folder access or a new host session may be needed after installation or library binding.

## Tools and capabilities

- Check library and workspace readiness with `figure_library_source_status`.
- Load the bundled figure-library guidance with `figure_library_get_skill`.
- Browse the MCP App workbench with `figure_library_open`.
- Search and paginate templates with `figure_library_search_page`.
- Retrieve candidate thumbnails with `figure_library_get_candidate_images` or resource URIs.
- Choose and apply a global Library binding with the plan/apply binding tools.
- Import figure-and-code pairs, review them, and publish immutable releases.
- Preview and materialize a user-confirmed exact template.
- Back up, restore, or fork the local Library.

The MCP App is optional. Historical Local Published and Open Figure Modules entries remain readable, and complete external module archives are fetched only for a selected materialization.

_Full upstream README: https://allmcps.com/mcp/scientific-figure-library/readme_

