tray-mcp-server
v1.1.3
Published
A Model Context Protocol (MCP) server that provides tools to interact with Tray.io's integration platform API, including comprehensive workflow migration capabilities
Maintainers
Readme
Tray MCP Server
A Model Context Protocol (MCP) server that provides tools to interact with Tray.io's integration platform API. This server enables AI assistants to manage connectors, triggers, authentications, workspaces, and subscriptions through Tray's comprehensive API.
Features
The Tray MCP Server provides comprehensive tools covering all major Tray API endpoints, including advanced workflow migration capabilities:
🔌 Connector Management
- list-connectors: Browse Tray's extensive connector library with pagination support
- get-connector-operations: Get detailed operation information for specific connectors with pagination
- call-connector: Execute connector operations with custom inputs
⚡ Trigger Management
- list-triggers: Discover available triggers for real-time integrations with pagination support
- create-subscription: Set up webhook subscriptions for trigger events
- get-subscriptions: View and manage existing subscriptions with pagination support
🔐 Authentication Management
- get-service-environments: Get service environments for authentication setup
- create-authentication: Create new service authentications
- delete-authentication: Remove unnecessary authentications
🏢 Workspace Management
- list-workspaces: Access and manage available workspaces with pagination support
🚀 NEW: Workflow Migration Tools
Complete workflow migration support for moving Tray workflows to custom applications:
- list-projects: List all projects in a workspace for migration analysis
- list-project-versions: View all versions of a project
- export-project-version: Export complete project with all workflow details and dependencies
- get-project-import-requirements: Analyze import requirements and dependencies
- preview-project-import: Preview import impact with workflow migration analysis
- analyze-workflow-dependencies: Deep analysis of workflow dependencies and nested calls
Migration Features:
- 📋 Complete Workflow Context: Extract full workflow definitions including steps, connections, and configurations
- 🔗 Nested Workflow Detection: Identify and map nested workflow calls and dependencies
- 🔑 Authentication Mapping: Track authentication requirements across workflows
- 🔌 Connector Dependencies: Map all connector and service dependencies
- ⚙️ Configuration Analysis: Export and analyze project configurations
- 📊 Impact Assessment: Preview changes and breaking impacts before migration
- 🛠️ Migration Guidance: Get actionable recommendations for successful migration
🔄 Pagination Support
All list operations support cursor-based pagination:
- limit: Control the number of results returned (default varies by endpoint)
- cursor: Use the cursor from previous responses to get the next page
- Pagination info: Responses include next cursor, hasMore flag, and total count when available
🌍 Multi-Region Support
All tools support Tray's multi-region infrastructure:
- US (default):
api.tray.io - EU:
api.eu1.tray.io - APAC:
api.ap1.tray.io
Installation
As an NPM Package
npm install -g tray-mcp-serverFrom Source
git clone https://github.com/yourusername/tray-mcp-server.git
cd tray-mcp-server
npm install
npm run buildConfiguration
The Tray MCP Server provides multiple convenient ways to configure your API tokens:
🚀 Interactive Setup (Recommended)
Run the interactive setup wizard to configure your tokens:
tray-mcp-server --setupThis will:
- Guide you through token configuration with validation
- Support all three Tray regions (US, EU, APAC)
- Automatically save your configuration
- Provide usage instructions
📁 Configuration File
Tokens are automatically saved to:
- macOS/Linux:
~/.config/tray-mcp-server/config.json - Windows:
%APPDATA%/tray-mcp-server/config.json
Example configuration:
{
"masterToken": "your_master_token_here",
"userToken": "your_user_token_here",
"region": "us",
"workspaceId": "your_default_workspace_id"
}🌐 Environment Variables
You can also use environment variables:
export TRAY_MASTER_TOKEN="your_master_token"
export TRAY_USER_TOKEN="your_user_token"
export TRAY_REGION="us" # us, eu, or apac
export TRAY_WORKSPACE_ID="your_workspace_id"🔄 Configuration Priority
The server loads configuration in this order:
- Configuration file (
~/.config/tray-mcp-server/config.json) - Environment variables (fallback)
- If no tokens found, shows setup instructions
Using with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
⚠️ Important: Use npx to avoid "spawn ENOENT" errors:
{
"mcp": {
"servers": {
"tray-mcp-server": {
"command": "npx",
"args": ["tray-mcp-server"],
"env": {
"TRAY_TOKEN_US": "your-us-token-here"
}
}
}
}
}Multi-Region Configuration
{
"mcp": {
"servers": {
"tray-mcp-server": {
"command": "npx",
"args": ["tray-mcp-server"],
"env": {
"TRAY_TOKEN_US": "your-us-token-here",
"TRAY_TOKEN_EU": "your-eu-token-here",
"TRAY_TOKEN_APAC": "your-apac-token-here"
}
}
}
}
}Alternative: Global Installation
npm install -g tray-mcp-server
tray-mcp-server --setupThen use in Claude Desktop config:
{
"mcp": {
"servers": {
"tray-mcp-server": {
"command": "tray-mcp-server"
}
}
}
}Using with Other MCP Clients
The server can be started in stdio mode:
tray-mcp-serverAuthentication
To use the Tray MCP Server, you'll need a Tray API token. You can obtain tokens from your Tray.io account:
- Master Tokens: For administrative operations and connector browsing
- User Tokens: For end-user operations and authentication management
Visit the Tray API documentation for more information on authentication.
Usage Examples
Browse Available Connectors
List all available connectors from Tray's librarySet Up a Slack Integration
1. Get Slack connector operations for version 9.0
2. Get service environments for Slack
3. Create Slack authentication with your credentials
4. Call Slack operations using the authenticationCreate Real-time Webhooks
1. List available triggers
2. Create a subscription for webhook events
3. Monitor your subscriptionsTool Reference
list-connectors
Lists all available connectors from Tray's connector library with pagination support.
Parameters:
token(required): Tray API tokenlimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region (us, eu, apac)
get-connector-operations
Gets all available operations for a specific connector with pagination support.
Parameters:
token(required): Tray API tokenconnectorName(required): Name of the connectorconnectorVersion(required): Version of the connectorlimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region
call-connector
Executes a connector operation with specified inputs.
Parameters:
token(required): Tray API token (user token for end-user operations)connectorName(required): Name of the connectorconnectorVersion(required): Version of the connectoroperation(required): Name of the operation to executeauthId(required): Authentication ID for the connectorinput(required): Input parameters for the operationreturnOutputSchema(optional): Return output schema for dynamic operationsregion(optional): Tray region
list-triggers
Lists all available triggers from Tray's trigger library with pagination support.
Parameters:
token(required): Tray API tokenlimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region
get-service-environments
Gets service environments for authentication setup.
Parameters:
token(required): Tray API tokenserviceName(required): Name of the serviceserviceVersion(required): Version of the serviceregion(optional): Tray region
create-authentication
Creates a new authentication for a service.
Parameters:
token(required): Tray API token (user token for end-user auths)name(required): Name for the authenticationserviceEnvironmentId(required): Service environment IDuserData(optional): User data for the authenticationcredentials(required): Credentials for the authenticationscopes(optional): Scopes for OAuth servicesregion(optional): Tray region
list-workspaces
Lists all workspaces the token has access to with pagination support.
Parameters:
token(required): Tray API token with workspace accesslimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region
create-subscription
Creates a subscription for real-time trigger events.
Parameters:
token(required): Tray API token (user token for end-user subscriptions)triggerName(required): Name of the triggertriggerVersion(required): Version of the triggeroperation(required): Trigger operation nameauthenticationId(required): Authentication ID for the triggerendpoint(required): Your webhook endpoint URLname(required): Name for the subscriptioninput(required): Input parameters for the trigger operationexternalId(optional): External ID for the subscriptionregion(optional): Tray region
get-subscriptions
Lists all subscriptions with pagination support.
Parameters:
token(required): Tray API tokenlimit(optional): Limit the number of results (default: 10)cursor(optional): Cursor for paginationregion(optional): Tray region
delete-authentication
Deletes an authentication by ID.
Parameters:
token(required): Tray API tokenauthenticationId(required): ID of the authentication to deleteregion(optional): Tray region
Workflow Migration Tools
The Tray MCP Server now includes comprehensive workflow migration tools for extracting and analyzing complete workflow context. These tools are essential for migrating Tray workflows to custom Elixir, Python, or other applications.
list-projects
Lists all projects in a workspace for workflow migration analysis.
Parameters:
token(required): Tray API token with project accessworkspaceId(required): Workspace ID to list projects fromlimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region
list-project-versions
Lists all versions of a project for workflow migration analysis.
Parameters:
token(required): Tray API token with project accessprojectId(required): Project ID to list versions forlimit(optional): Limit the number of results (default: 50)cursor(optional): Cursor for paginationregion(optional): Tray region
export-project-version
Exports a complete project version with all workflow details and dependencies for migration.
Key Features:
- Complete workflow definitions with steps and connections
- Nested workflow detection and mapping
- Full dependency analysis (connectors, services, authentications)
- Configuration export
- Migration-ready data structure
Parameters:
token(required): Tray API token with project accessprojectId(required): Project ID to exportversionNumber(required): Version number to exportregion(optional): Tray region
Output Includes:
- Detailed workflow analysis with step-by-step breakdown
- Connector and trigger usage mapping
- Authentication requirements
- Nested workflow dependencies
- Configuration data
- Complete JSON export for custom processing
get-project-import-requirements
Analyzes import requirements and dependencies for migrating a project to a new environment.
Parameters:
token(required): Tray API token with project accessprojectId(required): Destination project ID for import analysisexportedProjectJson(required): Exported project JSON dataregion(optional): Tray region
Analysis Includes:
- Authentication mapping requirements
- Configuration differences
- Missing dependencies
- Migration action items
preview-project-import
Previews the impact of importing a project with comprehensive workflow migration analysis.
Parameters:
token(required): Tray API token with project accessprojectId(required): Destination project ID for import previewexportedProjectJson(required): Exported project JSON dataauthenticationResolution(optional): Authentication mapping for importconnectorMapping(optional): Connector mapping for importserviceMapping(optional): Service mapping for importconfigOverride(optional): Configuration overridesregion(optional): Tray region
Preview Analysis:
- Workflow change impact (created, updated, removed)
- Breaking change detection
- Solution impact assessment
- Migration risk analysis
analyze-workflow-dependencies
Performs deep analysis of workflow dependencies and nested workflow calls for migration planning.
Parameters:
token(required): Tray API token with project accessprojectExport(required): Exported project JSON containing workflow dataregion(optional): Tray region
Dependency Analysis:
- Cross-workflow dependency mapping
- Connector usage patterns
- Authentication usage analysis
- Nested workflow call chains
- Migration priority recommendations
- Comprehensive migration checklist
Migration Workflow Example
Here's a typical workflow migration process using these tools:
# 1. List available projects
tray-mcp-server list-projects --token=YOUR_TOKEN --workspaceId=WORKSPACE_ID
# 2. List project versions
tray-mcp-server list-project-versions --token=YOUR_TOKEN --projectId=PROJECT_ID
# 3. Export complete project for analysis
tray-mcp-server export-project-version --token=YOUR_TOKEN --projectId=PROJECT_ID --versionNumber=VERSION
# 4. Analyze workflow dependencies
tray-mcp-server analyze-workflow-dependencies --token=YOUR_TOKEN --projectExport=EXPORTED_DATA
# 5. Preview import impact (when migrating to new environment)
tray-mcp-server preview-project-import --token=YOUR_TOKEN --projectId=TARGET_PROJECT --exportedProjectJson=EXPORTED_DATAError Handling
The server includes comprehensive error handling:
- HTTP error responses are properly caught and reported
- Invalid parameters are validated using Zod schemas
- Network failures are gracefully handled
- Detailed error messages help with troubleshooting
Development
Building
npm run buildRunning in Development
npm run devProject Structure
src/
index.ts # Main MCP server implementation
dist/ # Compiled JavaScript output
package.json # Package configuration
tsconfig.json # TypeScript configuration
README.md # This fileContributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
MIT License - see the LICENSE file for details.
Links
Support
For issues related to this MCP server, please open an issue on GitHub. For Tray.io API questions, please refer to their official documentation.
