data354/McpServer_DataFair
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
- Clone the repository:
git clone https://github.com/data354/McpServer_DataFair.git
cd McpServer_DataFair
- Create and configure your environment file:
cp .env.example .env
# Edit .env with your DataFair credentials
- 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
- Start the MCP server using one of the methods above
- Launch the Streamlit client to access the web interface
- Ask questions about DataFair data through the chat interface
- 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 endpointDATAFAIR_API_KEY
: Authentication key for DataFair accessOPENAI_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