✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

TransportAI MCP Server

This is the backend server for the TransportAI project, implementing the Model Context Protocol (MCP) and integrating with the AviationStack API.

Project Structure

TransportAI/
├── server/             # FastAPI backend
│   └── main.py        # Main server file
├── Dockerfile         # Docker configuration
├── requirements.txt   # Python dependencies
└── .env              # Environment variables

Setup Instructions

Local Development

  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venvScriptsactivate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the root directory and add your AviationStack API key:
AVIATIONSTACK_API_KEY=your_api_key_here
  1. Start the server:
cd server
uvicorn main:app --reload

Smithery AI Deployment

  1. Ensure you have Docker installed on your system

  2. Build the Docker image:

docker build -t transportai-mcp .
  1. Test the Docker image locally:
docker run -p 8000:8000 -e AVIATIONSTACK_API_KEY=your_api_key_here transportai-mcp
  1. Deploy to Smithery AI:
    • Create a new project in Smithery AI
    • Upload the Dockerfile and related files
    • Set the environment variable AVIATIONSTACK_API_KEY
    • Deploy the application

API Endpoints

MCP Protocol Endpoints

  • GET /: Server status and version information
  • GET /mcp/health: Health check endpoint
  • POST /mcp/query: Main MCP query endpoint
    • Request body:
      {
        "context": {
          "session_id": "optional_session_id"
        },
        "query": "Get information for flight TK123",
        "parameters": {
          "flight_iata": "TK123"
        }
      }
      

Testing the MCP Server

You can test the MCP server using curl:

curl -X POST http://localhost:8000/mcp/query 
  -H "Content-Type: application/json" 
  -d '{
    "context": {"session_id": "test_session"},
    "query": "Get information for flight TK123",
    "parameters": {"flight_iata": "TK123"}
  }'

License

MIT

Featured Templates

View More

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.