Install
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
Windows / Linux path
%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
Restart Claude Desktop to activate the new server.
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
Windows / Linux path
.cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global).cursor/mcp.json (project) or ~/.cursor/mcp.json (global){
"mcpServers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
Cursor usually picks up config changes automatically; if the server does not appear, reload the window.
Add to .mcp.json (project) or ~/.claude.json (global)
Windows / Linux path
.mcp.json (project) or %USERPROFILE%\.claude.json (global).mcp.json (project) or ~/.claude.json (global){
"mcpServers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
The server will be available in the next Claude Code session.
Add to .vscode/mcp.json
Windows / Linux path
.vscode\mcp.json.vscode/mcp.json{
"servers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
Reload the VS Code window to activate.
Add to ~/.codeium/windsurf/mcp_config.json
Windows / Linux path
%USERPROFILE%\.codeium\windsurf\mcp_config.json~/.codeium/windsurf/mcp_config.json{
"mcpServers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
Restart Windsurf (or refresh its MCP servers panel) to activate the new server.
Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.
Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows / Linux path
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json{
"mcpServers": {
"io-github-magicsword-io-magicsword-mcp": {
"command": "npx",
"args": [
"-y",
"@magicsword-io/magicsword-mcp"
],
"env": {
"MAGICSWORD_API_KEY": "<YOUR_VALUE>",
"MAGICSWORD_CONFIG": "<VALUE>",
"MAGICSWORD_BASE_URL": "<VALUE>",
"MAGICSWORD_GET_RETRIES": "<VALUE>",
"MAGICSWORD_REQUEST_TIMEOUT_MS": "<VALUE>",
"MAGICSWORD_RESPONSE_MAX_BYTES": "<VALUE>"
}
}
}
}
Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.
Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.
Configuration
Environment variables this server reads. Secrets stay on your machine.
| Name | Required | Description |
|---|---|---|
| MAGICSWORD_API_KEY secret | Yes | MagicSword API key (format: msk_...). Mint one in Magic Portal → Settings → API Keys. Can be set as a per-client override instead of using ~/.magicsword/mcp.json. This is the primary secret required to authenticate with the MagicSword API. |
| MAGICSWORD_CONFIG | No | Path to the MagicSword config file. Defaults to ~/.magicsword/mcp.json. This file stores the API key and base URL when not using environment variables. |
| MAGICSWORD_BASE_URL | No | Portal base URL. Defaults to https://www.magicsword.io. Remote URLs must use HTTPS; plain HTTP is accepted only for localhost development. Configured URLs cannot contain credentials, paths, query strings, or fragments. |
| MAGICSWORD_GET_RETRIES | No | Number of retries for idempotent GET requests. Default 2, maximum 3. Write actions are never retried automatically. |
| MAGICSWORD_REQUEST_TIMEOUT_MS | No | Request timeout in milliseconds. Default 30000 (30 seconds). |
| MAGICSWORD_RESPONSE_MAX_BYTES | No | Maximum response size in bytes. Default 4194304 (4 MiB). |