Memory Alpha MCP Server
Allows searching and retrieving Star Trek articles, episodes, characters, starships, and other content from Memory Alpha, the Star Trek wiki hosted on Fandom.
Click on "Install 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., "@Memory Alpha MCP Servergive me a summary of the USS Enterprise-D"
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.
Memory Alpha MCP Server
An MCP (Model Context Protocol) server that brings Star Trek knowledge from Memory Alpha into your AI sessions. Search articles, look up episodes, compare starships, simulate battles, build away teams, take trivia quizzes, and get your code reviewed by Q himself.
Disclaimer: This is an unofficial fan project. Not affiliated with CBS, Paramount, or Memory Alpha. All content is dynamically fetched from Memory Alpha's public API (CC-BY-SA licensed). No copyrighted material is embedded or redistributed.
Installation
Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"memory-alpha": {
"command": "npx",
"args": ["-y", "memory-alpha-mcp"]
}
}
}Claude Code
claude mcp add memory-alpha -- npx -y memory-alpha-mcpManual
npm install -g memory-alpha-mcp
memory-alpha-mcpRelated MCP server: mediawiki-mcp-server
Requirements
Node.js 18+ (uses built-in
fetch)
How It Works
The server dynamically fetches content from Memory Alpha's public MediaWiki API (no authentication required). Raw wikitext is parsed into clean structured data using wtf_wikipedia, with custom regex fallbacks for Memory Alpha's {{sidebar ...}} templates.
Architecture
src/
index.ts # Entry point: MCP server + stdio transport + graceful shutdown
api/ # MediaWiki API client layer
client.ts # HTTP client with rate limiting (5 req/s), retry, 10s timeout, caching
parse.ts # action=parse (wikitext retrieval)
search.ts # action=query&list=search
categories.ts # action=query&list=categorymembers
random.ts # action=query&list=random
types.ts # TypeScript interfaces for API responses
parser/ # Wikitext parsing pipeline
wikitext.ts # Main parser: wtf_wikipedia wrapper, disambiguation detection
infobox.ts # Brace-balanced sidebar/infobox extraction with regex fallback
sections.ts # Section extraction by heading
tools/ # 31 MCP tool implementations
prompts/ # 22 Trek-themed prompt templates
resources/ # 7 static reference resources
utils/
cache.ts # In-memory TTL cache with LRU eviction (5min TTL, 100 entries)
logger.ts # console.error wrapper (never console.log - corrupts stdio)
text.ts # Wikitext cleaning, HTML stripping, truncation, template stripping
attribution.ts # CC-BY-SA attribution footer appended to all responses
shuffle.ts # Fisher-Yates shuffleKey Design Decisions
Decision | Rationale |
Dynamic API fetch only | Legal safety: we're an API client, not a content host |
| Best-in-class wikitext parser with zero transitive dependencies |
Brace-balanced template matching | Memory Alpha's |
In-memory cache (not disk) | Simple, no extra dependencies, sufficient for session-length usage |
|
|
All responses as formatted text | Better for LLM consumption than raw JSON |
Tools (31)
Core Tools
search_memory_alpha
Search Memory Alpha for Star Trek articles, characters, ships, episodes, and more.
Parameter | Type | Required | Description |
| string | yes | Search query (e.g. "Jean-Luc Picard", "USS Enterprise") |
| number (1-20) | no | Max results to return (default: 10) |
get_article
Get a full or partial article from Memory Alpha. Use exact article titles for best results.
Parameter | Type | Required | Description |
| string | yes | Article title (e.g. "James T. Kirk", "Warp drive") |
| string | no | Specific section heading (e.g. "Background information") |
| boolean | no | Return only the intro summary (default: false) |
Automatically detects disambiguation pages and returns a list of available articles instead.
get_random_article
Get random Star Trek articles from Memory Alpha.
Parameter | Type | Required | Description |
| number (1-5) | no | Number of random articles (default: 1) |
browse_categories
Browse Memory Alpha articles by category.
Parameter | Type | Required | Description |
| string | yes | Category name (e.g. "Federation starships", "Vulcans") |
| number (1-50) | no | Max articles to list (default: 20) |
Domain Tools
get_episode
Get details about a Star Trek episode: synopsis, writer, director, stardate, guest cast. Look up by title or by series + season + episode number.
Parameter | Type | Required | Description |
| string | no | Episode title (e.g. "The Best of Both Worlds") |
| string | no | Series abbreviation (TOS, TNG, DS9, VOY, ENT, DIS, PIC, LD, PRO, SNW) |
| number | no | Season number |
| number | no | Episode number within the season |
Provide either title or all three of series + season + episode.
list_episodes
List all episodes for a Star Trek series season.
Parameter | Type | Required | Description |
| string | yes | Series abbreviation (TOS, TNG, DS9, VOY, ENT, DIS, PIC, LD, PRO, SNW) |
| number (1-10) | yes | Season number |
get_starship
Get details about a Star Trek starship: class, registry, armaments, crew complement.
Parameter | Type | Required | Description |
| string | yes | Ship name (e.g. "USS Enterprise (NCC-1701-D)", "USS Defiant") |
species_info
Get info about a Star Trek species: homeworld, physiology, culture, quadrant.
Parameter | Type | Required | Description |
| string | yes | Species name (e.g. "Klingon", "Vulcan", "Borg", "Ferengi") |
character_lookup
Get details about a Star Trek character: rank, species, affiliation, biography, career history, and memorable quotes.
Parameter | Type | Required | Description |
| string | yes | Character name (e.g. "Jean-Luc Picard", "Worf", "Seven of Nine") |
Extracts sidebar data from individual/character/personnel templates. Automatically detects disambiguation pages.
get_timeline
Get Star Trek events for a specific in-universe year.
Parameter | Type | Required | Description |
| string | yes | Year or era (e.g. "2364", "22nd century", "2150s") |
on_this_day
Get Star Trek events, air dates, and birthdays for a specific date.
Parameter | Type | Required | Description |
| string | no | Date in "Month Day" format (e.g. "February 14"). Defaults to today. |
| string | no | IANA timezone (e.g. "America/New_York"). Defaults to UTC when no date is provided. |
crew_manifest
Get the crew roster for a Star Trek starship or station.
Parameter | Type | Required | Description |
| string | yes | Ship or station name (e.g. "USS Enterprise (NCC-1701-D)", "Deep Space 9") |
rules_of_acquisition
Look up Ferengi Rules of Acquisition by number, randomly, or search by keyword. Rules are dynamically parsed from Memory Alpha's article.
Parameter | Type | Required | Description |
| number | no | Specific rule number to look up |
| boolean | no | Get a random Rule of Acquisition (default: false) |
| string | no | Search rules by keyword |
stardate_converter
Convert between stardates and real-world dates, or get the current stardate. Supports both TOS-era and TNG-era conversion formulas.
Parameter | Type | Required | Description |
| string | no | Real-world date to convert (e.g. "2026-02-14", "March 5 1987"). Defaults to today. |
| number | no | Stardate to convert to a real-world date (e.g. 41153.7) |
| "TOS" | "TNG" | no | Era for conversion formula (default: "TNG") |
Provide either date or stardate. If neither is given, converts today's date.
Fun Tools
compare
Compare two Star Trek subjects side-by-side with infobox data in a markdown table.
Parameter | Type | Required | Description |
| string | yes | First subject (e.g. "USS Enterprise (NCC-1701-D)") |
| string | yes | Second subject (e.g. "USS Voyager") |
trivia_quiz
Generate a Star Trek trivia question from random Memory Alpha facts.
Parameter | Type | Required | Description |
| "easy" | "medium" | "hard" | no | Difficulty level (default: "medium") |
who_said_it
Quote attribution challenge - guess which Star Trek character said it.
Parameter | Type | Required | Description |
| "easy" | "medium" | "hard" | no | Difficulty level (default: "medium") |
alien_phrases
Look up phrases and vocabulary from Star Trek alien languages. Extracts structured vocabulary sections (Common phrases, Vocabulary, Lexicon, etc.) when available, falling back to full article text.
Parameter | Type | Required | Description |
| string | yes | Alien language (e.g. "Klingon", "Vulcan", "Ferengi", "Romulan") |
Supports Klingon, Vulcan, Ferengi, Romulan, Bajoran, Cardassian, and Dominion with known article mappings. Other languages are searched dynamically.
prime_directive_check
Evaluate whether an action violates the Prime Directive, with a humorous Starfleet assessment.
Parameter | Type | Required | Description |
| string | yes | The action to evaluate (e.g. "Giving warp technology to a pre-warp civilization") |
Returns a violation probability, threat level, historical precedent, and context from the Prime Directive article.
red_shirt_analysis
Assess survival odds in classic Trek redshirt style.
Parameter | Type | Required | Description |
| string | yes | Describe the mission or situation (e.g. "Exploring an uncharted planet with strange energy readings") |
Analyzes keywords in the description to compute survival probability, risk factors, probable cause of demise, and recommended last words.
battle_simulator
Pit two Star Trek ships against each other in a tactical analysis based on their specs. Fetches real ship data from Memory Alpha, compares combat-relevant specifications, and generates a battle narrative.
Parameter | Type | Required | Description |
| string | yes | First ship (e.g. "USS Enterprise (NCC-1701-D)") |
| string | yes | Second ship (e.g. "Borg cube") |
Returns a spec comparison table, combat probability percentages, predicted victor, and a dramatic battle narrative.
away_team_builder
Recommend an optimal away team composition for a mission based on crew specialties. Analyzes mission keywords to determine needed roles, selects from a crew database, and assesses mission risk.
Parameter | Type | Required | Description |
| string | yes | Describe the mission (e.g. "Negotiate peace treaty with hostile species on a volcanic planet") |
| number (2-6) | no | Number of team members (default: 4) |
Returns recommended crew, mission analysis, required equipment, and risk assessment.
episode_recommender
Get episode recommendations based on a Star Trek episode you enjoyed. Analyzes the source episode's themes and categories to find related episodes.
Parameter | Type | Required | Description |
| string | yes | Episode title you liked (e.g. "The Inner Light", "In the Pale Moonlight") |
| number (1-10) | no | Number of recommendations (default: 5) |
holodeck_program
Generate a Star Trek holodeck program designation, safety assessment, and malfunction probability. Analyzes the scenario to determine classification, complexity, and risks.
Parameter | Type | Required | Description |
| string | yes | Describe the desired holodeck scenario (e.g. "A noir detective mystery in 1940s San Francisco") |
| boolean | no | Whether safety protocols are enabled (default: true) |
Returns program designation, classification, malfunction probability, environmental parameters, safety assessment, and known risks.
start_trivia_game
Generate a bundle of Star Trek trivia questions for a multi-player game session. Returns a game_id and question set for Clara to track scores per player.
Parameter | Type | Required | Description |
| number (3-10) | no | Number of questions to generate (default: 5) |
| "easy" | "medium" | "hard" | no | Difficulty level (default: "medium") |
check_trivia_answer
Check a player's trivia answer against the correct answer. Fully stateless — Clara passes the correct answer from the game bundle.
Parameter | Type | Required | Description |
| string | yes | The player's answer (letter or full text) |
| string | yes | The correct answer string (from start_trivia_game output) |
| string | no | Player name for personalized response |
diplomatic_scenario
Generate a Star Trek diplomatic negotiation scenario between two factions, with positions, demands, and leverage points.
Parameter | Type | Required | Description |
| string | yes | First faction (e.g. "Federation", "Klingon Empire") |
| string | yes | Second faction (e.g. "Romulan Star Empire") |
| string | no | Optional subject of the dispute |
anomaly_of_the_week
Generate a Star Trek space anomaly with effects on the ship and possible resolutions — classic TNG vibes.
Parameter | Type | Required | Description |
| "minor" | "moderate" | "critical" | no | How dangerous the anomaly is (default: "moderate") |
mirror_universe
Describe the mirror universe version of a character, ship, or event. Checks Memory Alpha for a dedicated mirror article.
Parameter | Type | Required | Description |
| string | yes | The character, ship, or event to look up (e.g. "Spock", "Benjamin Sisko") |
first_contact_assessment
Given a species name, look it up and assess warp capability, government type, and recommended first contact approach.
Parameter | Type | Required | Description |
| string | yes | The species to assess (e.g. "Bajoran", "Tamarian") |
temporal_incursion
Look up a known Trek time-travel event and describe the temporal paradox and its resolution.
Parameter | Type | Required | Description |
| string | no | Episode/event name (e.g. "City on the Edge of Forever"). Random if omitted. |
Prompts (22)
Prompt | Parameters | Description |
|
| Explain a topic with Vulcan logic and emotional detachment |
|
| Explain a coding/tech concept using Star Trek analogies |
|
| Format a summary as a Captain's Log entry (auto-generates stardate if omitted) |
|
| Transform a technical explanation into Star Trek technobabble |
|
| Summarize a plan with Picard's decisive authority. Ends with "Engage." |
|
| Confirm a plan with Picard's commanding authority. Ends with "Make it so." |
|
| Perform a Spock-style analytical deep-dive |
|
| McCoy-style scope creep objection: "I'm a {role}, not a..." |
|
| Borg-style efficiency optimization of a process |
|
| Analyze a no-win scenario and find creative Kirk-style solutions |
|
| Vulcan salute session wrap-up with logical assessment |
|
| Q's omnipotent, theatrically condescending roast of your code |
|
| Scotty-style engineering time estimate (multiply everything by 4 to look like a miracle worker) |
|
| Guinan-style wise bartender advice — cryptic but exactly what you needed |
|
| Worf-style security assessment and tactical recommendation |
|
| Counselor Troi empathic analysis — sense the feelings in your code or situation |
|
| Borg efficiency critique — precise, unsentimental, brutally optimal |
|
| Bajoran resistance perspective — morally direct, politically sharp, passionately principled |
|
| Janeway-style determination — coffee, science, and sheer force of will |
|
| Ferengi contract negotiation — profit, loss, and hidden clauses |
|
| Data-style systematic analysis — thorough, earnest, peppered with probability estimates |
|
| EMH-style assessment — brilliant, sarcastic, perpetually underappreciated |
Resources (7)
Resource | URI | Description |
Series Reference |
| All Trek series (TOS through SNW) with years, seasons, setting, ship, and captain |
Glossary |
| Key Star Trek terminology: warp drive, phaser, transporter, tricorder, etc. |
Technobabble |
| Particles, fields, phenomena, engineering actions, and systems for generating authentic technobabble |
Starship Classes |
| Ship classes by faction (Federation, Klingon, Romulan, Cardassian, Borg, Dominion) with era, role, and notable vessels |
Factions |
| Major Trek factions — government type, home region, notable treaties, diplomatic stance |
Prime Directive Cases |
| Canonical episodes where the Prime Directive was tested, with dilemmas and outcomes |
Technology Index |
| Key Trek technologies — how they work, notable failures, and series of origin |
These are static reference resources with original descriptions (not Memory Alpha content), available for context without making API calls.
Examples
"Search Memory Alpha for Borg"
"Tell me about the episode 'The Best of Both Worlds'"
"List all episodes of TNG Season 3"
"What are the specs of the USS Defiant?"
"Look up Jean-Luc Picard's character profile"
"Give me a random Star Trek trivia question"
"Check if giving warp technology to a pre-warp civilization violates the Prime Directive"
"What's my red shirt survival odds for exploring an unknown cave alone?"
"Look up Ferengi Rule of Acquisition #34"
"Compare the USS Enterprise-D with the USS Voyager"
"Simulate a battle between the Enterprise-D and a Borg cube"
"Build me an away team for a diplomatic mission on a hostile planet"
"Recommend episodes similar to 'The Inner Light'"
"Generate a holodeck program for a 1940s detective noir mystery"
"What's the current stardate?"
"Convert stardate 41153.7 to a real-world date"
"What happened in Star Trek on February 14?"
"Look up Klingon phrases"
"Explain microservices like Spock would"
"Give me Scotty's estimate for migrating a database"
"Assess this situation as Worf would: the build pipeline is failing"
"Review my code as Q"Development
git clone https://github.com/yourusername/memory-alpha-mcp.git
cd memory-alpha-mcp
npm install
npm run build # Compile TypeScript
npm run dev # Run with tsx (hot reload)
npm test # Run test suite (146 tests)Testing
The project includes 146 unit tests across 17 test files using vitest:
Test File | Coverage |
| Text utilities: truncation, HTML stripping, wikitext cleaning, template stripping, key formatting, table cell escaping |
| TTL cache: get/set, expiry, LRU eviction |
| Sidebar/infobox extraction: typed templates, nested templates, multi-word types |
| Section extraction, intro extraction, heading listing |
| Fisher-Yates shuffle: correctness, element preservation, distribution |
| Rate limiter: request serialization, interval enforcement |
| Season table parsing: episode extraction, title cleanup, deduplication, padding, and non-episode link filtering |
| Rules of Acquisition regex patterns: all format variants, deduplication, sorting |
| Stardate converter: date-to-stardate, stardate-to-date, TOS/TNG era formulas |
| Battle simulator: combat scoring, narrative generation, ship data parsing |
| Away team builder: role analysis, team selection, mission risk assessment |
| Holodeck program: designation generation, classification, malfunction probability, safety assessment |
| Wikitext parser: disambiguation detection, false-positive protection, and normalized link extraction |
| Red shirt survival: capped risk analysis, boundary testing |
| Prime Directive: capped violation score, boundary testing |
| Trivia answer checking: exact match, letter match, fuzzy match |
| Quote extraction: matched pair validation, artifact rejection |
MCP Inspector
Test tools interactively:
npx @modelcontextprotocol/inspector node dist/index.jsAttribution & Licensing
This project (MIT)
The server code itself is licensed under the MIT License.
Memory Alpha content (CC-BY-SA)
All Star Trek content is dynamically fetched at runtime from Memory Alpha's public MediaWiki API. Memory Alpha content is licensed under CC-BY-SA 3.0.
How attribution works:
Every tool response that includes Memory Alpha content automatically appends an attribution footer via
withAttribution()insrc/utils/attribution.tsThe footer reads: "Source: Memory Alpha (CC-BY-SA) | Unofficial fan project - not affiliated with CBS/Paramount"
Error responses that contain no Memory Alpha content do not include the footer
The seven static resources (
trek://series,trek://glossary,trek://technobabble,trek://starship-classes,trek://factions,trek://prime-directive-cases, andtrek://technology-index) contain original reference descriptions, not Memory Alpha contentNo copyrighted material is embedded in the source code or package -- all wiki content is fetched live from the API and attributed at the point of display
This approach satisfies CC-BY-SA requirements by providing attribution with every piece of content served, linking to the source, and identifying the license. The project acts as an API client, not a content host.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SandboxServers/Memory-Alpha-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server