oeis-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@oeis-mcp-serverwhat integer sequence is 1, 1, 2, 3, 5, 8, 13, 21?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Overview
Integer sequences from the On-Line Encyclopedia of Integer Sequences (OEIS). Identify a sequence from a few observed terms, search with OEIS's own query syntax, read an entry's formulas, generating functions, and programs, page through extended terms from its b-file, and walk its cross-references. Answers come from the OEIS entries themselves, each linked to its page. Runs as a stdio process or a local Streamable HTTP server, with no API key.
Tools
Tool | Description |
| Identify sequences that contain a run of consecutive terms, in OEIS relevance order, with the index where the run begins |
| Search with OEIS query syntax: words, quoted phrases, term lists, and prefixes such as |
| Fetch one entry by A-number: terms, offset, keywords, formulas, programs, comments, references, links, and cross-references |
| List terms a(n) with their indices from the entry's b-file, or from its data line when it has none |
| List the sequences an entry cross-references, or the entries that mention it |
| Decode keyword flags, search syntax, and identifier and offset conventions, with no upstream call |
Resources
Resource | Description |
| One entry by A-number as JSON, always whole |
The same record is available through oeis_get_sequence for clients that only call tools.
Related MCP server: @cyanheads/federal-reserve-mcp-server
Capability reference
oeis_identify_sequence tool
terms: up to 60 consecutive terms separated by commas or spaces (a bracketed list or a trailing...is accepted), each an integer of at most 200 digits or_for one unknown term;matchSigns(defaultfalse) ignores signs unless setUp to 10 candidates per page,
start0–100 in steps of 10; each row carriesmatchStartIndex, the n where the run begins in that entry's data line (absent when the run isn't there)No match and "too many results" both return an empty page, and the
noticesays which and how to retry: drop leading terms, divide out a common factor, or add terms
oeis_search_sequences tool
query(1–1,000 characters) is sent as written: words,"quoted phrases", term lists, prefixes such askeyword:,author:,name:,formula:,xref:, andid:,|for OR, and a leading-to excludesort:relevance(default),number,created, ormodified; 10 per page,start0–100 in steps of 10Reports
totalCountandeffectiveQuery, the query as OEIS parsed it; the zero-hit notice names any prefix that is not an OEIS prefix
oeis_get_sequence tool
Returns
name,terms,offset/firstIndex,keywords,author,legacyIds,referenceCount,revision,created/modified,url, andbFileUrl, plus eight sections:comments,formulas,examples,programs,references,links,crossReferences,extensionsWhen the sections exceed 24,000 characters of serialized JSON,
kind: "outline"returns the core fields with a sizedsectionslist; passsections(e.g.["formulas", "programs"]) to get the chosen ones whatever their sizeAn unknown A-number fails as
sequence_not_found; withdrawn (dead), reserved, and recycled entries come back with anotice
oeis_get_terms tool
fromIndex(default: the first available index) andlimit1–1,000 (default 100); a slice also stops at about 100,000 bytes, andnextFromIndexcontinues itsource: "bfile"reads the first 1 MiB of the entry's b-file, withbFileCut: truewhen the file is larger;source: "data"means the entry has no b-file and the terms are its data lineTerms come back as
{ n, value },valuean exact decimal string; an unknown A-number fails assequence_not_found
oeis_get_cross_refs tool
direction: "outgoing"(default) lists the A-numbers named in the entry's cross-reference lines, with thenotewritten beside each and thelinesverbatim;"incoming"lists the entries that mention the A-number10 rows per page,
start0–100 in steps of 10; every row carriesurl, and resolved rows add the name, terms, offset, and keywordsWhen the name lookup for an outgoing page is rate-limited, unavailable, or times out, the rows come back
resolved: falsewith a retry notice instead of failing;sequence_not_foundapplies tooutgoingonly
oeis_list_reference tool
topic:keywords(flags such asnonn,core,tabl,cons),search_syntax(prefixes, operators, wildcards, sort orders, paging), oridentifiers(A-numbers, legacy M/N numbers, offsets, b-files)Returns
entries(name,description) andnotesfrom static tables
oeis://sequence/{aNumber} resource
The full entry as
application/json: the recordoeis_get_sequencereturns withkind: "full", never outlinedaNumbertakes the same forms as the tools (oeis://sequence/A108reads A000108); an unknown A-number fails assequence_not_found
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
OEIS-specific:
One oeis.org client: entry records as JSON, searches in OEIS's internal text format, which tells "no results" apart from "too many results" and states the match total, and b-files read directly
One request at a time, at least 10 seconds apart, shared by every tool, with an in-memory cache in front (see Pacing and caching)
Forgiving A-numbers:
A000045,a000045,A45,45, and an oeis.org sequence URL all resolve in every tool; a legacy M/N book number is pointed tooeis_search_sequencesExact terms: every term and b-file value is a decimal string, so values past 2^53 keep every digit
Pasted term runs are normalized: brackets, a trailing
..., the Unicode minus sign, and mixed comma and space separators
Agent-friendly output:
Paging context on every page:
truncated,shown, andcap, plustotalCountandeffectiveQuerywhere OEIS reports them, and onenoticecomposed from the input (drop leading terms, a common factor, an unrecognized prefix, the nextstart)Typed failures with recovery hints:
sequence_not_found,pacer_shed, andupstream_rate_limited, the rate-limit errors carryingretryAfterwhen one is known; an outgoing cross-reference page whose name lookup fails still returns every A-number, markedresolved: falseDiscriminated outputs:
kind: "full" | "outline",source: "bfile" | "data", and per-rowresolved, so callers branch on data, not string parsingProvenance and safe rendering: every record and row carries its
https://oeis.org/A######URL; contributor-written text renders as blockquotes and code fences, and onlyhttpandhttpslink URLs are kept
Pacing and caching
oeis.org asks automated clients to wait 10 seconds between requests. The server keeps to that: it sends one upstream request at a time and starts each at least 10 seconds after the last, across every tool. Results are cached in memory, so a repeated lookup returns at once and costs oeis.org nothing: records for 24 hours (then revalidated with a conditional request), search pages for 1 hour, and b-file reads for 7 days.
A call with nothing cached waits its turn in the queue. When the wait would pass OEIS_QUEUE_MAX_WAIT_MS (default 30,000 ms), the call fails with pacer_shed and a retryAfter instead of hanging. If oeis.org answers 429, the server holds every queued call back before trying again, and reports upstream_rate_limited once its retries are spent.
Known limitations
The server is built for local use at this pace: one upstream request per 10 seconds per server process. Concurrent uncached calls queue and, past the wait budget, fail with
retryAfter.Anonymous paging is capped upstream at 110 results per query (
start≤ 100); A000045's 6,161 incoming references, for example, are reachable only through their first 110.A query OEIS judges too broad returns no rows at all ("Too many results"); this is common for short queries such as a single word (
prime) or a two-term run. The server reports it but cannot page it.OEIS searches a misspelled or unknown prefix as plain words instead of rejecting it; the zero-hit notice names any prefix that is not an OEIS prefix.
Term identification searches the data line only (about three screen lines of terms), not b-files; a run that starts beyond the data line is not found.
oeis_get_termsreads at most the first 1 MiB of a b-file.oeis_get_cross_refsoutgoing shares thestart≤ 100 bound, so an entry naming more than 110 distinct A-numbers lists only the first 110;linesstill names them all.Records are cached for up to 24 hours, then revalidated.
Data and licensing
OEIS content is licensed CC BY-SA 4.0 under the OEIS End-User License Agreement. When you reuse it, credit "The On-Line Encyclopedia of Integer Sequences" with a link to https://oeis.org/ or to the sequence page; every record the server returns carries its https://oeis.org/A###### URL for that purpose. ShareAlike applies: adaptations of OEIS content must be shared under the same license.
This server is an independent project and is not affiliated with or endorsed by the OEIS Foundation.
Getting started
Add the following to your MCP client configuration file.
{
"mcpServers": {
"oeis-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/oeis-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"oeis-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/oeis-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"oeis-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/oeis-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
No API key or account: the server reads public oeis.org data.
Installation
Clone the repository:
git clone https://github.com/cyanheads/oeis-mcp-server.gitNavigate into the directory:
cd oeis-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# optional: adjust OEIS_QUEUE_MAX_WAIT_MS, the transport, or the log levelConfiguration
Variable | Description | Default |
| Longest a call waits in the oeis.org request queue before failing with |
|
| Transport: |
|
| HTTP server port. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for every server setting and the common framework overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions. The |
| Schemas shared across definitions (A-number input, paging, summary rows) and Markdown helpers for contributor-written text. |
| oeis.org client: pacer, retries, fetch boundaries, LRU cache, record normalization, and the internal-format parser. |
| Unit tests mirroring the |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging andctx.enrichfor notices, totals, and paging contextRegister new tools and resources in the barrels at
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
Query FDA data on drugs, food, devices, and recalls via openFDA. STDIO or Streamable HTTP.
Structured analysis API and remote MCP tool for text, JSON records and numeric series.
Search NPPES providers and resolve NUCC specialty codes via MCP over STDIO or Streamable HTTP.
Related MCP Servers
AlicenseAqualityDmaintenanceEnables exploration and computation of mathematical integer sequences from OEIS using the LODA assembly language. Supports sequence discovery, program execution, algorithmic mining, and real-time computation of mathematical sequences.81Apache 2.0- AlicenseNot gradedqualityAmaintenanceSearch and fetch ~800K Federal Reserve economic time-series from the FRED API via MCP, with STDIO or Streamable HTTP transport.81 npm1Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables querying iNaturalist's wildlife observation data through MCP, including searching sightings by area, date, or taxon; reading identification threads; ranking species; charting phenology; and finding look-alike taxa. Supports stdio and Streamable HTTP transports with keyless, read-only access.518 npm1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables searching DataCite datasets and software, fetching DOI metadata, tracing relations, and formatting citations via MCP, supporting stdio or Streamable HTTP.1Apache 2.0