Setting Up SUNRA MCP Server
The SUNRA Model Context Protocol (MCP) server provides seamless integration with popular development environments, allowing you to access SUNRA’s AI models directly from your editor or IDE. This guide will walk you through setting up the MCP server with various tools.What is MCP?
Model Context Protocol (MCP) is a standardized way for AI assistants to securely access external resources and tools. The SUNRA MCP server allows you to:- List and search AI models available on SUNRA
- Submit requests to any model endpoint
- Check status and retrieve results from the queue system
- Upload files and manage model schemas
- Manage API authentication seamlessly
Prerequisites
Before setting up the MCP server, ensure you have:- Node.js installed (version 18 or higher)
- SUNRA API key from your dashboard
- Your preferred editor/IDE installed
Installation
The SUNRA MCP server is available as an npm package:Configuration by Editor
Cursor
Cursor supports MCP through its configuration file. Create or update.cursor/mcp.json in your project root:
- Open Cursor Settings
- Navigate to “MCP Servers”
- Add a new server with:
- Name:
sunra-mcp-server - Command:
npx - Args:
@sunra/mcp-server
- Name:
VS Code
For VS Code with MCP support (requires compatible extension): Create.vscode/mcp.json:
Cline
Cline supports MCP servers through its settings. Add to your Cline configuration:Windsurf
For Windsurf IDE, configure MCP in the workspace settings:Claude Desktop
Add to your Claude Desktop configuration file: macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Other MCP-Compatible Tools
For any other tool that supports MCP, use this general configuration pattern:Environment Setup
Setting Your API Key
You can configure your SUNRA API key in several ways:Option 1: Environment Variable (Recommended)
Option 2: Configuration File
Some editors allow you to set environment variables directly in the MCP configuration:Option 3: Runtime Configuration
The MCP server also supports setting the API key at runtime using theset-sunra-key tool.
Available MCP Tools
Once configured, you’ll have access to these tools through your AI assistant:Model Management
list-models- Browse all available AI modelssearch-models- Find models by keywordsmodel-schema- Get input/output schemas for specific models
Request Management
submit- Submit requests to model endpointsstatus- Check request status and logsresult- Retrieve completed resultscancel- Cancel running requestssubscribe- Submit and wait for completion
File Management
upload- Upload files to SUNRA storage
Usage Examples
Listing Available Models
Generating an Image
Checking Request Status
Troubleshooting
Common Issues
MCP Server Not Found- Ensure Node.js is installed and accessible
- Try installing globally:
npm install -g @sunra/mcp-server - Verify the command path is correct
- Check that your SUNRA_KEY environment variable is set
- Verify your API key is valid at SUNRA Dashboard
- Try setting the key using the
set-sunra-keytool
- Increase timeout values in your configuration
- Check your internet connection
- Verify SUNRA API status
- Ensure proper file permissions for configuration files
- Try running with appropriate user permissions
Getting Help
If you encounter issues:- Check the SUNRA Documentation
- Review your editor’s MCP documentation
- Raise an issue on GitHub
Next Steps
Once your MCP server is configured:- Explore Models: Use
list-modelsto see all available AI capabilities - Try Examples: Start with simple text-to-image or text-to-video generations
- Build Workflows: Combine multiple models for complex AI pipelines
- Monitor Usage: Track your API usage in the SUNRA Dashboard