Swapi Mcp

io.github.abhishekjkrsna由 GitHub 账号 abhishekjkrsna 发布v1.0.4更新于 Oct 24, 2026

MCP server for SWAPI API

发布方自己的服务:Star Wars API & MCP server (swapi.build)

概览

AI 生成的概览

一个本地 MCP 服务器,暴露星球大战 API(SWAPI)数据,让助手列出数据类别并查询角色信息。

可以做什么
以逗号分隔列表的形式列出 SWAPI 中可用的星球大战信息类别,例如人物、星球、电影、物种、载具和星舰。通过项目的角色工具获取星球大战角色信息。数据经 stdio 传输从公开的星球大战 API 获取。
适用场景
适合让助手回答星球大战角色相关问题,或了解 SWAPI 有哪些数据类别,用于演示、测试或日常探索,而非生产级数据工作。
运行要求
以 npm 包形式通过 stdio 在本地运行。需要 Node.js 20 或更高版本及 npm;README 中的客户端配置通过项目目录下的 npm start 启动。需要能访问星球大战 API 的网络。未声明认证、环境变量或请求头。
安装前请注意
仅记录了两个工具,角色工具的具体输出未说明。数据来自第三方公开的星球大战 API,可用性和准确性取决于该服务。README 的客户端配置假定已在本地克隆仓库并安装依赖。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Swapi Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

SWAPI MCP

A TypeScript-based Model Context Protocol (MCP) server that exposes Star Wars API data as MCP tools.

This project connects to the Star Wars API (SWAPI) and makes selected Star Wars information available through MCP-compatible clients using stdio transport.

Features

  • MCP server built with TypeScript
  • stdio-based MCP transport
  • Fetches Star Wars data from SWAPI
  • Tool schema validation with Zod
  • Includes Vitest test setup
  • Supports coverage reports

Tech Stack

  • TypeScript
  • Node.js
  • Model Context Protocol SDK
  • Zod
  • Vitest
  • tsx

Project Structure

text swapi-mcp/ ├── src/ # Source code ├── tests/ # Test files and mock data │ ├── api/ │ └── mock_data/ ├── package.json ├── package-lock.json ├── tsconfig.json └── vitest.config.js

Requirements

  • Node.js 20 or newer
  • npm

Some MCP-related dependencies require Node.js 20+, so using the latest LTS version is recommended.

Installation

npm install

Clone the repository and install dependencies:

Available Scripts

Start the development server

npm run start

Runs the MCP server directly from TypeScript using tsx.

Build the project

npm run build

Compiles TypeScript into JavaScript using the TypeScript compiler.

Run tests

npm run test

When started, the server connects using stdio and can be used by MCP-compatible clients.

Available Tools

get-list-of-star-wars-information

Returns a comma-separated list of available Star Wars information categories from SWAPI, such as:

  • people
  • planets
  • films
  • species
  • vehicles
  • starships

get-information-of-star-wars-characters

Returns Star Wars character information exposed by the project’s character tool.

Example MCP Client Configuration

You can configure an MCP-compatible client to run this server with npm:

json
{ "mcpServers": { "swapi-mcp": { "command": "npm", "args": ["start"] } } }

If your client requires an absolute working directory, configure it like this:

json
{ "mcpServers": { "swapi-mcp": { "command": "npm", "args": ["start"], "cwd": "/absolute/path/to/swapi-mcp" } } }

来源:README.md,提交 57eae25

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.4最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Swapi 集成