cyber-shuttle/mcp-server
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Cybershuttle MCP Server is a robust platform designed to facilitate seamless communication and data exchange between various systems using the Model Context Protocol (MCP).
Cybershuttle MCP Server
A Model Context Protocol (MCP) server for Apache Cybershuttle. This server enables AI agents to interact with the Cybershuttle research catalog, allowing natural language queries and operations on datasets, notebooks, models, repositories, projects, and sessions.
Features
- Complete Cybershuttle API Integration: Wraps all major Cybershuttle Research Service endpoints
- MCP Protocol Support: Fully compatible with Model Context Protocol for AI agent integration
- Authentication: OAuth2 device flow authentication with token management
- Tool Discovery: Comprehensive
/tools
endpoint for agent capability discovery - OpenAI Integration: Ready-to-use demo with OpenAI function calling
- Resource Management: Create, read, update, and delete operations for all resource types
- Session Management: Launch and manage interactive research sessions
- Project Organization: Create and manage research projects with multiple resources
Architecture
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā AI Agent ā ā MCP Server ā ā Cybershuttle ā
ā (OpenAI) āāāāāŗā āāāāāŗā API ā
ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
- AI Agent: OpenAI GPT-4 with function calling capabilities
- MCP Server: FastAPI-based server that wraps Cybershuttle APIs
- Cybershuttle API: Apache Airavata Research Service REST endpoints
Prerequisites
- Python 3.8+
- OpenAI API key (for the demo)
- Access to Cybershuttle platform (contact dev@airavata.apache.org for access)
Installation
- Clone the repository:
git clone https://github.com/cyber-shuttle/mcp-server.git
cd mcp-server
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
# Required for OpenAI demo
export OPENAI_API_KEY="your-openai-api-key"
# Cybershuttle access token (obtained via device flow)
export CS_ACCESS_TOKEN="your-cybershuttle-token"
Authentication
The server uses OAuth2 device flow authentication with the real Cybershuttle platform:
Get Authentication Token
- Run the authentication script:
python cybershuttle_auth.py
-
Follow the prompts:
- Visit the provided URL
- Enter the device code
- Login with your institutional credentials
-
Export the token:
export CS_ACCESS_TOKEN="your-token-from-script"
The authentication uses:
- Auth Server:
https://auth.cybershuttle.org
- API Server:
https://api.dev.cybershuttle.org:18899
- Client ID:
cybershuttle-agent
Usage
1. Start the MCP Server
python cybershuttle_mcp_server.py
The server will start on http://localhost:8000
. You can access the API documentation at http://localhost:8000/docs
.
2. Test the Server
Check the health endpoint:
curl http://localhost:8000/health
List available tools:
curl http://localhost:8000/tools
3. Run the OpenAI Demo
python cybershuttle_openai_demo.py
This will start an interactive chat session where you can ask questions about the Cybershuttle catalog.
Example Interactions
Here are some example prompts you can try with the AI agent:
Resource Discovery
- "Show me all datasets in the catalog"
- "Find notebooks related to machine learning"
- "Search for repositories about deep learning"
- "What tags are available in the catalog?"
Resource Management
- "Create a new dataset for climate research"
- "Add a notebook about data visualization"
- "Import a repository from GitHub"
Project Management
- "Create a new project for my research"
- "List all my projects"
- "Start a session for project XYZ"
Session Management
- "Show me all active sessions"
- "Start a new session for my machine learning project"
API Endpoints
The MCP server provides the following main endpoints:
Resource Management
GET /resources
- List all resources with filteringGET /resources/{id}
- Get specific resourcePOST /resources/dataset
- Create datasetPOST /resources/notebook
- Create notebookPOST /resources/repository
- Create repositoryPOST /resources/model
- Create modelGET /resources/search
- Search resourcesGET /resources/tags
- Get all tags
Project Management
GET /projects
- List projectsPOST /projects
- Create projectGET /projects/{owner_id}
- Get projects by ownerDELETE /projects/{id}
- Delete project
Session Management
GET /sessions
- List sessionsGET /hub/start-session/{project_id}
- Start sessionGET /hub/resume-session/{session_id}
- Resume sessionPATCH /sessions/{id}
- Update sessionDELETE /sessions/{id}
- Delete session
Tool Discovery
GET /tools
- List all available tools for agentsGET /health
- Health check
Monitoring and Logging
The server includes comprehensive logging and monitoring:
# Check server health
curl http://localhost:8000/health
# Monitor logs
tail -f logs/cybershuttle_mcp.log
Testing
Run the test suite:
# Quick test (MCP server only)
python test_cybershuttle_mcp.py --quick
# Full test suite
python test_cybershuttle_mcp.py
Test authentication:
python cybershuttle_auth.py
Troubleshooting
Common Issues
-
Authentication Errors:
- Ensure
CS_ACCESS_TOKEN
is set correctly - Check token expiration (tokens expire after ~2 hours)
- Verify API endpoint accessibility
- Ensure
-
OpenAI Integration Issues:
- Ensure
OPENAI_API_KEY
is set - Check OpenAI account credits
- Verify function definitions match server endpoints
- Ensure
-
Connection Issues:
- Check if Cybershuttle dev API is accessible
- Verify network connectivity
- Check firewall settings
Debug Mode
Run the server in debug mode:
python cybershuttle_mcp_server.py --debug
Project Structure
mcp-server/
āāā src/
ā āāā cybershuttle_mcp_server.py
ā āāā cybershuttle_auth.py
ā āāā __init__.py
āāā demos/
ā āāā cybershuttle_openai_demo.py
āāā tests/
ā āāā test_cybershuttle_mcp.py
āāā requirements.txt
āāā cybershuttle.yml
āāā README.md
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
This project is licensed under the Apache 2.0 License.
Acknowledgments
- Apache Airavata team for the Cybershuttle platform
- OpenAI for the function calling capabilities
- Model Context Protocol community