MCP server for SWAPI API
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.
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
Some MCP-related dependencies require Node.js 20+, so using the latest LTS version is recommended.
npm install
Clone the repository and install dependencies:
npm run start
Runs the MCP server directly from TypeScript using tsx.
npm run build
Compiles TypeScript into JavaScript using the TypeScript compiler.
npm run test
When started, the server connects using stdio and can be used by MCP-compatible clients.
get-list-of-star-wars-informationReturns a comma-separated list of available Star Wars information categories from SWAPI, such as:
get-information-of-star-wars-charactersReturns Star Wars character information exposed by the project’s character tool.
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" } } }
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @abhishekjkrsna/swapi-mcpMerge 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.
{
"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@abhishekjkrsna/swapi-mcpnpmio.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.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..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.