Back to Directory/Developer Tools

io.github.abhishekjkrsna/swapi-mcp

MCP server for SWAPI API

Developer ToolsHTMLv1.0.4

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" } } }

Installation

Source-derived launch command. Check the maintainer’s required arguments and credentials before running:

bash
npx -y @abhishekjkrsna/swapi-mcp

Set up in your AI client

Merge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.

json
{
  "mcpServers": {
    "io-github-abhishekjkrsna-swapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@abhishekjkrsna/swapi-mcp"
      ]
    }
  }
}

Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.

Claude Desktop setup reference

Package

@abhishekjkrsna/swapi-mcpnpm

Compatible MCP Clients

io.github.abhishekjkrsna/swapi-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.

  • Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.
  • Cursor~/.cursor/mcp.jsonRestart Cursor for changes to take effect.
  • VS Code.vscode/mcp.jsonReload VS Code window for changes to take effect.
  • Windsurf~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect.
  • Claude Code.mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.

Learn More