🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@abhishekjkrsna/swapi-mcp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abhishekjkrsna/swapi-mcp

MCP server for SWAPI API

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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:

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

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

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

FAQs

Package last updated on 27 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts