McpServer_DataFair

data354/McpServer_DataFair

3.2

If you are the rightful owner of McpServer_DataFair 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.

A Model Context Protocol (MCP) server for DataFair portal integration with Streamlit client example.

McpServer_DataFair

šŸš€ A Model Context Protocol (MCP) server for DataFair portal integration with Streamlit client example

šŸ“‹ Overview

This project provides access to DataFair portal data through an MCP server and offers a concrete client example demonstrating how to query the server and leverage the obtained results. The implementation showcases the power of MCP architecture for data integration and AI-powered data exploration.

šŸ—ļø Architecture

The project consists of two main components:

  • MCP Server (mcp_server.py): Exposes DataFair portal data through the Model Context Protocol
  • Streamlit Client (client.py): Interactive web interface that demonstrates server interaction capabilities

⚔ Quick Start

Prerequisites

  • Python 3+
  • Required dependencies (install via pip install -r requirements.txt)
  • DataFair portal access credentials

Environment Setup

  1. Clone the repository:
git clone https://github.com/data354/McpServer_DataFair.git
cd McpServer_DataFair
  1. Create and configure your environment file:
cp .env.example .env
# Edit .env with your DataFair credentials
  1. Install dependencies:
pip install -r requirements.txt

šŸš€ Running the Project

Option 1: Standard Server Launch

Launch the MCP server in listening mode:

python mcp_server.py

The server will start and listen for incoming MCP connections.

Option 2: Development Mode with MCP SDK

For development and testing with MCP SDK tools:

mcp dev mcp_server.py

This launches the server with MCP development tools and enhanced debugging capabilities.

Running the Streamlit Client

In a separate terminal, launch the interactive Streamlit client:

streamlit run client.py

The web interface will be available at http://localhost:8501

šŸŽÆ Features

MCP Server Capabilities

  • āœ… DataFair portal data exposure
  • āœ… RESTful API integration
  • āœ… Real-time data querying
  • āœ… Structured data responses
  • āœ… Error handling and logging

Streamlit Client Features

  • šŸ¤– AI-powered data exploration
  • šŸ’¬ Conversational interface
  • šŸ“Š Data visualization
  • šŸ’¾ Conversation history
  • šŸ“± Responsive design
  • šŸ”„ Real-time data updates

šŸ› ļø Usage Example

  1. Start the MCP server using one of the methods above
  2. Launch the Streamlit client to access the web interface
  3. Ask questions about DataFair data through the chat interface
  4. Explore visualizations and export results as needed

šŸ“ Project Structure

McpServer_DataFair/
ā”œā”€ā”€ mcp_server.py          # MCP server implementation
ā”œā”€ā”€ client.py              # Streamlit client application
ā”œā”€ā”€ requirements.txt       # Python dependencies
ā”œā”€ā”€ .env.example          # Environment variables template
ā”œā”€ā”€ .gitignore            # Git ignore rules
└── README.md             # This file

šŸ”§ Configuration

The project uses environment variables for configuration. Key variables include:

  • DATAFAIR_API_URL: DataFair portal API endpoint
  • DATAFAIR_API_KEY: Authentication key for DataFair access
  • OPENAI_API_KEY: OpenAI API key for AI functionality

šŸŽ‰ Conclusion

This project demonstrates the seamless integration between DataFair portal data and modern AI interfaces through the Model Context Protocol. By combining MCP's standardized communication with Streamlit's interactive capabilities, we've created a powerful tool for data exploration and analysis.

The MCP architecture ensures scalable and maintainable data access, while the Streamlit client provides an intuitive interface for both technical and non-technical users. This combination opens up new possibilities for data democratization and AI-powered insights.

Ready to explore your data? Start the servers and dive in! šŸš€


Developed by Data354