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.
- 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
/toolsendpoint 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
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ 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
- Python 3.8+
- OpenAI API key (for the demo)
- Access to Cybershuttle platform (contact [email protected] for access)
- 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"The server uses OAuth2 device flow authentication with the real Cybershuttle platform:
- 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
python cybershuttle_mcp_server.pyThe server will start on http://localhost:8000. You can access the API documentation at http://localhost:8000/docs.
Check the health endpoint:
curl http://localhost:8000/healthList available tools:
curl http://localhost:8000/toolspython cybershuttle_openai_demo.pyThis will start an interactive chat session where you can ask questions about the Cybershuttle catalog.
Here are some example prompts you can try with the AI agent:
- "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?"
- "Create a new dataset for climate research"
- "Add a notebook about data visualization"
- "Import a repository from GitHub"
- "Create a new project for my research"
- "List all my projects"
- "Start a session for project XYZ"
- "Show me all active sessions"
- "Start a new session for my machine learning project"
The MCP server provides the following main endpoints:
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
GET /projects- List projectsPOST /projects- Create projectGET /projects/{owner_id}- Get projects by ownerDELETE /projects/{id}- Delete project
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
GET /tools- List all available tools for agentsGET /health- Health check
The server includes comprehensive logging and monitoring:
# Check server health
curl http://localhost:8000/health
# Monitor logs
tail -f logs/cybershuttle_mcp.logRun the test suite:
# Quick test (MCP server only)
python test_cybershuttle_mcp.py --quick
# Full test suite
python test_cybershuttle_mcp.pyTest authentication:
python cybershuttle_auth.py-
Authentication Errors:
- Ensure
CS_ACCESS_TOKENis set correctly - Check token expiration (tokens expire after ~2 hours)
- Verify API endpoint accessibility
- Ensure
-
OpenAI Integration Issues:
- Ensure
OPENAI_API_KEYis 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
Run the server in debug mode:
python cybershuttle_mcp_server.py --debugmcp-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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the Apache 2.0 License.
- Apache Airavata team for the Cybershuttle platform
- OpenAI for the function calling capabilities
- Model Context Protocol community