Skip to main content
Glama
mcp-onepiece

mcp-onepiece

by bishalw

One Piece Wiki MCP Server

@wlahsib/mcp-onepiece on npm

An MCP server for the One Piece Wiki. It gives any MCP client (Claude, Cursor, VS Code, Windsurf, Codex, Gemini CLI and others) structured access to articles, infoboxes, manga chapters, anime episodes and story arcs, plus a spoiler limit that keeps answers within what you've read.

Generic MediaWiki servers can fetch pages from this wiki too. This one knows how the One Piece Wiki is laid out, so it can return clean text instead of wikitext, read infobox fields as data, map chapters ↔ episodes ↔ arcs, and cut later-arc sections out of character histories.

Tools

Tool

What it does

search_wiki

Full-text search; returns titles and URLs.

get_page

Clean article text, optionally one section. Later-arc sections are removed when a spoiler limit is set.

get_page_sections

Section headings and indexes for get_page.

list_subpages

Character tabs such as Nami/History, Nami/Abilities and Powers.

get_infobox

Infobox as label → value: bounty, Devil Fruit, affiliations, age, debut, voice actors…

get_page_categories

The article's categories (crews, fruit type, Haki users…).

get_category_members

Members of a category, paginated.

get_chapter

Title, volume, release date, Jump issue, adapting episodes, arc and short summary.

get_episode

Title, air date, season, opening, adapted chapters (empty = filler), the anime-only arc it belongs to (fillerArc) and short summary.

get_arc

Saga, order, chapter/episode/volume ranges and neighbouring arcs. Accepts loose names ("wano").

list_arcs

Every canon arc grouped by saga, or the arc containing a given chapter.

list_filler_arcs

Anime-only (filler) arcs with episode ranges and the canon arc each airs after: "which episodes can I skip?". Standalone filler episodes inside canon arcs aren't listed; get_episode flags those.

list_cover_stories

The manga's cover-page serials (e.g. Buggy's Crew Adventure Chronicles) with saga, chapter range and, where adapted, episode range.

set_spoiler_limit / get_spoiler_limit

Set the last chapter read (or the last arc finished). It is remembered across sessions; get_spoiler_limit also says where the current value came from.

The article tools take a title and follow redirects ("Zoro" → Roronoa Zoro). A title that differs from the article's only in case ("roronoa zoro") resolves to it; a title with no article returns up to three suggested titles. With a spoiler limit set, they withhold articles about subjects that debut past it (see below).

How the spoiler limit works

With a limit set (via set_spoiler_limit, or by default via ONEPIECE_SPOILER_CHAPTER):

  • get_chapter, get_arc and list_arcs withhold anything that starts after the limit.

  • get_episode is judged by the chapters it adapts. Filler is judged by the canon arc it airs during or, when it airs between canon arcs, the one it airs after.

  • list_filler_arcs leaves out anime-only arcs whose canon arc starts after the limit; list_cover_stories leaves out serials whose first chapter is past it.

  • get_page, get_page_sections, get_infobox, get_page_categories and list_subpages withhold articles whose subject first appears after the limit:

    • Chapter N and Episode N pages follow the get_chapter and get_episode rules, and canon arc pages (and saga pages made up only of later arcs) the get_arc rule.

    • Anything else is judged by the Debut field of its infobox: the first chapter listed, or for anime-only subjects the first chapter of the canon arc the anime had reached by the debut episode. Subjects that debuted in a film or game, or have no infobox, are not withheld.

    • Subpages such as Kaidou/History are judged by their base article.

  • get_page removes sections headed by a later arc or saga, which is how every character History page is organised.

It cannot filter later facts mentioned in the intros, infoboxes (e.g. a current bounty) or prose outside arc headings of subjects that debuted earlier, and every affected response ends with a notice saying so. search_wiki and get_category_members are not filtered.

The limit is remembered. set_spoiler_limit saves the new value, including turning the limit off, to a small JSON state file (~/.config/mcp-onepiece/state.json by default; see ONEPIECE_STATE_FILE under Configuration), and the server loads it at startup. A saved value wins over ONEPIECE_SPOILER_CHAPTER, which only applies until you first set a limit. get_spoiler_limit reports the source: saved, environment, session (set while saving is off or failed) or null when there is no limit. The file is read only at startup, so servers running at the same time don't see each other's changes, and whichever saves last wins. If the file can't be written, the limit still applies for the session and the tool response says it wasn't saved.

Related MCP server: osrs-wiki-mcp

Install

Requires Node.js 20 or newer. There is nothing to clone or build: MCP clients start the server with npx, which downloads it from npm on first use.

Claude Code

claude mcp add -s user onepiece-wiki -- npx -y @wlahsib/mcp-onepiece

Claude Desktop, Cursor, Windsurf, Gemini CLI

These all use the same mcpServers format. Add this to the client's config file:

Client

Config file

Claude Desktop

claude_desktop_config.json (Settings → Developer → Edit Config)

Cursor

~/.cursor/mcp.json, or .cursor/mcp.json in a project

Windsurf

~/.codeium/windsurf/mcp_config.json

Gemini CLI

~/.gemini/settings.json

{
  "mcpServers": {
    "onepiece-wiki": {
      "command": "npx",
      "args": ["-y", "@wlahsib/mcp-onepiece"]
    }
  }
}

VS Code (GitHub Copilot agent mode)

Add to .vscode/mcp.json in a workspace, or run MCP: Add Server from the command palette:

{
  "servers": {
    "onepiece-wiki": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@wlahsib/mcp-onepiece"]
    }
  }
}

OpenAI Codex CLI

codex mcp add onepiece-wiki -- npx -y @wlahsib/mcp-onepiece

Any other MCP client

The server speaks MCP over stdio. Point the client at the command npx -y @wlahsib/mcp-onepiece.

Setting a default spoiler limit

Pass ONEPIECE_SPOILER_CHAPTER in the client's environment settings, e.g. for the mcpServers format:

"onepiece-wiki": {
  "command": "npx",
  "args": ["-y", "@wlahsib/mcp-onepiece"],
  "env": { "ONEPIECE_SPOILER_CHAPTER": "1000" }
}

or claude mcp add -s user onepiece-wiki -e ONEPIECE_SPOILER_CHAPTER=1000 -- npx -y @wlahsib/mcp-onepiece. You can also just tell the assistant how far you've read; it calls set_spoiler_limit, and that limit is remembered for future sessions. Once a limit has been saved it takes precedence over ONEPIECE_SPOILER_CHAPTER.

Troubleshooting

  • spawn npx ENOENT: desktop apps launched from the Dock or Start menu may not see your shell's PATH. Use the full path from which npx (macOS/Linux) as command. On Windows, use "command": "cmd", "args": ["/c", "npx", "-y", "@wlahsib/mcp-onepiece"].

  • Picking up a new version: npx caches packages; use npx -y @wlahsib/mcp-onepiece@latest to force an update.

Running from source

git clone https://github.com/bishalw/mcp-onepiece.git && cd mcp-onepiece
npm install && npm run build

Then use node /absolute/path/to/mcp-onepiece/dist/index.js as the command in any of the configs above.

Configuration

All settings are optional environment variables.

Variable

Default

Meaning

ONEPIECE_SPOILER_CHAPTER

unset

Default spoiler limit (last chapter read). Used only until a limit is saved with set_spoiler_limit.

ONEPIECE_STATE_FILE

$XDG_CONFIG_HOME/mcp-onepiece/state.json, else ~/.config/mcp-onepiece/state.json

Where the spoiler limit is remembered between sessions. off disables saving. Read once at startup; concurrent servers are last-write-wins.

ONEPIECE_WIKI_URL

https://onepiece.fandom.com

Wiki origin.

ONEPIECE_CACHE_TTL_SECONDS

3600

How long API responses are cached in memory. The arc catalog is kept for 24 hours.

ONEPIECE_CACHE_MAX_ENTRIES

500

Cache size bound (LRU).

ONEPIECE_MAX_CONCURRENCY

4

Maximum simultaneous requests to the wiki.

ONEPIECE_REQUEST_TIMEOUT_MS

15000

Per-request timeout.

LOG_LEVEL

info

debug, info, warn, error or silent. Logs are JSON lines on stderr.

Invalid values stop the server at startup with a message naming the variable.

Development

npm run dev              # run from source with tsx
npm run check            # typecheck + lint + tests
npm run build            # compile to dist/
npm run inspect          # open the MCP Inspector against dist/
npm run fixtures:record  # re-record test fixtures from the live wiki

Releasing

npm version patch        # or minor / major; commits and tags
npm publish              # prepublishOnly runs all checks and a fresh build first
git push --follow-tags

The published package contains only dist/*.js, README.md and package.json. The server and the wiki User-Agent both read their version from package.json.

Layout

src/
  index.ts          entry point: config, logging, stdio transport, shutdown
  state.ts          state file that remembers the spoiler limit between sessions
  version.ts        package name and version, read from package.json
  server.ts         createServer(): wires the client, domain services and tools
  config.ts         environment parsing and validation (zod)
  wiki/             MediaWiki API client: cache, concurrency limit, timeouts, retries, title fallback
  parsing/          HTML → text, infobox and range parsing (pure functions)
  domain/           arcs catalog, filler arcs and cover stories, chapters/episodes, spoiler guard
  tools/            MCP tool definitions, thin adapters over domain/
test/
  unit/             parsing, cache, limiter, client, config, spoiler guard, filler/cover-story parsing
  integration/      MCP client ↔ server over an in-memory transport, replaying fixtures; spoiler-limit persistence
  support/          fixture record/replay, test harness, scenarios
  fixtures/         recorded wiki API responses
scripts/
  record-fixtures.ts

Tests and fixtures

Integration tests drive the real server through an MCP client, but the wiki is replaced by responses recorded in test/fixtures. Tests never touch the network, and a request with no recorded fixture fails with a message telling you to re-record. They also run with the state file turned off (persistence tests use temp directories), so they never touch your saved spoiler limit. npm run fixtures:record runs every entry in test/support/scenarios.ts against the live wiki and rewrites the fixtures. Do this after adding a scenario, or when the wiki's markup changes and you want to confirm the parsers still work.

Design notes

  • Parsing rendered HTML instead of wikitext. Infobox values such as arc chapter ranges are computed by templates (chapter = auto), so only the rendered page has them.

  • Stable keys. Infobox fields are read by their data-source template parameter rather than by display label.

  • Polite by default. Requests use a descriptive User-Agent, bounded concurrency, caching, and exponential backoff that honours Retry-After.

  • Errors the model can act on. Missing pages, unknown arcs and spoiler blocks are returned as tool errors with a next step. Unexpected failures are logged to stderr and summarised.

Licence

The code is released under the MIT License.

Wiki content

Wiki content is © One Piece Wiki contributors under CC BY-SA. Tool responses include article URLs so answers can link their sources.

Available Tools

13 tools
get_arcGet a story arcA
Read-onlyIdempotent

A canon story arc's saga, position in the story, chapter/episode/volume ranges, release years and neighbouring arcs. Accepts loose names such as 'wano' or 'Enies Lobby'.

Inputs: name (required).

get_category_membersList a category's membersB
Read-onlyIdempotent

Articles and subcategories in a category, e.g. 'Straw Hat Pirates Members', 'Logia Devil Fruit Users', 'Male Characters'.

Inputs: category (required), limit, cursor.

get_chapterGet a manga chapterA
Read-onlyIdempotent

A manga chapter's title, volume, release date, Weekly Shōnen Jump issue, the anime episodes that adapt it, its story arc and a short summary. Blocked when past the spoiler limit.

Inputs: number (required).

get_episodeGet an anime episodeA
Read-onlyIdempotent

An anime episode's title, air date, season, opening song, the manga chapters it adapts (empty for filler) and a short summary. Blocked when it adapts chapters past the spoiler limit.

Inputs: number (required).

get_infoboxGet an article's infoboxA
Read-onlyIdempotent

The article's infobox as label → value pairs. For characters: affiliations, occupations, bounty, Devil Fruit, age, birthday, height, debut chapter/episode and voice actors. Devil Fruits, arcs, ships and places have their own fields. Fields outside the main block are prefixed with their group, e.g. 'Devil Fruit – Type'.

Inputs: title (required).

get_pageRead an articleA
Read-onlyIdempotent

Readable text of an article, with references, navigation boxes and the infobox removed (use get_infobox for that). For long articles pass section to fetch one part. When a spoiler limit is set, sections about later arcs are removed.

Inputs: title (required), section, max_chars.

get_page_categoriesList an article's categoriesA
Read-onlyIdempotent

Categories an article belongs to: a quick way to see a character's crews, Devil Fruit type, species, Haki and more.

Inputs: title (required).

get_page_sectionsList an article's sectionsA
Read-onlyIdempotent

Section headings of an article, with indexes usable as get_page's section.

Inputs: title (required).

get_spoiler_limitGet the spoiler limitA
Read-onlyIdempotent

The current spoiler limit (last chapter the user has read), or null if none is set.

Inputs: no named parameters.

list_arcsList story arcsA
Read-onlyIdempotent

Every canon story arc in order, grouped by saga, with chapter and episode ranges. Also answers 'which arc is chapter N in?' via chapter. Arcs past the spoiler limit are left out.

Inputs: chapter.

list_subpagesList an article's subpagesA
Read-onlyIdempotent

Subpages of an article. Major characters are split into tabs such as '/History', '/Personality and Relationships', '/Abilities and Powers' and '/Misc.'; find them here, then read one with get_page.

Inputs: title (required).

search_wikiSearch the One Piece WikiA
Read-onlyIdempotent

Full-text search of One Piece Wiki articles. Large articles are split into subpages (e.g. 'Monkey D. Luffy/Abilities and Powers'), and those show up in results too.

Inputs: query (required), limit.

set_spoiler_limitSet the spoiler limitA
Idempotent

Set the last manga chapter the user has read. Afterwards, chapters, episodes and arcs past it are withheld and article sections about later arcs are removed. Call with no chapter to turn the limit off. Use this whenever the user says how far they are, e.g. 'I'm at chapter 900' or 'I just finished Enies Lobby'.

Inputs: arc, chapter.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a distinct resource or aspect: search, page content, sections, subpages, infobox, categories, category members, chapters, episodes, arcs, and spoiler settings. Even similar-sounding tools like get_arc vs list_arcs are clearly separated by singular vs list. There is no overlap or ambiguity.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case: search_wiki, get_page, get_page_sections, list_subpages, get_infobox, etc. The naming is uniform and predictable, making it easy for an agent to infer functionality from names.

    Tool Count5/5

    13 tools is well within the ideal 3-15 range for a focused server. Each tool serves a clear purpose in the wiki domain, from content retrieval to structured data extraction and spoiler control, without redundancy or bloat.

    Completeness5/5

    The surface covers the full lifecycle of interacting with the One Piece wiki: searching, reading pages, navigating sections/subpages, extracting infobox data, exploring categories, querying chapters/episodes/arcs, and managing spoiler limits. There are no obvious gaps for the intended use case.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Provides read-only access to Old School RuneScape Wiki data, returning structured content with source provenance via MCP tools for searching pages, items, monsters, quests, shops, and drop sources.
      10
      234 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables structured access to Bulbapedia's Pokémon encyclopedia through natural language, including searching pages, retrieving Pokémon data, moves, abilities, items, locations, and wiki metadata via the MediaWiki API.
      116 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables LLM clients to search, read, create, edit, and manage pages, files, categories, and revisions on any wiki running the MediaWiki software, with optional OAuth-authenticated write access. Also exposes extension-specific capabilities such as Wikibase entities and SPARQL queries, Semantic MediaWiki and Cargo queries, and NeoWiki knowledge-graph subjects.
      8 npm
      MIT