MCP Connector

Access Star Wars Data via MCP

An MCP server for the SWAPI Star Wars API - characters, planets, films, species, vehicles, and starships with caching.

Works with githubnpmvscode

90
Spark score
out of 100
Updated 5 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Integrate with the Star Wars API (SWAPI) using an MCP server. Access characters, planets, films, and more with built-in caching and pagination for efficient data retrieval.

Outcomes

What it gets done

01

Retrieve lists of Star Wars characters, planets, films, species, vehicles, and starships.

02

Get detailed information for specific Star Wars entities by their ID.

03

Utilize automatic pagination for seamless data fetching across all available resources.

04

Manage and clear the internal cache for optimized performance.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-star-wars | bash

Capabilities

Tools your agent gets

get_people

List of Star Wars characters with automatic pagination and optional search

get_person_by_id

Get detailed information about a specific Star Wars character by ID

get_planets

List of Star Wars planets with automatic pagination and optional search

get_planet_by_id

Get detailed information about a specific Star Wars planet by ID

get_films

List of Star Wars films with automatic pagination and optional search

get_film_by_id

Get detailed information about a specific Star Wars film by ID

get_species_list

List of Star Wars species with automatic pagination and optional search

get_species_by_id

Get detailed information about a specific Star Wars species by ID

+6 tools

Overview

Star Wars MCP Server

This MCP server exposes 14 tools for the SWAPI Star Wars API: paginated/searchable listing and get-by-ID detail for six categories, plus cache management tools. Use it when an AI assistant needs to look up Star Wars characters, planets, films, species, vehicles, or starships. Requires Node.js 20+.

What it does

An MCP server for the SWAPI Star Wars API, demonstrating how an MCP server can wrap a REST API with built-in caching and pagination. It exposes 14 tools: get_people, get_planets, get_films, get_species_list, get_vehicles, and get_starships each list their category with automatic pagination and optional search; get_person_by_id, get_planet_by_id, get_film_by_id, get_species_by_id, get_vehicle_by_id, and get_starship_by_id each retrieve one record's full detail by ID; and clear_cache and get_cache_stats manage and report on the server's internal API response cache. Automatic pagination means a single tool call retrieves all pages of a listing rather than requiring the caller to page through results manually, and caching means repeated lookups avoid re-hitting the upstream SWAPI API.

When to use - and when NOT to

Use it when an AI assistant needs to look up Star Wars characters, planets, films, species, vehicles, or starships - listing with search, or fetching one record's full detail by ID. It also serves as a reference example for how to structure an MCP server around a REST API with pagination and caching baked in. It requires Node.js 20 or higher; all data is sourced from the public SWAPI documentation.

Capabilities

The naming follows a get_<category>/get_<category>_by_id shape, but it is not fully regular across all six categories. Planets, films, vehicles, and starships follow the pattern cleanly (get_planets/get_planet_by_id, get_films/get_film_by_id, get_vehicles/get_vehicle_by_id, get_starships/get_starship_by_id). Two categories break it: get_people/get_person_by_id uses an irregular singular ("person," not "people" minus a suffix), and species is named get_species_list rather than get_species since the category name is already plural - both worth checking for when writing code against this server rather than assuming the pattern holds everywhere.

How to install

npx -y @johnpapa/mcp-starwars

A dedicated VS Code MCP JSON configuration format is also documented, listing the server under a servers block with an empty inputs array. Or install via Smithery CLI (npx -y @smithery/cli install @johnpapa/mcp-starwars --client claude), directly into VS Code with code --add-mcp, or from source (clone, npm install, npm run build, then test with the MCP Inspector). A VS Code settings.json entry looks like:

"mcp": {
  "servers": {
    "starwars": { "command": "npx", "args": ["-y", "@johnpapa/mcp-starwars"], "env": {} }
  }
},
"chat.mcp.discovery.enabled": true

Who it's for

Developers who want Star Wars reference data (characters, planets, films, species, vehicles, starships) available conversationally in an AI assistant, or who want a working reference implementation of pagination and caching patterns for wrapping a public REST API as an MCP server. Distributed under the MIT License, with installation badges documented for both VS Code and VS Code Insiders, covering both NPM-based and Docker-based install paths for editor integration.

Source README

MCP server for the SWAPI Star Wars API that demonstrates how an MCP server can interact with an API, providing access to Star Wars characters, planets, films, species, vehicles, and starships with built-in caching and pagination.

Installation

NPX

npx -y @johnpapa/mcp-starwars

Smithery CLI

npx -y @smithery/cli install @johnpapa/mcp-starwars --client claude

VS Code Command Line

code --add-mcp '{"name":"starwars","command":"npx","args":["-y","@johnpapa/mcp-starwars"],"env":{}}'

From Source Code

git clone https://github.com/johnpapa/-mcp-starwars
npm install
npm run build
npx @modelcontextprotocol/inspector node build/index.js

Configuration

VS Code Settings JSON

"mcp": {
  "servers": {
    "starwars": {
      "command": "npx",
      "args": ["-y", "@johnpapa/mcp-starwars"],
      "env": {}
    }
  }
},
"chat.mcp.discovery.enabled": true

VS Code MCP JSON

{
  "inputs": [],
  "servers": {
    "mcp-starwars": {
      "command": "npx",
      "args": [
        "-y",
        "@johnpapa/mcp-starwars"
      ],
      "env": {}
    }
  }
}

Available Tools

Tool Description
get_people List of Star Wars characters with automatic pagination and optional search
get_person_by_id Get detailed information about a specific Star Wars character by ID
get_planets List of Star Wars planets with automatic pagination and optional search
get_planet_by_id Get detailed information about a specific Star Wars planet by ID
get_films List of Star Wars films with automatic pagination and optional search
get_film_by_id Get detailed information about a specific Star Wars film by ID
get_species_list List of Star Wars species with automatic pagination and optional search
get_species_by_id Get detailed information about a specific Star Wars species by ID
get_vehicles List of Star Wars vehicles with automatic pagination and optional search
get_vehicle_by_id Get detailed information about a specific Star Wars vehicle by ID
get_starships List of Star Wars starships with automatic pagination and optional search
get_starship_by_id Get detailed information about a specific Star Wars starship by ID
clear_cache Clear the Star Wars API cache (partially or completely)
get_cache_stats Get statistics on Star Wars API cache usage

Features

  • List of Star Wars characters with optional search filters and automatic pagination
  • List of planets, films, species, vehicles, and starships with search capabilities
  • Get detailed information by ID for specific characters, planets, films, species, vehicles, or starships
  • Automatic pagination for seamless retrieval of all data pages in a single API call
  • Built-in caching for performance optimization with intelligent API response caching
  • Cache management to clear the cache and view cache statistics

Notes

All data used by this MCP server is sourced from SWAPI documentation. The server requires Node.js >=20 and is licensed under MIT. Installation badges are available for VS Code and VS Code Insiders with both NPM and Docker options.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.