swapi-build

swapi-build

MCP server that provides access to Star Wars data (people, films, planets, species, starships, vehicles) through tools like list, get, random, and search.

Category
访问服务器

README

SWAPI.build

A free, open-source Star Wars API serving data about People, Films, Planets, Species, Starships, and Vehicles. Built with Quarkus and GraalVM for instant startup, minimal memory footprint, and out-of-the-box performance.

Inspired by the original SWAPI (created by Paul Hallett, maintained by Juriy Bura), this project was born out of the need for a Star Wars API that never goes offline. If you've ever had a live demo break because a third-party API went down, you know why this exists.

Quick Start

Prerequisites: Java 25 and Maven (or use the included Maven Wrapper).

cd swapi-app
./mvnw quarkus:dev

The API and frontend will be available at http://localhost:5432.

API Endpoints

Base path: /api

Resource List All By ID Random Search
People GET /api/people GET /api/people/:id GET /api/people/random GET /api/people?search=name
Films GET /api/films GET /api/films/:id GET /api/films/random GET /api/films?search=title
Planets GET /api/planets GET /api/planets/:id GET /api/planets/random GET /api/planets?search=name
Species GET /api/species GET /api/species/:id GET /api/species/random GET /api/species?search=name
Starships GET /api/starships GET /api/starships/:id GET /api/starships/random GET /api/starships?search=name
Vehicles GET /api/vehicles GET /api/vehicles/:id GET /api/vehicles/random GET /api/vehicles?search=name

Ids are the record ids from each entity's url field (for films, 1 = A New Hope). Successful responses return 200; unknown or non-numeric ids return 404.

All responses are JSON. Example:

curl http://localhost:5432/api/people/1

OpenAPI

The full API contract is served at /openapi.json (OpenAPI 3.x, generated from the code — always in sync). The documentation page renders from it, including a "try it" for every endpoint. Generate a client with, e.g.:

npx @openapitools/openapi-generator-cli generate -i https://swapi.build/openapi.json -g typescript-fetch

MCP Server

swapi.build is also a remote MCP server over Streamable HTTP. Any Streamable HTTP client works: the stateless 2026-07-28 revision sends self-contained requests, and earlier revisions negotiate a session through initialize — both are served on the same endpoint. The legacy HTTP+SSE transport (2024-11-05) is not supported. First-party, read-only, no authentication:

https://swapi.build/mcp

Full setup guides: swapi.build/docs/mcp

Tool Arguments Returns
sw_list resource All entities of a resource
sw_get resource, id One entity by id
sw_random resource A random entity
sw_search resource, query Name/title substring match

resource is one of PEOPLE, FILMS, PLANETS, SPECIES, STARSHIPS, VEHICLES. Ids are the record ids from each entity's url field (for FILMS, 1 = A New Hope).

<details> <summary><strong>Claude Code</strong></summary>

claude mcp add --transport http swapi-build https://swapi.build/mcp

Or share via .mcp.json at the repo root:

{
  "mcpServers": {
    "swapi-build": { "type": "http", "url": "https://swapi.build/mcp" }
  }
}

Verify: claude mcp listswapi-build ✔ Connected. </details>

<details> <summary><strong>Claude Desktop & claude.ai</strong></summary>

Settings → Connectors → Add custom connector → name swapi-build, URL https://swapi.build/mcp. No authentication needed. Verify in any chat via the + menu → Connectors. </details>

<details> <summary><strong>OpenAI Codex</strong></summary>

codex mcp add swapi-build --url https://swapi.build/mcp

Or in ~/.codex/config.toml (shared by CLI, IDE extension and ChatGPT desktop):

[mcp_servers.swapi-build]
url = "https://swapi.build/mcp"

Verify: codex mcp list. </details>

<details> <summary><strong>GitHub Copilot (VS Code)</strong></summary>

.vscode/mcp.json (top-level key is servers):

{
  "servers": {
    "swapi-build": { "type": "http", "url": "https://swapi.build/mcp" }
  }
}

Or Command Palette → MCP: Add Server. Verify via the Configure Tools button in Copilot Chat. On Business/Enterprise, the "MCP servers in Copilot" org policy must be enabled. </details>

<details> <summary><strong>IBM Bob</strong></summary>

~/.bob/settings/mcp_settings.json (global) or .bob/mcp.json (project):

{
  "mcpServers": {
    "swapi-build": {
      "type": "streamable-http",
      "url": "https://swapi.build/mcp",
      "disabled": false
    }
  }
}

Or Bob panel → MCP tab → Edit Global MCP. Bob detects the tools automatically. </details>

The server scales to zero when idle — if the very first connection attempt fails, retry once (the native binary starts in tens of milliseconds; the platform may take a bit longer to provision the container; subsequent calls are fast, whether your client is stateless or session-based).

Client examples

Project Structure

swapi-app/
  Dockerfile.vercel           # Native container image used by Vercel deploys
  src/main/
    java/com/eldermoraes/     # Backend (Quarkus + Jakarta REST)
      film/                   # Film model, service, resource
      people/                 # People model, service, resource
      planet/                 # Planet model, service, resource
      specie/                 # Specie model, service, resource
      starship/               # Starship model, service, resource
      vehicle/                # Vehicle model, service, resource
      mcp/                    # MCP server tools (sw_list, sw_get, sw_random, sw_search)
      SWObject.java           # Base model class
      SWService.java          # Service interface
      ApiResource.java        # Root /api endpoint
      ApplicationPath.java    # Jakarta REST base path (/api)
    resources/
      data/                   # Static JSON data files
      application.properties  # Quarkus configuration
    webui/                    # Frontend (TypeScript + Vite)
      src/
        api.ts                # API client with request management
        main.ts               # SPA router
        pages/                # Page renderers (home, resource, docs, mcp, about, privacy, terms)
        json-highlight.ts     # JSON syntax highlighting for result panels
        style.css             # Site styles
        types.ts              # TypeScript interfaces for API resources
        constants.ts          # Shared resource metadata
        utils.ts              # Shared utilities (escapeHtml)
  src/test/
    java/com/eldermoraes/     # Regression suite (REST contracts, MCP tools, forwarded headers)

Each backend domain (film, people, planet, etc.) follows the same pattern:

  • Model (e.g., Film.java): POJO with @RegisterForReflection for native image support
  • Service (e.g., FilmService.java): loads data from JSON at startup, caches in memory
  • Resource (e.g., FilmResource.java): Jakarta REST controller with @RunOnVirtualThread

Build

cd swapi-app

# Development mode (live reload)
./mvnw quarkus:dev

# Production JAR
./mvnw package
java -jar target/quarkus-app/quarkus-run.jar

# Native executable (requires GraalVM or container build)
./mvnw package -Dnative
./mvnw package -Dnative -Dquarkus.native.container-build=true

The frontend is automatically built and bundled by Quinoa during the Maven build. No separate npm step is needed.

Deployment

The app runs on Vercel as a native (GraalVM/Mandrel) container image, built from swapi-app/Dockerfile.vercel. DNS is managed on Cloudflare (DNS-only records pointing to Vercel). Deploys are done with npx vercel deploy --prod from the swapi-app/ directory.

Tech Stack

  • Runtime: Quarkus 3.33 on Java 25 with Virtual Threads
  • MCP server: Quarkiverse MCP Server — Streamable HTTP, stateless and session-based clients
  • Serialization: Jakarta REST + JSON-B
  • Native image: GraalVM via Mandrel builder
  • Frontend: TypeScript + Vite, served by Quinoa

Contributing

Pull requests are always welcome. Whether it's fixing a bug, improving the docs, or adding new features, jump in and help make the best Star Wars API in the galaxy even better.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-change)
  3. Make your changes (with tests) and run the suite: cd swapi-app && ./mvnw test
  4. Commit and push
  5. Open a Pull Request

Changelog and releases

Release history lives in CHANGELOG.md. Tagged releases are on the Releases page. The version served in /openapi.json (info.version) is always the latest released version. The release process itself is documented in docs/RELEASE.md.

Credits

  • Original SWAPI by Paul Hallett, maintained by Juriy Bura
  • Star Wars data from community-driven sources such as Wookieepedia
  • All Star Wars content and imagery are property of Lucasfilm Ltd. and Disney. This project is not affiliated with or endorsed by Lucasfilm or Disney.

License

Licensed under the Apache License 2.0. The website also publishes a Privacy Policy and Terms of Use.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选