The Swiper MCP (Model Context Protocol) Server provides programmatic access to Swiper's API documentation, demos, and code examples. It enables AI assistants and development tools to search, retrieve, and understand Swiper's API through a standardized JSON-RPC 2.0 interface.
https://swiperjs.com/mcpThe Swiper MCP server provides 7 tools for interacting with Swiper documentation:
search-apiSearch Swiper API documentation for options, methods, or events.
Parameters:
query (string, required): Search query stringtype (string, optional): Filter by type - "option", "method", "event", or "all" (default)Example:
{
"name": "search-api",
"arguments": {
"query": "navigation",
"type": "option"
}
}
Returns: Array of matching API items with descriptions, types, and categories.
get-optionGet detailed information about a specific Swiper option by name.
Parameters:
name (string, required): The name of the option (e.g., "slidesPerView", "spaceBetween")Example:
{
"name": "get-option",
"arguments": {
"name": "slidesPerView"
}
}
Returns: Option details including type, default value, description, and full type information.
get-methodGet detailed information about a specific Swiper method by name.
Parameters:
name (string, required): The name of the method (e.g., "slideNext", "update", "destroy")Example:
{
"name": "get-method",
"arguments": {
"name": "slideNext"
}
}
Returns: Method details including signature, parameters, return type, and description.
get-eventGet detailed information about a specific Swiper event by name.
Parameters:
name (string, required): The name of the event (e.g., "slideChange", "init", "transitionStart")Example:
{
"name": "get-event",
"arguments": {
"name": "slideChange"
}
}
Returns: Event details including parameters, description, and usage information.
get-module-optionsGet all options, methods, and events for a specific Swiper module.
Parameters:
module (string, required): The module name (e.g., "navigation", "pagination", "autoplay"). Case-insensitive.Example:
{
"name": "get-module-options",
"arguments": {
"module": "navigation"
}
}
Returns: Complete module documentation including:
options: All configuration options for the modulemethods: All available methods for the moduleevents: All events emitted by the modulelist-demosList all available Swiper demos with their metadata.
Parameters: None
Example:
{
"name": "list-demos",
"arguments": {}
}
Returns: Array of demo objects containing:
slug: Demo identifier (e.g., "navigation", "pagination")title: Human-readable demo namefolder: Demo folder nameframeworks: Array of available framework variants (e.g., ["core", "element", "react", "vue"])get-demoGet complete demo code for a specific Swiper demo in your preferred framework.
Parameters:
slug (string, required): The demo slug (e.g., "default", "navigation", "pagination")framework (string, required): The framework variant - "core", "element", "react", "vue", etc.Example:
{
"name": "get-demo",
"arguments": {
"slug": "navigation",
"framework": "react"
}
}
Returns: Object with file paths as keys and file content as values. For example:
{
"src/App.jsx": {
"content": "import React from 'react';\n..."
},
"src/styles.css": {
"content": ".swiper { ... }"
}
}
.cursor/mcp.json in your project or global Cursor config){
"mcpServers": {
"swiper": {
"url": "https://swiperjs.com/mcp"
}
}
}
Claude Code uses the command-line interface to add MCP servers. HTTP transport is recommended for remote servers like Swiper.
Add the Swiper MCP server:
claude mcp add --transport http swiper https://swiperjs.com/mcp
Verify the server was added:
claude mcp list
Get server details:
claude mcp get swiper
Check server status in Claude Code:
Within Claude Code, use the /mcp command to see all connected MCP servers and their status.
Scopes:
You can specify where the configuration is stored using the --scope flag:
local (default): Available only to you in the current projectproject: Shared with everyone via .mcp.json file in project rootuser: Available to you across all projectsExample with project scope:
claude mcp add --transport http swiper --scope project https://swiperjs.com/mcp
Remove a server:
claude mcp remove swiper
You can now ask Claude Code about Swiper API documentation, and it will use the MCP tools automatically.
VS Code has built-in support for MCP servers starting from version 1.102. You can add MCP servers to your workspace or user configuration.
Add to Workspace (Recommended for team projects):
.vscode/mcp.json file in your workspace root{
"servers": {
"swiper": {
"type": "http",
"url": "https://swiperjs.com/mcp"
}
}
}
Add to User Configuration (Available across all projects):
swiperhttps://swiperjs.com/mcpAlternatively, you can run MCP: Open User Configuration and manually add the configuration.
Add from Extensions View:
@mcp or run the MCP: Browse Servers commandUsing the Tools:
Once configured, you can use Swiper MCP tools in the Chat view:
# followed by the tool nameFor more information, see the VS Code MCP documentation.
Codex supports MCP servers through both the Codex CLI and Codex IDE extension. Configuration is shared between both.
Add using CLI (Recommended):
codex mcp add swiper --url https://swiperjs.com/mcp
Add by editing config.toml:
~/.codex/config.tomlMCP settings > Open config.toml[mcp_servers.swiper]
url = "https://swiperjs.com/mcp"
Verify the server:
In the Codex TUI (Terminal UI), use /mcp to see your actively connected MCP servers.
Advanced Configuration:
You can customize timeouts and other settings:
[mcp_servers.swiper]
url = "https://swiperjs.com/mcp"
startup_timeout_sec = 10
tool_timeout_sec = 60
enabled = true
Disable/Enable:
To temporarily disable a server without removing it:
[mcp_servers.swiper]
url = "https://swiperjs.com/mcp"
enabled = false
For more information, see the Codex MCP documentation.
OpenCode supports both local and remote MCP servers. The Swiper MCP server is a remote HTTP server.
Add to your OpenCode configuration:
opencode.jsonc or opencode.json configuration filemcp section:{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"swiper": {
"type": "remote",
"url": "https://swiperjs.com/mcp",
"enabled": true
}
}
}
Disable temporarily:
Set enabled to false to temporarily disable without removing the configuration:
{
"mcp": {
"swiper": {
"type": "remote",
"url": "https://swiperjs.com/mcp",
"enabled": false
}
}
}
Manage MCP servers:
tools section: "swiper": false"swiper": true in the agent's tools configurationFor more information, see the OpenCode MCP documentation.
Ask your AI assistant:
"What are the available options for Swiper navigation?"
The assistant will use the get-module-options tool with module: "navigation" and return all navigation-related options, methods, and events.
Ask your AI assistant:
"Show me the React code for a Swiper navigation demo"
The assistant will:
list-demos to find demosget-demo with slug: "navigation" and framework: "react"Ask your AI assistant:
"What does the slidesPerView option do?"
The assistant will use get-option with name: "slidesPerView" and return detailed documentation including:
Ask your AI assistant:
"How do I programmatically go to the next slide?"
The assistant will use get-method with name: "slideNext" and return the method signature, parameters, and usage instructions.
The following Swiper modules are fully documented and accessible via the MCP server:
Each module can be queried using the get-module-options tool.
All tools return responses in the MCP Tool Call Result format:
{
content: Array<{
type: 'text';
text: string; // JSON string containing the actual data
}>;
isError?: boolean; // Present if an error occurred
}
The text field contains a JSON string that, when parsed, contains the actual response data or error information.
The MCP server uses standard JSON-RPC 2.0 error codes:
-32700: Parse error - Invalid JSON-32600: Invalid Request - Request structure is invalid-32601: Method not found - Unknown method requested-32602: Invalid params - Parameters are missing or invalid-32603: Internal error - Server-side error occurredError responses include helpful messages indicating what went wrong and, when applicable, suggestions for fixing the issue.
Currently, the Swiper MCP server is publicly accessible without authentication and has no rate limits. However, please use responsibly. If you need higher rate limits or have specific requirements, please contact the Swiper team.
The MCP server implementation is part of the Swiper website repository. To contribute improvements or report issues: